CVS commit: src/tests/lib/libcurses/director

2023-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Dec 10 18:04:55 UTC 2023

Modified Files:
src/tests/lib/libcurses/director: testlang_conf.l

Log Message:
tests/libcurses: require 3 digits in octal character escapes

Previously, the string literal "\0" had been interpreted as "0", which
would have made the backslash redundant.  The tests don't use this form.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/lib/libcurses/director/testlang_conf.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/director

2023-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Dec 10 18:04:55 UTC 2023

Modified Files:
src/tests/lib/libcurses/director: testlang_conf.l

Log Message:
tests/libcurses: require 3 digits in octal character escapes

Previously, the string literal "\0" had been interpreted as "0", which
would have made the backslash redundant.  The tests don't use this form.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/lib/libcurses/director/testlang_conf.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_conf.l
diff -u src/tests/lib/libcurses/director/testlang_conf.l:1.26 src/tests/lib/libcurses/director/testlang_conf.l:1.27
--- src/tests/lib/libcurses/director/testlang_conf.l:1.26	Mon Nov 15 21:45:46 2021
+++ src/tests/lib/libcurses/director/testlang_conf.l	Sun Dec 10 18:04:55 2023
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_conf.l,v 1.26 2021/11/15 21:45:46 blymn Exp $ 	*/
+/*	$NetBSD: testlang_conf.l,v 1.27 2023/12/10 18:04:55 rillig Exp $ 	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -86,7 +86,11 @@ dequote(const char *s, size_t *len)
 	(p[2] - '0');
 	p += 3;
 } else {
-	*q++ = *p++;
+	errx(2,
+	"%s:%zu: Invalid escape sequence "
+	"'\\%c' in string literal; octal "
+	"numbers must be 3 digits wide",
+	cur_file, line, *p);
 }
 continue;
 			}



CVS commit: src/tests/lib/libcurses/director

2023-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Dec 10 15:51:13 UTC 2023

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: constify


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/director

2023-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Dec 10 15:51:13 UTC 2023

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: constify


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_parse.y
diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.53 src/tests/lib/libcurses/director/testlang_parse.y:1.54
--- src/tests/lib/libcurses/director/testlang_parse.y:1.53	Sun Jun 13 11:06:20 2021
+++ src/tests/lib/libcurses/director/testlang_parse.y	Sun Dec 10 15:51:13 2023
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_parse.y,v 1.53 2021/06/13 11:06:20 rillig Exp $	*/
+/*	$NetBSD: testlang_parse.y,v 1.54 2023/12/10 15:51:13 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -141,7 +141,7 @@ static void	save_slave_output(bool);
 static void	validate_type(data_enum_t, ct_data_t *, int);
 static void	set_var(data_enum_t, const char *, void *);
 static void	validate_reference(int, void *);
-static char *	numeric_or(char *, char *);
+static char *	numeric_or(const char *, const char *);
 static char *	get_numeric_var(const char *);
 static void	perform_delay(struct timespec *);
 static void	set_cchar(char *, void *);
@@ -517,7 +517,7 @@ get_numeric_var(const char *var)
  * Perform a bitwise OR on two numbers and return the result.
  */
 static char *
-numeric_or(char *n1, char *n2)
+numeric_or(const char *n1, const char *n2)
 {
 	unsigned long i1, i2, result;
 	char *ret;



CVS commit: src/tests/lib/libcurses/slave

2023-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Dec 10 15:42:29 UTC 2023

Modified Files:
src/tests/lib/libcurses/slave: commands.c

Log Message:
tests/libcurses: fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/lib/libcurses/slave/commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2023-12-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Dec 10 15:42:29 UTC 2023

Modified Files:
src/tests/lib/libcurses/slave: commands.c

Log Message:
tests/libcurses: fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/lib/libcurses/slave/commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/commands.c
diff -u src/tests/lib/libcurses/slave/commands.c:1.17 src/tests/lib/libcurses/slave/commands.c:1.18
--- src/tests/lib/libcurses/slave/commands.c:1.17	Mon Dec  6 22:45:42 2021
+++ src/tests/lib/libcurses/slave/commands.c	Sun Dec 10 15:42:29 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: commands.c,v 1.17 2021/12/06 22:45:42 rillig Exp $	*/
+/*	$NetBSD: commands.c,v 1.18 2023/12/10 15:42:29 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -194,7 +194,7 @@ report_message(data_enum_t type, const c
 }
 
 /*
- * Report a string of chtype back to the director via the command pipe.
+ * Report a single chtype back to the director via the command pipe.
  */
 void
 report_byte(chtype c)



CVS commit: src/tests/lib/libcurses

2023-12-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Dec  3 09:42:36 UTC 2023

Modified Files:
src/tests/lib/libcurses: testframe.txt

Log Message:
tests/libcurses: sync documentation with reality

Unknown escape sequences in string literals trigger an error, since
testlang_conf.l 1.22 from 2021-02-25.

The '\b' is recognized since testlang_conf.l 1.26 from 2021-11-15.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libcurses/testframe.txt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/testframe.txt
diff -u src/tests/lib/libcurses/testframe.txt:1.8 src/tests/lib/libcurses/testframe.txt:1.9
--- src/tests/lib/libcurses/testframe.txt:1.8	Tue Feb  9 20:31:02 2021
+++ src/tests/lib/libcurses/testframe.txt	Sun Dec  3 09:42:36 2023
@@ -1,4 +1,4 @@
-$NetBSD: testframe.txt,v 1.8 2021/02/09 20:31:02 rillig Exp $
+$NetBSD: testframe.txt,v 1.9 2023/12/03 09:42:36 rillig Exp $
 
 CURSES TESTFRAME
 
@@ -231,6 +231,7 @@ performed on them when they are parsed. 
 embed some control characters into the string.  Valid substitutions
 are:
 
+	\b	backspace
 	\e	escape
 	\n	new line
 	\r	carriage return
@@ -240,9 +241,6 @@ are:
 		represented by the octal number will be inserted into
 		the string.
 
-Any other invalid conversions will have the \ stripped and the
-subsequent characters inserted into the string.
-
 Integers may be specified by either a plain numeric (e.g. 12345) or by
 hexadecimal notation by prefixing the number with 0x (e.g. 0x3039).
 Internally, no distinction is made between the two formats and they



CVS commit: src/tests/lib/libcurses

2023-12-03 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Dec  3 09:42:36 UTC 2023

Modified Files:
src/tests/lib/libcurses: testframe.txt

Log Message:
tests/libcurses: sync documentation with reality

Unknown escape sequences in string literals trigger an error, since
testlang_conf.l 1.22 from 2021-02-25.

The '\b' is recognized since testlang_conf.l 1.26 from 2021-11-15.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libcurses/testframe.txt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2023-10-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Oct  5 06:15:58 UTC 2023

Modified Files:
src/tests/lib/libcurses/check_files: addstr3.chk waddstr2.chk

Log Message:
Update check files affected by a fix to addbyte.c in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr2.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2023-10-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Oct  5 06:15:58 UTC 2023

Modified Files:
src/tests/lib/libcurses/check_files: addstr3.chk waddstr2.chk

Log Message:
Update check files affected by a fix to addbyte.c in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr2.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/addstr3.chk
diff -u src/tests/lib/libcurses/check_files/addstr3.chk:1.4 src/tests/lib/libcurses/check_files/addstr3.chk:1.5
--- src/tests/lib/libcurses/check_files/addstr3.chk:1.4	Fri Nov  4 06:17:58 2022
+++ src/tests/lib/libcurses/check_files/addstr3.chk	Thu Oct  5 06:15:58 2023
@@ -1,2 +1,2 @@
-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup24;1X()cup24;76Xel()clearcup23;76Xa
+0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup24;1X()cup24;76Xel()clearcup23;76Xa
 hello
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/waddstr2.chk
diff -u src/tests/lib/libcurses/check_files/waddstr2.chk:1.1 src/tests/lib/libcurses/check_files/waddstr2.chk:1.2
--- src/tests/lib/libcurses/check_files/waddstr2.chk:1.1	Thu Nov 10 06:13:29 2022
+++ src/tests/lib/libcurses/check_files/waddstr2.chk	Thu Oct  5 06:15:58 2023
@@ -1,3 +1,6 @@
-012345cup5;6X6cup6;8Xel
+  8el
+ 012345
+ 012345
+ 6 el
8el
  el
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2022-12-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Dec  5 21:15:07 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: deleteln1.chk insdelln1.chk
insertln1.chk scroll1.chk

Log Message:
Update check files due to reversion of a libcurses change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/deleteln1.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/insdelln1.chk \
src/tests/lib/libcurses/check_files/insertln1.chk \
src/tests/lib/libcurses/check_files/scroll1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/deleteln1.chk
diff -u src/tests/lib/libcurses/check_files/deleteln1.chk:1.3 src/tests/lib/libcurses/check_files/deleteln1.chk:1.4
--- src/tests/lib/libcurses/check_files/deleteln1.chk:1.3	Wed Nov 30 06:20:17 2022
+++ src/tests/lib/libcurses/check_files/deleteln1.chk	Mon Dec  5 21:15:07 2022
@@ -1 +1 @@
-cup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup24;1Xindn1Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/insdelln1.chk
diff -u src/tests/lib/libcurses/check_files/insdelln1.chk:1.2 src/tests/lib/libcurses/check_files/insdelln1.chk:1.3
--- src/tests/lib/libcurses/check_files/insdelln1.chk:1.2	Wed Nov 30 06:20:17 2022
+++ src/tests/lib/libcurses/check_files/insdelln1.chk	Mon Dec  5 21:15:07 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup16;1Xrin3Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup16;1Xrin2Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/insertln1.chk
diff -u src/tests/lib/libcurses/check_files/insertln1.chk:1.2 src/tests/lib/libcurses/check_files/insertln1.chk:1.3
--- src/tests/lib/libcurses/check_files/insertln1.chk:1.2	Wed Nov 30 06:20:17 2022
+++ src/tests/lib/libcurses/check_files/insertln1.chk	Mon Dec  5 21:15:07 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup16;1Xrin2Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup16;1Xrin1Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/scroll1.chk
diff -u src/tests/lib/libcurses/check_files/scroll1.chk:1.2 src/tests/lib/libcurses/check_files/scroll1.chk:1.3
--- src/tests/lib/libcurses/check_files/scroll1.chk:1.2	Wed Nov 30 06:20:17 2022
+++ src/tests/lib/libcurses/check_files/scroll1.chk	Mon Dec  5 21:15:07 2022
@@ -1 +1 @@
-cup6;6X
\ No newline at end of file
+csr1;24Xhomehomecup24;1Xindn1Xcsr1;24Xhomehomecup24;1Xcup6;6X
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2022-12-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Dec  5 21:15:07 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: deleteln1.chk insdelln1.chk
insertln1.chk scroll1.chk

Log Message:
Update check files due to reversion of a libcurses change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/deleteln1.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/insdelln1.chk \
src/tests/lib/libcurses/check_files/insertln1.chk \
src/tests/lib/libcurses/check_files/scroll1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2022-11-29 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Nov 30 06:20:17 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: deleteln1.chk insdelln1.chk
insertln1.chk scroll1.chk

Log Message:
Update the check files due to bug fix in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/deleteln1.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/insdelln1.chk \
src/tests/lib/libcurses/check_files/insertln1.chk \
src/tests/lib/libcurses/check_files/scroll1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/deleteln1.chk
diff -u src/tests/lib/libcurses/check_files/deleteln1.chk:1.2 src/tests/lib/libcurses/check_files/deleteln1.chk:1.3
--- src/tests/lib/libcurses/check_files/deleteln1.chk:1.2	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/deleteln1.chk	Wed Nov 30 06:20:17 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup24;1Xindn1Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+cup16;1X
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/insdelln1.chk
diff -u src/tests/lib/libcurses/check_files/insdelln1.chk:1.1 src/tests/lib/libcurses/check_files/insdelln1.chk:1.2
--- src/tests/lib/libcurses/check_files/insdelln1.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/insdelln1.chk	Wed Nov 30 06:20:17 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup16;1Xrin2Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup16;1Xrin3Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/insertln1.chk
diff -u src/tests/lib/libcurses/check_files/insertln1.chk:1.1 src/tests/lib/libcurses/check_files/insertln1.chk:1.2
--- src/tests/lib/libcurses/check_files/insertln1.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/insertln1.chk	Wed Nov 30 06:20:17 2022
@@ -1 +1 @@
-csr16;24Xhomehomecup16;1Xrin1Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
+csr16;24Xhomehomecup16;1Xrin2Xcsr1;24Xhomehomecup24;1Xcup16;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/scroll1.chk
diff -u src/tests/lib/libcurses/check_files/scroll1.chk:1.1 src/tests/lib/libcurses/check_files/scroll1.chk:1.2
--- src/tests/lib/libcurses/check_files/scroll1.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/scroll1.chk	Wed Nov 30 06:20:17 2022
@@ -1 +1 @@
-csr1;24Xhomehomecup24;1Xindn1Xcsr1;24Xhomehomecup24;1Xcup6;6X
\ No newline at end of file
+cup6;6X
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2022-11-29 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Nov 30 06:20:17 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: deleteln1.chk insdelln1.chk
insertln1.chk scroll1.chk

Log Message:
Update the check files due to bug fix in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/deleteln1.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/insdelln1.chk \
src/tests/lib/libcurses/check_files/insertln1.chk \
src/tests/lib/libcurses/check_files/scroll1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:29 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile waddstr.chk
src/tests/lib/libcurses/tests: waddstr
Added Files:
src/tests/lib/libcurses/check_files: waddstr2.chk

Log Message:
Uncomment the waddstr call that was returning ERR, this is actually
correct so make the expected return ERR then repeat the call with
scrollok set to true to validate.

Do refreshes on the window instead of stdscr so we get the window
contents reported and update the check files with the expected
output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr.chk
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/waddstr2.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/waddstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.11 src/tests/lib/libcurses/check_files/Makefile:1.12
--- src/tests/lib/libcurses/check_files/Makefile:1.11	Tue Nov  8 06:06:54 2022
+++ src/tests/lib/libcurses/check_files/Makefile	Thu Nov 10 06:13:29 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2022/11/08 06:06:54 blymn Exp $
+# $NetBSD: Makefile,v 1.12 2022/11/10 06:13:29 blymn Exp $
 
 NOMAN=		# defined
 
@@ -241,6 +241,7 @@ FILES+=		waddchstr.chk
 FILES+=		waddnwstr1.chk
 FILES+=		waddnwstr2.chk
 FILES+=		waddstr.chk
+FILES+=		waddstr2.chk
 FILES+=		waddwstr1.chk
 FILES+=		waddwstr2.chk
 FILES+=		waddwstr3.chk

Index: src/tests/lib/libcurses/check_files/waddstr.chk
diff -u src/tests/lib/libcurses/check_files/waddstr.chk:1.1 src/tests/lib/libcurses/check_files/waddstr.chk:1.2
--- src/tests/lib/libcurses/check_files/waddstr.chk:1.1	Sun Feb  7 01:53:54 2021
+++ src/tests/lib/libcurses/check_files/waddstr.chk	Thu Nov 10 06:13:29 2022
@@ -1 +1,3 @@
-home
\ No newline at end of file
+abcdecup6;8X8
+ 012345
+ 68 
\ No newline at end of file

Index: src/tests/lib/libcurses/tests/waddstr
diff -u src/tests/lib/libcurses/tests/waddstr:1.2 src/tests/lib/libcurses/tests/waddstr:1.3
--- src/tests/lib/libcurses/tests/waddstr:1.2	Sun Feb  7 01:53:54 2021
+++ src/tests/lib/libcurses/tests/waddstr	Thu Nov 10 06:13:29 2022
@@ -2,8 +2,12 @@ include window
 call OK waddstr $win1 "abcde\n"
 call OK waddstr $win1 "\n"
 call OK waddstr $win1 "\t8\n"
-# XXX: The following line causes an unexpected "ERR Resource temporarily
-# unavailable" on NetBSD/amd64 9.99.80.
-#call OK waddstr $win1 "0123456\t8\n"
-call OK refresh
+# The following should ERR because it will try to scroll but
+# scrollok is false
+call ERR waddstr $win1 "0123456\t8\n"
+call OK wrefresh $win1
 compare waddstr.chk
+call OK scrollok $win1 $TRUE
+call OK waddstr $win1 "0123456\t8\n"
+call OK wrefresh $win1
+compare waddstr2.chk

Added files:

Index: src/tests/lib/libcurses/check_files/waddstr2.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/waddstr2.chk:1.1
--- /dev/null	Thu Nov 10 06:13:29 2022
+++ src/tests/lib/libcurses/check_files/waddstr2.chk	Thu Nov 10 06:13:29 2022
@@ -0,0 +1,3 @@
+012345cup5;6X6cup6;8Xel
+   8el
+ el
\ No newline at end of file



CVS commit: src/tests/lib/libcurses

2022-11-09 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Nov 10 06:13:29 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile waddstr.chk
src/tests/lib/libcurses/tests: waddstr
Added Files:
src/tests/lib/libcurses/check_files: waddstr2.chk

Log Message:
Uncomment the waddstr call that was returning ERR, this is actually
correct so make the expected return ERR then repeat the call with
scrollok set to true to validate.

Do refreshes on the window instead of stdscr so we get the window
contents reported and update the check files with the expected
output.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/waddstr.chk
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/waddstr2.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/waddstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-11-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov  8 06:06:54 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: slk
Added Files:
src/tests/lib/libcurses/check_files: slk7.chk

Log Message:
* Uncomment the slk_wset test which was previously commented out due
  to incorrect output as this bug has been fixed.
* Added a check file to verify the slk_wset output.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/slk7.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.10 src/tests/lib/libcurses/check_files/Makefile:1.11
--- src/tests/lib/libcurses/check_files/Makefile:1.10	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/check_files/Makefile	Tue Nov  8 06:06:54 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2022/04/20 07:43:05 blymn Exp $
+# $NetBSD: Makefile,v 1.11 2022/11/08 06:06:54 blymn Exp $
 
 NOMAN=		# defined
 
@@ -222,6 +222,7 @@ FILES+=		slk3.chk
 FILES+=		slk4.chk
 FILES+=		slk5.chk
 FILES+=		slk6.chk
+FILES+=		slk7.chk
 FILES+=		slk_init.chk
 FILES+=		timeout.chk
 FILES+=		touchline1.chk

Index: src/tests/lib/libcurses/tests/slk
diff -u src/tests/lib/libcurses/tests/slk:1.4 src/tests/lib/libcurses/tests/slk:1.5
--- src/tests/lib/libcurses/tests/slk:1.4	Tue Jun 22 07:29:16 2021
+++ src/tests/lib/libcurses/tests/slk	Tue Nov  8 06:06:54 2022
@@ -54,7 +54,7 @@ call OK slk_refresh
 compare slk6.chk
 
 # test slk_wset
-# [buggy??] 'b' should be printed as (wcswidth(wstr) == 6) <= 8 
-#wchar WSTR [0x3401, "a", 0x3401, "b"]
-#call OK slk_wset 3 $WSTR 1
-#call OK slk_refresh
+wchar WSTR [0x3401, "a", 0x3401, "b"]
+call OK slk_wset 3 $WSTR 1
+call OK slk_refresh
+compare slk7.chk

Added files:

Index: src/tests/lib/libcurses/check_files/slk7.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/slk7.chk:1.1
--- /dev/null	Tue Nov  8 06:06:54 2022
+++ src/tests/lib/libcurses/check_files/slk7.chk	Tue Nov  8 06:06:54 2022
@@ -0,0 +1 @@
+cup24;19Xsetaf1Xsetab2Xsmulrev 㐁a㐁b rmulsgr0op
\ No newline at end of file



CVS commit: src/tests/lib/libcurses

2022-11-07 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov  8 06:06:54 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: slk
Added Files:
src/tests/lib/libcurses/check_files: slk7.chk

Log Message:
* Uncomment the slk_wset test which was previously commented out due
  to incorrect output as this bug has been fixed.
* Added a check file to verify the slk_wset output.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/slk7.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2022-11-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Nov  4 06:17:59 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: addstr3.chk copywin6.chk
copywin7.chk

Log Message:
Update check files to allow for changes due to fixes to libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/copywin6.chk \
src/tests/lib/libcurses/check_files/copywin7.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/addstr3.chk
diff -u src/tests/lib/libcurses/check_files/addstr3.chk:1.3 src/tests/lib/libcurses/check_files/addstr3.chk:1.4
--- src/tests/lib/libcurses/check_files/addstr3.chk:1.3	Tue Apr 12 07:04:19 2022
+++ src/tests/lib/libcurses/check_files/addstr3.chk	Fri Nov  4 06:17:58 2022
@@ -1,5 +1,2 @@
-csr2;24Xhomehome
-rin1Xcsr1;24Xhomehomecup24;1Xhome
-()cup23;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup2;3Xclearcsr2;23Xhome
-rin1Xcsr1;24Xhomehome
-hellocup23;76Xacup2;6X
\ No newline at end of file
+0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup24;1X()cup24;76Xel()clearcup23;76Xa
+hello
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/copywin6.chk
diff -u src/tests/lib/libcurses/check_files/copywin6.chk:1.4 src/tests/lib/libcurses/check_files/copywin6.chk:1.5
--- src/tests/lib/libcurses/check_files/copywin6.chk:1.4	Tue Jun 22 07:49:58 2021
+++ src/tests/lib/libcurses/check_files/copywin6.chk	Fri Nov  4 06:17:58 2022
@@ -1,4 +1,4 @@
 cup3;6Xstingt
  ingtes
  gtesti
- estingcup4;6X
\ No newline at end of file
+ estingcup8;6X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/copywin7.chk
diff -u src/tests/lib/libcurses/check_files/copywin7.chk:1.4 src/tests/lib/libcurses/check_files/copywin7.chk:1.5
--- src/tests/lib/libcurses/check_files/copywin7.chk:1.4	Tue Jun 22 07:49:58 2021
+++ src/tests/lib/libcurses/check_files/copywin7.chk	Fri Nov  4 06:17:58 2022
@@ -1,4 +1,4 @@
-el
+el
  el
  el
  elcup11;15Xelcup12;15Xelcup13;15Xelcup14;15Xelcup15;15Xelcup17;15Xel
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2022-11-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Nov  4 06:17:59 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: addstr3.chk copywin6.chk
copywin7.chk

Log Message:
Update check files to allow for changes due to fixes to libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/check_files/copywin6.chk \
src/tests/lib/libcurses/check_files/copywin7.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-10-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Oct 19 06:10:44 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: add_wch3.chk copywin10.chk
delch2.chk delch3.chk delch6.chk delch7.chk get_wstr.chk
getn_wstr.chk ins_wch2.chk ins_wch3.chk redrawwin2.chk
touchline2.chk wcolor_set.chk wget_wstr.chk wgetn_wstr.chk
wins_wch2.chk wins_wch3.chk wins_wstr4.chk wvline_set.chk
src/tests/lib/libcurses/tests: ins_wch

Log Message:
Updates to account for changes resulting from fixes to libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/add_wch3.chk \
src/tests/lib/libcurses/check_files/delch3.chk \
src/tests/lib/libcurses/check_files/get_wstr.chk \
src/tests/lib/libcurses/check_files/getn_wstr.chk \
src/tests/lib/libcurses/check_files/ins_wch2.chk \
src/tests/lib/libcurses/check_files/ins_wch3.chk \
src/tests/lib/libcurses/check_files/wcolor_set.chk \
src/tests/lib/libcurses/check_files/wget_wstr.chk \
src/tests/lib/libcurses/check_files/wgetn_wstr.chk \
src/tests/lib/libcurses/check_files/wins_wch2.chk \
src/tests/lib/libcurses/check_files/wvline_set.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/copywin10.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/delch2.chk \
src/tests/lib/libcurses/check_files/delch6.chk \
src/tests/lib/libcurses/check_files/delch7.chk \
src/tests/lib/libcurses/check_files/redrawwin2.chk \
src/tests/lib/libcurses/check_files/touchline2.chk \
src/tests/lib/libcurses/check_files/wins_wstr4.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/ins_wch

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/add_wch3.chk
diff -u src/tests/lib/libcurses/check_files/add_wch3.chk:1.2 src/tests/lib/libcurses/check_files/add_wch3.chk:1.3
--- src/tests/lib/libcurses/check_files/add_wch3.chk:1.2	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/check_files/add_wch3.chk	Wed Oct 19 06:10:43 2022
@@ -1,2 +1,2 @@
 smso㐁rmsohome
-㐁㐁 
\ No newline at end of file
+
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/delch3.chk
diff -u src/tests/lib/libcurses/check_files/delch3.chk:1.2 src/tests/lib/libcurses/check_files/delch3.chk:1.3
--- src/tests/lib/libcurses/check_files/delch3.chk:1.2	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/delch3.chk	Wed Oct 19 06:10:43 2022
@@ -1 +1 @@
-stsmsotrmso  tessmsotrmso   tes
\ No newline at end of file
+stsmsotrmso  tessmsotelrmso
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/get_wstr.chk
diff -u src/tests/lib/libcurses/check_files/get_wstr.chk:1.2 src/tests/lib/libcurses/check_files/get_wstr.chk:1.3
--- src/tests/lib/libcurses/check_files/get_wstr.chk:1.2	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/check_files/get_wstr.chk	Wed Oct 19 06:10:43 2022
@@ -1,6 +1,6 @@
 
 
㐁el
-a   cup4;2Xab  cup4;3Xcup4;1Xc   cup4;2Xcd  cup4;3Xcde cup4;4Xcd  cup4;3Xcdf cup4;4X
-a   cup5;6Xab  cup5;7Xa   cup5;6Xac  cup5;7Xacd cup5;8Xacdcup5;9XacdO   cup5;10XacdOD  cup5;11Xsmkx
-  a  cup6;3X ab cup6;4X abccup6;5Xel  d  cup6;3X
\ No newline at end of file
+aelabelelcelcdelcdeelcdelcdfel
+ael   

CVS commit: src/tests/lib/libcurses

2022-10-19 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Oct 19 06:10:44 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: add_wch3.chk copywin10.chk
delch2.chk delch3.chk delch6.chk delch7.chk get_wstr.chk
getn_wstr.chk ins_wch2.chk ins_wch3.chk redrawwin2.chk
touchline2.chk wcolor_set.chk wget_wstr.chk wgetn_wstr.chk
wins_wch2.chk wins_wch3.chk wins_wstr4.chk wvline_set.chk
src/tests/lib/libcurses/tests: ins_wch

Log Message:
Updates to account for changes resulting from fixes to libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/add_wch3.chk \
src/tests/lib/libcurses/check_files/delch3.chk \
src/tests/lib/libcurses/check_files/get_wstr.chk \
src/tests/lib/libcurses/check_files/getn_wstr.chk \
src/tests/lib/libcurses/check_files/ins_wch2.chk \
src/tests/lib/libcurses/check_files/ins_wch3.chk \
src/tests/lib/libcurses/check_files/wcolor_set.chk \
src/tests/lib/libcurses/check_files/wget_wstr.chk \
src/tests/lib/libcurses/check_files/wgetn_wstr.chk \
src/tests/lib/libcurses/check_files/wins_wch2.chk \
src/tests/lib/libcurses/check_files/wvline_set.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/copywin10.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/delch2.chk \
src/tests/lib/libcurses/check_files/delch6.chk \
src/tests/lib/libcurses/check_files/delch7.chk \
src/tests/lib/libcurses/check_files/redrawwin2.chk \
src/tests/lib/libcurses/check_files/touchline2.chk \
src/tests/lib/libcurses/check_files/wins_wstr4.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/ins_wch

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 22:18:16 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: mutt_test

Log Message:
Add mutt_test to the test runs, this test tries to emulate a real
curses application to test the interaction of various curses calls.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/mutt_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 22:18:16 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: mutt_test

Log Message:
Add mutt_test to the test runs, this test tries to emulate a real
curses application to test the interaction of various curses calls.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/mutt_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.31 src/tests/lib/libcurses/t_curses.sh:1.32
--- src/tests/lib/libcurses/t_curses.sh:1.31	Tue Apr 26 22:48:36 2022
+++ src/tests/lib/libcurses/t_curses.sh	Tue May  3 22:18:16 2022
@@ -2187,6 +2187,20 @@ wunderscore_body()
 	h_run wunderscore
 }
 
+##
+# Simulate curses application behaviour
+##
+
+atf_test_case mutt_test
+mutt_test_head()
+{
+	atf_set "descr" "Try to emulate a curses application"
+}
+mutt_test_body()
+{
+	h_run mutt_test
+}
+
 atf_init_test_cases()
 {
 	# testframe utility functions
@@ -2444,4 +2458,7 @@ atf_init_test_cases()
 	# curses underscore attribute manipulation routines
 	atf_add_test_case underscore
 	atf_add_test_case wunderscore
+
+	# emulate a curses application
+	atf_add_test_case mutt_test
 }

Index: src/tests/lib/libcurses/tests/mutt_test
diff -u src/tests/lib/libcurses/tests/mutt_test:1.2 src/tests/lib/libcurses/tests/mutt_test:1.3
--- src/tests/lib/libcurses/tests/mutt_test:1.2	Thu Sep 19 11:31:58 2019
+++ src/tests/lib/libcurses/tests/mutt_test	Tue May  3 22:18:16 2022
@@ -1,3 +1,8 @@
+#
+# This test attempts to emulate some of the behaviours of mutt, it is neither
+# an exact nor complete emulation of what mutt does but it does test the
+# interaction of various call types.
+#
 include start_color
 include fill_screen
 comparend mutt_test1.chk



CVS commit: src/tests/lib/libcurses/check_files

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 22:01:13 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: mutt_test1.chk mutt_test3.chk
mutt_test4.chk mutt_test5.chk mutt_test6.chk mutt_test8.chk
mutt_test9.chk

Log Message:
Update check files, changes due to bug fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/mutt_test1.chk \
src/tests/lib/libcurses/check_files/mutt_test3.chk \
src/tests/lib/libcurses/check_files/mutt_test8.chk \
src/tests/lib/libcurses/check_files/mutt_test9.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/mutt_test4.chk \
src/tests/lib/libcurses/check_files/mutt_test5.chk \
src/tests/lib/libcurses/check_files/mutt_test6.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 22:01:13 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: mutt_test1.chk mutt_test3.chk
mutt_test4.chk mutt_test5.chk mutt_test6.chk mutt_test8.chk
mutt_test9.chk

Log Message:
Update check files, changes due to bug fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/mutt_test1.chk \
src/tests/lib/libcurses/check_files/mutt_test3.chk \
src/tests/lib/libcurses/check_files/mutt_test8.chk \
src/tests/lib/libcurses/check_files/mutt_test9.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/mutt_test4.chk \
src/tests/lib/libcurses/check_files/mutt_test5.chk \
src/tests/lib/libcurses/check_files/mutt_test6.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/mutt_test1.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test1.chk:1.1 src/tests/lib/libcurses/check_files/mutt_test1.chk:1.2
--- src/tests/lib/libcurses/check_files/mutt_test1.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/mutt_test1.chk	Tue May  3 22:01:13 2022
@@ -1 +0,0 @@
-setaf7Xsetab0X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/mutt_test3.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test3.chk:1.1 src/tests/lib/libcurses/check_files/mutt_test3.chk:1.2
--- src/tests/lib/libcurses/check_files/mutt_test3.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/mutt_test3.chk	Tue May  3 22:01:13 2022
@@ -1 +1 @@
-homesetaf7Xsetab0Xboldcup13;1Xcup23;1Xsgr0op
\ No newline at end of file
+homeboldcup13;1Xcup23;1Xsgr0op
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/mutt_test8.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test8.chk:1.1 src/tests/lib/libcurses/check_files/mutt_test8.chk:1.2
--- src/tests/lib/libcurses/check_files/mutt_test8.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/mutt_test8.chk	Tue May  3 22:01:13 2022
@@ -1 +1 @@
-smkxopsetaf7Xsetab0Xcup13;73Xcup14;1Xboldcup15;1Xsgr0opsetaf7Xsetab0Xcup15;1Xboldcup16;1Xsgr0opsetaf7Xsetab0Xcup16;1Xboldcup16;73Xcup17;1Xsgr0op
\ No newline at end of file
+smkxopcup13;73Xcup14;1Xboldcup15;1Xsgr0opcup15;1Xboldcup16;1Xsgr0opcup16;1Xboldcup16;73Xcup17;1Xsgr0op
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/mutt_test9.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test9.chk:1.1 src/tests/lib/libcurses/check_files/mutt_test9.chk:1.2
--- src/tests/lib/libcurses/check_files/mutt_test9.chk:1.1	Sun May 26 09:54:33 2019
+++ src/tests/lib/libcurses/check_files/mutt_test9.chk	Tue May  3 22:01:13 2022
@@ -1 +1 @@
-cup15;11Xsetaf7Xsetab0XsmsoRRRcup24;1Xrmsoopopcup15;15Xsetaf7Xsetab0XHHHopop
\ No newline at end of file
+cup15;11XsmsoRRRcup24;1Xrmsoopopcup15;15XHHHopop
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/mutt_test4.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test4.chk:1.2 src/tests/lib/libcurses/check_files/mutt_test4.chk:1.3
--- src/tests/lib/libcurses/check_files/mutt_test4.chk:1.2	Sun Jun  9 07:49:42 2019
+++ src/tests/lib/libcurses/check_files/mutt_test4.chk	Tue May  3 22:01:13 2022
@@ -1,2 +1,2 @@
 
-setaf7Xsetab0Xrev123456789sgr0opsetaf7Xsetab0Xiop
\ No newline at end of file
+rev123456789sgr0opiop
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/mutt_test5.chk
diff -u src/tests/lib/libcurses/check_files/mutt_test5.chk:1.2 src/tests/lib/libcurses/check_files/mutt_test5.chk:1.3
--- src/tests/lib/libcurses/check_files/mutt_test5.chk:1.2	Thu Sep 19 11:31:57 2019
+++ src/tests/lib/libcurses/check_files/mutt_test5.chk	Tue May  3 

CVS commit: src/tests/lib/libcurses/check_files

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 07:26:19 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: background4.chk bkgrndset1.chk

Log Message:
Output changed due to bug fixes in curses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/background4.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/bkgrndset1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/background4.chk
diff -u src/tests/lib/libcurses/check_files/background4.chk:1.2 src/tests/lib/libcurses/check_files/background4.chk:1.3
--- src/tests/lib/libcurses/check_files/background4.chk:1.2	Fri Sep 16 08:05:28 2011
+++ src/tests/lib/libcurses/check_files/background4.chk	Tue May  3 07:26:19 2022
@@ -1,5 +1,5 @@
 cup1;14Xcup3;6Xrevwindow
-B1
+ 1
 BB
 BB
 BB

Index: src/tests/lib/libcurses/check_files/bkgrndset1.chk
diff -u src/tests/lib/libcurses/check_files/bkgrndset1.chk:1.1 src/tests/lib/libcurses/check_files/bkgrndset1.chk:1.2
--- src/tests/lib/libcurses/check_files/bkgrndset1.chk:1.1	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/check_files/bkgrndset1.chk	Tue May  3 07:26:19 2022
@@ -1 +1 @@
-thissmsoArmsoissmsoArmsoasmsoArmsotestsmsoAAcup2;1Xcup3;1Xcup4;1Xcup5;1Xcup6;1Xcup7;1Xcup8;1Xcup9;1Xcup10;1Xcup11;1Xcup12;1XA
 AAAcup13;1Xcup14;1Xcup15;1Xcup16;1Xcup17;1Xcup18;1Xcup19;1Xcup20;1Xcup21;1Xcup22;1Xcup23;1XAA
 AAcup24;1XAAArmamAsmamcup1;15Xrmso
\ No newline at end of file
+this is a testsmsoAAcup2;1Xcup3;1Xcup4;1Xcup5;1Xcup6;1Xcup7;1Xcup8;1Xcup9;1Xcup10;1Xcup11;1Xcup12;1XA
 

CVS commit: src/tests/lib/libcurses/check_files

2022-05-03 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue May  3 07:26:19 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: background4.chk bkgrndset1.chk

Log Message:
Output changed due to bug fixes in curses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/background4.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/bkgrndset1.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-04-26 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 26 22:48:36 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: Makefile
Added Files:
src/tests/lib/libcurses/tests: wresize

Log Message:
Add test for wresize.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/tests/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/tests/wresize

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.30 src/tests/lib/libcurses/t_curses.sh:1.31
--- src/tests/lib/libcurses/t_curses.sh:1.30	Thu Apr 21 07:03:44 2022
+++ src/tests/lib/libcurses/t_curses.sh	Tue Apr 26 22:48:36 2022
@@ -1666,6 +1666,16 @@ wredrawln_body()
 h_run wredrawln
 }
 
+atf_test_case wresize
+wresize_head()
+{
+atf_set "descr" "Tests resizing a window with a subwin"
+}
+wresize_body()
+{
+h_run wresize
+}
+
 ##
 # curses soft label key routines
 ##
@@ -2365,6 +2375,7 @@ atf_init_test_cases()
 	atf_add_test_case is_linetouched
 	atf_add_test_case is_wintouched
 	atf_add_test_case redrawwin
+	atf_add_test_case wresize
 	atf_add_test_case wredrawln
 
 	# curses soft label key routines

Index: src/tests/lib/libcurses/tests/Makefile
diff -u src/tests/lib/libcurses/tests/Makefile:1.6 src/tests/lib/libcurses/tests/Makefile:1.7
--- src/tests/lib/libcurses/tests/Makefile:1.6	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/tests/Makefile	Tue Apr 26 22:48:36 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2022/04/20 07:43:05 blymn Exp $
+# $NetBSD: Makefile,v 1.7 2022/04/26 22:48:36 blymn Exp $
 
 NOMAN=		# defined
 
@@ -213,6 +213,7 @@ FILES+=		winsch
 FILES+=		winwstr
 FILES+=		wprintw
 FILES+=		wredrawln
+FILES+=		wresize
 FILES+=		wscrl
 FILES+=		wsetscrreg
 FILES+=		wstandout

Added files:

Index: src/tests/lib/libcurses/tests/wresize
diff -u /dev/null src/tests/lib/libcurses/tests/wresize:1.1
--- /dev/null	Tue Apr 26 22:48:36 2022
+++ src/tests/lib/libcurses/tests/wresize	Tue Apr 26 22:48:36 2022
@@ -0,0 +1,9 @@
+include window
+
+call win2 subwin $win1 5 5 3 6
+check win2 NON_NULL
+#
+call OK wresize $win1 4 4
+#
+call2 4 4 getmaxyx $win1
+call2 3 3 getmaxyx $win2



CVS commit: src/tests/lib/libcurses

2022-04-26 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 26 22:48:36 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: Makefile
Added Files:
src/tests/lib/libcurses/tests: wresize

Log Message:
Add test for wresize.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/tests/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/tests/wresize

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-04-21 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Apr 21 07:03:44 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: bkgrndset

Log Message:
Actually add the bkgrndset test case so it runs plus fix a typo in
the bkgrndset test script.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/bkgrndset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.29 src/tests/lib/libcurses/t_curses.sh:1.30
--- src/tests/lib/libcurses/t_curses.sh:1.29	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/t_curses.sh	Thu Apr 21 07:03:44 2022
@@ -2410,6 +2410,7 @@ atf_init_test_cases()
 	# curses background attribute manipulation routines
 	atf_add_test_case background
 	atf_add_test_case bkgdset
+	atf_add_test_case bkgrndset
 	atf_add_test_case getbkgd
 
 	# curses border drawing routines

Index: src/tests/lib/libcurses/tests/bkgrndset
diff -u src/tests/lib/libcurses/tests/bkgrndset:1.1 src/tests/lib/libcurses/tests/bkgrndset:1.2
--- src/tests/lib/libcurses/tests/bkgrndset:1.1	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/tests/bkgrndset	Thu Apr 21 07:03:44 2022
@@ -7,4 +7,4 @@ call OK refresh
 compare bkgrndset1.chk
 call OK erase
 call OK refresh
-compare bgkrndset2.chk
+compare bkgrndset2.chk



CVS commit: src/tests/lib/libcurses

2022-04-21 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Apr 21 07:03:44 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/tests: bkgrndset

Log Message:
Actually add the bkgrndset test case so it runs plus fix a typo in
the bkgrndset test script.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/bkgrndset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-04-20 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Apr 20 07:43:05 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: Makefile
Added Files:
src/tests/lib/libcurses/check_files: bkgrndset1.chk bkgrndset2.chk
src/tests/lib/libcurses/tests: bkgrndset

Log Message:
Add a test for the bkgrndset function


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/bkgrndset1.chk \
src/tests/lib/libcurses/check_files/bkgrndset2.chk
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/tests/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/tests/bkgrndset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.28 src/tests/lib/libcurses/t_curses.sh:1.29
--- src/tests/lib/libcurses/t_curses.sh:1.28	Mon Apr  4 19:33:46 2022
+++ src/tests/lib/libcurses/t_curses.sh	Wed Apr 20 07:43:05 2022
@@ -2011,6 +2011,16 @@ bkgdset_body()
 	h_run bkgdset
 }
 
+atf_test_case bkgrndset
+bkgrndset_head()
+{
+	atf_set "descr" "Validate curses sets the background character using a complex char on stdscr"
+}
+bkgrndset_body()
+{
+	h_run bkgrndset
+}
+
 atf_test_case getbkgd
 getbkgd_head()
 {

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.9 src/tests/lib/libcurses/check_files/Makefile:1.10
--- src/tests/lib/libcurses/check_files/Makefile:1.9	Tue Nov 16 21:02:06 2021
+++ src/tests/lib/libcurses/check_files/Makefile	Wed Apr 20 07:43:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2021/11/16 21:02:06 blymn Exp $
+# $NetBSD: Makefile,v 1.10 2022/04/20 07:43:05 blymn Exp $
 
 NOMAN=		# defined
 
@@ -34,6 +34,8 @@ FILES+=		background4.chk
 FILES+=		background5.chk
 FILES+=		bell.chk
 FILES+=		bkgdset1.chk
+FILES+=		bkgrndset1.chk
+FILES+=		bkgrndset2.chk
 FILES+=		blank.chk
 FILES+=		border_set1.chk
 FILES+=		border_set2.chk

Index: src/tests/lib/libcurses/tests/Makefile
diff -u src/tests/lib/libcurses/tests/Makefile:1.5 src/tests/lib/libcurses/tests/Makefile:1.6
--- src/tests/lib/libcurses/tests/Makefile:1.5	Sat Feb 13 06:29:45 2021
+++ src/tests/lib/libcurses/tests/Makefile	Wed Apr 20 07:43:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2021/02/13 06:29:45 rillig Exp $
+# $NetBSD: Makefile,v 1.6 2022/04/20 07:43:05 blymn Exp $
 
 NOMAN=		# defined
 
@@ -24,6 +24,7 @@ FILES+=		attributes
 FILES+=		background
 FILES+=		beep
 FILES+=		bkgdset
+FILES+=		bkgrndset
 FILES+=		border_set
 FILES+=		box
 FILES+=		box_set

Added files:

Index: src/tests/lib/libcurses/check_files/bkgrndset1.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/bkgrndset1.chk:1.1
--- /dev/null	Wed Apr 20 07:43:05 2022
+++ src/tests/lib/libcurses/check_files/bkgrndset1.chk	Wed Apr 20 07:43:05 2022
@@ -0,0 +1 @@
+thissmsoArmsoissmsoArmsoasmsoArmsotestsmsoAAcup2;1Xcup3;1Xcup4;1Xcup5;1Xcup6;1Xcup7;1Xcup8;1Xcup9;1Xcup10;1Xcup11;1Xcup12;1XA
 

CVS commit: src/tests/lib/libcurses

2022-04-20 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Apr 20 07:43:05 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: Makefile
Added Files:
src/tests/lib/libcurses/check_files: bkgrndset1.chk bkgrndset2.chk
src/tests/lib/libcurses/tests: bkgrndset

Log Message:
Add a test for the bkgrndset function


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/bkgrndset1.chk \
src/tests/lib/libcurses/check_files/bkgrndset2.chk
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/tests/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/tests/bkgrndset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 07:04:19 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: addstr2.chk addstr3.chk chgat1.chk
chgat2.chk color_blank_draw.chk mvwchgat2.chk slk6.chk wchgat1.chk
wchgat2.chk wchgat3.chk wcolor_set.chk wins_wch3.chk

Log Message:
Update to account for default colour change in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/addstr2.chk \
src/tests/lib/libcurses/check_files/slk6.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/addstr3.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/chgat1.chk \
src/tests/lib/libcurses/check_files/chgat2.chk \
src/tests/lib/libcurses/check_files/color_blank_draw.chk \
src/tests/lib/libcurses/check_files/mvwchgat2.chk \
src/tests/lib/libcurses/check_files/wchgat1.chk \
src/tests/lib/libcurses/check_files/wchgat2.chk \
src/tests/lib/libcurses/check_files/wchgat3.chk \
src/tests/lib/libcurses/check_files/wcolor_set.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/addstr2.chk
diff -u src/tests/lib/libcurses/check_files/addstr2.chk:1.3 src/tests/lib/libcurses/check_files/addstr2.chk:1.4
--- src/tests/lib/libcurses/check_files/addstr2.chk:1.3	Tue Sep  7 01:29:13 2021
+++ src/tests/lib/libcurses/check_files/addstr2.chk	Tue Apr 12 07:04:19 2022
@@ -1 +1 @@
-cup24;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456cup24;1Xclearcsr1;24Xhomecup24;1Xindn4Xcsr1;24Xhomehomecup24;76Xa   rmamhsmamcup24;1X
\ No newline at end of file
+cup24;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456cup24;1Xclearcup24;76Xa   rmamhsmamcup24;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk6.chk
diff -u src/tests/lib/libcurses/check_files/slk6.chk:1.3 src/tests/lib/libcurses/check_files/slk6.chk:1.4
--- src/tests/lib/libcurses/check_files/slk6.chk:1.3	Tue Jun 22 07:29:16 2021
+++ src/tests/lib/libcurses/check_files/slk6.chk	Tue Apr 12 07:04:19 2022
@@ -1 +1 @@
-opsetaf7Xsetab0Xsmulrev onesgr0setaf7Xsetab0X smulrev  two   sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X setaf1Xsetab2Xsmulrevfoursgr0setaf7Xsetab0X  smulrev  five  sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulreveight!!rmam!smamcup24;40Xrmulsgr0op
\ No newline at end of file
+opsetaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xosetaf7Xsetab0Xnsetaf7Xsetab0Xesgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0Xtsetaf7Xsetab0Xwsetaf7Xsetab0Xosetaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf1Xsetab2Xsmulrev setaf1Xsetab2X setaf1Xsetab2X setaf1Xsetab2X setaf1Xsetab2Xfsetaf1Xsetab2Xosetaf1Xsetab2Xusetaf1Xsetab2Xrsgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0Xfsetaf7Xsetab0Xisetaf7Xsetab0Xvsetaf7Xsetab0Xesetaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sg
 r0setaf7Xsetab0X setaf7Xsetab0Xsmulrev setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X setaf7Xsetab0X sgr0setaf7Xsetab0X setaf7Xsetab0Xsmulrevesetaf7Xsetab0Xisetaf7Xsetab0Xgsetaf7Xsetab0Xhsetaf7Xsetab0Xtsetaf7Xsetab0X!setaf7Xsetab0X!rmamsetaf7Xsetab0X!smamcup24;40Xrmulsgr0op
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/addstr3.chk
diff -u src/tests/lib/libcurses/check_files/addstr3.chk:1.2 src/tests/lib/libcurses/check_files/addstr3.chk:1.3
--- src/tests/lib/libcurses/check_files/addstr3.chk:1.2	Tue Jun 22 07:49:58 2021
+++ src/tests/lib/libcurses/check_files/addstr3.chk	Tue Apr 12 07:04:19 2022
@@ -1,4 +1,5 @@
 csr2;24Xhomehome
 rin1Xcsr1;24Xhomehomecup24;1Xhome
-()cup23;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup2;3Xclear
+()cup23;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup2;3Xclearcsr2;23Xhome
+rin1Xcsr1;24Xhomehome
 hellocup23;76Xacup2;6X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/wins_wch3.chk
diff -u src/tests/lib/libcurses/check_files/wins_wch3.chk:1.2 src/tests/lib/libcurses/check_files/wins_wch3.chk:1.3
--- src/tests/lib/libcurses/check_files/wins_wch3.chk:1.2	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/check_files/wins_wch3.chk	

CVS commit: src/tests/lib/libcurses/check_files

2022-04-12 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Apr 12 07:04:19 UTC 2022

Modified Files:
src/tests/lib/libcurses/check_files: addstr2.chk addstr3.chk chgat1.chk
chgat2.chk color_blank_draw.chk mvwchgat2.chk slk6.chk wchgat1.chk
wchgat2.chk wchgat3.chk wcolor_set.chk wins_wch3.chk

Log Message:
Update to account for default colour change in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/addstr2.chk \
src/tests/lib/libcurses/check_files/slk6.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/addstr3.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/chgat1.chk \
src/tests/lib/libcurses/check_files/chgat2.chk \
src/tests/lib/libcurses/check_files/color_blank_draw.chk \
src/tests/lib/libcurses/check_files/mvwchgat2.chk \
src/tests/lib/libcurses/check_files/wchgat1.chk \
src/tests/lib/libcurses/check_files/wchgat2.chk \
src/tests/lib/libcurses/check_files/wchgat3.chk \
src/tests/lib/libcurses/check_files/wcolor_set.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-02-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Mar  1 06:41:27 UTC 2022

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Add the -F flag to the getopt string, it was there in the help and
in the arguments handling but getopt was not told about it.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/debug_test
diff -u src/tests/lib/libcurses/debug_test:1.6 src/tests/lib/libcurses/debug_test:1.7
--- src/tests/lib/libcurses/debug_test:1.6	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/debug_test	Tue Mar  1 06:41:27 2022
@@ -41,7 +41,7 @@ usage() {
 #ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
 ARGS="-T ${BASEDIR} -C ${CHECK_PATH}"
 #
-while getopts cf:L:s:vg opt
+while getopts cf:F:L:s:vg opt
 do
 case "${opt}" in
 	c)



CVS commit: src/tests/lib/libcurses

2022-02-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Mar  1 06:41:27 UTC 2022

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Add the -F flag to the getopt string, it was there in the help and
in the arguments handling but getopt was not told about it.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-01-25 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jan 25 21:28:49 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh

Log Message:
Remove excess shift since locale is no longer passed


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/lib/libcurses/t_curses.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2022-01-25 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jan 25 21:28:49 UTC 2022

Modified Files:
src/tests/lib/libcurses: t_curses.sh

Log Message:
Remove excess shift since locale is no longer passed


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/lib/libcurses/t_curses.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.26 src/tests/lib/libcurses/t_curses.sh:1.27
--- src/tests/lib/libcurses/t_curses.sh:1.26	Tue Jan 25 03:23:05 2022
+++ src/tests/lib/libcurses/t_curses.sh	Tue Jan 25 21:28:49 2022
@@ -9,7 +9,7 @@ h_run()
 	else
 		# export the locale and shift the parameters by two and pass the rest
 		export LC_ALL=$locale
-		shift 2
+		shift
 		r_run $file $@
 	fi
 }



Re: CVS commit: src/tests/lib/libcurses

2022-01-25 Thread Martin Husemann
On Tue, Jan 25, 2022 at 03:23:05AM +, Brett Lymn wrote:
> Module Name:  src
> Committed By: blymn
> Date: Tue Jan 25 03:23:05 UTC 2022
> 
> Modified Files:
>   src/tests/lib/libcurses: debug_test t_curses.sh
>   src/tests/lib/libcurses/check_files: add_wch3.chk get_wstr.chk
>   getn_wstr.chk ins_wch1.chk ins_wch2.chk ins_wch3.chk mvins_wch.chk
>   wget_wstr.chk wgetn_wstr.chk wins_wch1.chk wins_wch2.chk
>   wins_wch3.chk wvline_set.chk
>   src/tests/lib/libcurses/tests: add_wch ins_wch overwrite
> 
> Log Message:
> Update of tests to account for output changes associated with wide char
> fixes.  Also, default all tests to using UTF8 instead of doing a special
> dance for the wide character tests and fix debug_test to force set the
> locale to UTF8 so tests under debug don't throw spurious mismatches
> when a wide character test is run.

This makes them all fail for me:

Tests root: /usr/tests/lib/libcurses

t_curses (1/1): 201 test cases
add_wch: [0.174435s] Failed: Test case exited normally but failed to create 
the results file: Failed to open /tmp/atf-run.dxlAhY/tcr
addbytes: [0.152203s] Failed: Test case exited normally but failed to 
create the results file: Failed to open /tmp/atf-run.dxlAhY/tcr
[..]

Martin


CVS commit: src/tests/lib/libcurses

2022-01-24 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jan 25 03:23:05 UTC 2022

Modified Files:
src/tests/lib/libcurses: debug_test t_curses.sh
src/tests/lib/libcurses/check_files: add_wch3.chk get_wstr.chk
getn_wstr.chk ins_wch1.chk ins_wch2.chk ins_wch3.chk mvins_wch.chk
wget_wstr.chk wgetn_wstr.chk wins_wch1.chk wins_wch2.chk
wins_wch3.chk wvline_set.chk
src/tests/lib/libcurses/tests: add_wch ins_wch overwrite

Log Message:
Update of tests to account for output changes associated with wide char
fixes.  Also, default all tests to using UTF8 instead of doing a special
dance for the wide character tests and fix debug_test to force set the
locale to UTF8 so tests under debug don't throw spurious mismatches
when a wide character test is run.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/debug_test
cvs rdiff -u -r1.25 -r1.26 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/add_wch3.chk \
src/tests/lib/libcurses/check_files/get_wstr.chk \
src/tests/lib/libcurses/check_files/getn_wstr.chk \
src/tests/lib/libcurses/check_files/ins_wch1.chk \
src/tests/lib/libcurses/check_files/ins_wch2.chk \
src/tests/lib/libcurses/check_files/ins_wch3.chk \
src/tests/lib/libcurses/check_files/mvins_wch.chk \
src/tests/lib/libcurses/check_files/wget_wstr.chk \
src/tests/lib/libcurses/check_files/wgetn_wstr.chk \
src/tests/lib/libcurses/check_files/wins_wch1.chk \
src/tests/lib/libcurses/check_files/wins_wch2.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk \
src/tests/lib/libcurses/check_files/wvline_set.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/add_wch
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/ins_wch \
src/tests/lib/libcurses/tests/overwrite

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/debug_test
diff -u src/tests/lib/libcurses/debug_test:1.5 src/tests/lib/libcurses/debug_test:1.6
--- src/tests/lib/libcurses/debug_test:1.5	Fri Jun  4 23:07:39 2021
+++ src/tests/lib/libcurses/debug_test	Tue Jan 25 03:23:05 2022
@@ -9,6 +9,10 @@ export INCLUDE_PATH
 #
 CURSES_TRACE_FILE="/tmp/ctrace"
 SLAVE="${BASEDIR}/slave"
+#
+# Force localisation to UTF-8 to be consistent with atf runs
+#
+export LC_ALL=en_US.UTF-8
 
 usage() {
 	echo "Set up the environment to run the test frame.  Option flags:"

Index: src/tests/lib/libcurses/t_curses.sh
diff -u src/tests/lib/libcurses/t_curses.sh:1.25 src/tests/lib/libcurses/t_curses.sh:1.26
--- src/tests/lib/libcurses/t_curses.sh:1.25	Fri Dec 31 20:22:49 2021
+++ src/tests/lib/libcurses/t_curses.sh	Tue Jan 25 03:23:05 2022
@@ -1,19 +1,16 @@
 h_run()
 {
+	TEST_LOCALE=en_US.UTF-8
+
 	file=$1
-	if [ -z "$2" ]; then
-		export LC_ALL=C
-		r_run $file
+	locale=`locale -a | grep -i ${TEST_LOCALE}`
+	if [ -z "${locale}" ]; then
+		atf_fail "test ${file} failed because locale ${locale} not available"
 	else
-		locale=`locale -a | grep -i $2`
-		if [ -z "${locale}" ]; then
-			atf_fail "test ${file} failed because locale ${locale} not available"
-		else
-			# export the locale and shift the parameters by two and pass the rest
-			export LC_ALL=$locale
-			shift 2
-			r_run $file $@
-		fi
+		# export the locale and shift the parameters by two and pass the rest
+		export LC_ALL=$locale
+		shift 2
+		r_run $file $@
 	fi
 }
 
@@ -234,7 +231,7 @@ addwstr_head()
 }
 addwstr_body()
 {
-h_run addwstr en_US.UTF-8
+h_run addwstr
 }
 
 atf_test_case waddstr
@@ -254,7 +251,7 @@ waddwstr_head()
 }
 waddwstr_body()
 {
-h_run waddwstr en_US.UTF-8
+h_run waddwstr
 }
 
 atf_test_case addnstr
@@ -274,7 +271,7 @@ addnwstr_head()
 }
 addnwstr_body()
 {
-h_run addnwstr en_US.UTF-8
+h_run addnwstr
 }
 
 atf_test_case waddnstr
@@ -294,7 +291,7 @@ waddnwstr_head()
 }
 waddnwstr_body()
 {
-h_run waddnwstr en_US.UTF-8
+h_run waddnwstr
 }
 
 atf_test_case mvwaddnwstr
@@ -304,7 +301,7 @@ mvwaddnwstr_head()
 }
 mvwaddnwstr_body()
 {
-h_run mvwaddnwstr en_US.UTF-8
+h_run mvwaddnwstr
 }
 
 atf_test_case mvaddstr
@@ -324,7 +321,7 @@ mvaddwstr_head()
 }
 mvaddwstr_body()
 {
-h_run mvaddwstr en_US.UTF-8
+h_run mvaddwstr
 }
 
 atf_test_case mvwaddwstr
@@ -334,7 +331,7 @@ mvwaddwstr_head()
 }
 mvwaddwstr_body()
 {
-h_run mvwaddwstr en_US.UTF-8
+h_run mvwaddwstr
 }
 
 atf_test_case mvwaddstr
@@ -344,7 +341,7 @@ mvwaddstr_head()
 }
 mvwaddstr_body()
 {
-h_run mvwaddstr en_US.UTF-8
+h_run mvwaddstr
 }
 
 atf_test_case mvaddnstr
@@ -364,7 +361,7 @@ mvaddnwstr_head()
 }
 mvaddnwstr_body()
 {
-h_run mvaddnwstr en_US.UTF-8
+h_run mvaddnwstr
 }
 
 atf_test_case mvwaddnstr
@@ -384,7 +381,7 @@ add_wch_head()
 }
 add_wch_body()
 {
-	h_run add_wch en_US.UTF-8
+	h_run add_wch
 }
 
 atf_test_case wadd_wch
@@ -394,7 +391,7 @@ 

CVS commit: src/tests/lib/libcurses

2022-01-24 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jan 25 03:23:05 UTC 2022

Modified Files:
src/tests/lib/libcurses: debug_test t_curses.sh
src/tests/lib/libcurses/check_files: add_wch3.chk get_wstr.chk
getn_wstr.chk ins_wch1.chk ins_wch2.chk ins_wch3.chk mvins_wch.chk
wget_wstr.chk wgetn_wstr.chk wins_wch1.chk wins_wch2.chk
wins_wch3.chk wvline_set.chk
src/tests/lib/libcurses/tests: add_wch ins_wch overwrite

Log Message:
Update of tests to account for output changes associated with wide char
fixes.  Also, default all tests to using UTF8 instead of doing a special
dance for the wide character tests and fix debug_test to force set the
locale to UTF8 so tests under debug don't throw spurious mismatches
when a wide character test is run.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/debug_test
cvs rdiff -u -r1.25 -r1.26 src/tests/lib/libcurses/t_curses.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/add_wch3.chk \
src/tests/lib/libcurses/check_files/get_wstr.chk \
src/tests/lib/libcurses/check_files/getn_wstr.chk \
src/tests/lib/libcurses/check_files/ins_wch1.chk \
src/tests/lib/libcurses/check_files/ins_wch2.chk \
src/tests/lib/libcurses/check_files/ins_wch3.chk \
src/tests/lib/libcurses/check_files/mvins_wch.chk \
src/tests/lib/libcurses/check_files/wget_wstr.chk \
src/tests/lib/libcurses/check_files/wgetn_wstr.chk \
src/tests/lib/libcurses/check_files/wins_wch1.chk \
src/tests/lib/libcurses/check_files/wins_wch2.chk \
src/tests/lib/libcurses/check_files/wins_wch3.chk \
src/tests/lib/libcurses/check_files/wvline_set.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/add_wch
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/ins_wch \
src/tests/lib/libcurses/tests/overwrite

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-12-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec  7 06:55:44 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c

Log Message:
tests/libcurses: fix grammar in comment (since yesterday)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libcurses/slave/curses_commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/curses_commands.c
diff -u src/tests/lib/libcurses/slave/curses_commands.c:1.30 src/tests/lib/libcurses/slave/curses_commands.c:1.31
--- src/tests/lib/libcurses/slave/curses_commands.c:1.30	Mon Dec  6 22:45:42 2021
+++ src/tests/lib/libcurses/slave/curses_commands.c	Tue Dec  7 06:55:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_commands.c,v 1.30 2021/12/06 22:45:42 rillig Exp $	*/
+/*	$NetBSD: curses_commands.c,v 1.31 2021/12/07 06:55:44 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -150,8 +150,8 @@ set_scrn(const char *arg, SCREEN **x)
 		return
 
 /*
- * These NULL argument is required by the API, intended for future extensions,
- * but this implementation does not support the extension.
+ * These NULL arguments are required by the API, intended for future
+ * extensions, but this implementation does not support any extensions.
  */
 #define ARG_NULL() \
 	args++



CVS commit: src/tests/lib/libcurses/slave

2021-12-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Dec  7 06:55:44 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c

Log Message:
tests/libcurses: fix grammar in comment (since yesterday)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libcurses/slave/curses_commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-12-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec  6 22:45:42 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: commands.c curses_commands.c
curses_commands.h

Log Message:
tests/libcurses: clean up comments


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libcurses/slave/commands.c
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libcurses/slave/curses_commands.c
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libcurses/slave/curses_commands.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/commands.c
diff -u src/tests/lib/libcurses/slave/commands.c:1.16 src/tests/lib/libcurses/slave/commands.c:1.17
--- src/tests/lib/libcurses/slave/commands.c:1.16	Sat Sep  4 01:34:32 2021
+++ src/tests/lib/libcurses/slave/commands.c	Mon Dec  6 22:45:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: commands.c,v 1.16 2021/09/04 01:34:32 rin Exp $	*/
+/*	$NetBSD: commands.c,v 1.17 2021/12/06 22:45:42 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -108,7 +108,7 @@ write_to_director_type(data_enum_t retur
 }
 
 /*
- * Report an pointer value back to the director
+ * Report a pointer value back to the director
  */
 void
 report_ptr(void *ptr)

Index: src/tests/lib/libcurses/slave/curses_commands.c
diff -u src/tests/lib/libcurses/slave/curses_commands.c:1.29 src/tests/lib/libcurses/slave/curses_commands.c:1.30
--- src/tests/lib/libcurses/slave/curses_commands.c:1.29	Sun Jun 13 21:54:51 2021
+++ src/tests/lib/libcurses/slave/curses_commands.c	Mon Dec  6 22:45:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_commands.c,v 1.29 2021/06/13 21:54:51 rillig Exp $	*/
+/*	$NetBSD: curses_commands.c,v 1.30 2021/12/06 22:45:42 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -150,8 +150,8 @@ set_scrn(const char *arg, SCREEN **x)
 		return
 
 /*
- * Required by the API, intended for future extensions, but this
- * implementation does not support the extension.
+ * These NULL argument is required by the API, intended for future extensions,
+ * but this implementation does not support the extension.
  */
 #define ARG_NULL() \
 	args++

Index: src/tests/lib/libcurses/slave/curses_commands.h
diff -u src/tests/lib/libcurses/slave/curses_commands.h:1.8 src/tests/lib/libcurses/slave/curses_commands.h:1.9
--- src/tests/lib/libcurses/slave/curses_commands.h:1.8	Sun Jun 13 19:17:53 2021
+++ src/tests/lib/libcurses/slave/curses_commands.h	Mon Dec  6 22:45:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_commands.h,v 1.8 2021/06/13 19:17:53 rillig Exp $	*/
+/*	$NetBSD: curses_commands.h,v 1.9 2021/12/06 22:45:42 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -42,7 +42,7 @@ struct command_def {
 
 void cmd_DRAIN(int, char **); /* not a curses function */
 
-/* These functions can be called before initscr*/
+/* These functions can be called before initscr */
 void cmd_filter(int, char **);
 void cmd_ripoffline(int, char **);
 void cmd_use_env(int, char **);
@@ -398,7 +398,7 @@ void cmd_mvwinwstr(int, char **);
 void cmd_winnwstr(int, char **);
 void cmd_winwstr(int, char **);
 
-/* cchar handlgin */
+/* cchar handling */
 void cmd_setcchar(int, char **);
 void cmd_getcchar(int, char **);
 



CVS commit: src/tests/lib/libcurses/slave

2021-12-06 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Dec  6 22:45:42 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: commands.c curses_commands.c
curses_commands.h

Log Message:
tests/libcurses: clean up comments


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libcurses/slave/commands.c
cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libcurses/slave/curses_commands.c
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libcurses/slave/curses_commands.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-11-16 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov 16 21:02:06 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: ins_wstr wins_wstr
Added Files:
src/tests/lib/libcurses/check_files: ins_wstr3.chk ins_wstr4.chk
ins_wstr5.chk wins_wstr3.chk wins_wstr4.chk wins_wstr5.chk

Log Message:
Add more testing for special character handling in ins_wstr family.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/ins_wstr3.chk \
src/tests/lib/libcurses/check_files/ins_wstr4.chk \
src/tests/lib/libcurses/check_files/ins_wstr5.chk \
src/tests/lib/libcurses/check_files/wins_wstr3.chk \
src/tests/lib/libcurses/check_files/wins_wstr4.chk \
src/tests/lib/libcurses/check_files/wins_wstr5.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/ins_wstr \
src/tests/lib/libcurses/tests/wins_wstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.8 src/tests/lib/libcurses/check_files/Makefile:1.9
--- src/tests/lib/libcurses/check_files/Makefile:1.8	Mon Nov 15 06:31:21 2021
+++ src/tests/lib/libcurses/check_files/Makefile	Tue Nov 16 21:02:06 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2021/11/15 06:31:21 blymn Exp $
+# $NetBSD: Makefile,v 1.9 2021/11/16 21:02:06 blymn Exp $
 
 NOMAN=		# defined
 
@@ -122,6 +122,9 @@ FILES+=		ins_wch2.chk
 FILES+=		ins_wch3.chk
 FILES+=		ins_wstr1.chk
 FILES+=		ins_wstr2.chk
+FILES+=		ins_wstr3.chk
+FILES+=		ins_wstr4.chk
+FILES+=		ins_wstr5.chk
 FILES+=		insch.chk
 FILES+=		insch1.chk
 FILES+=		insch2.chk
@@ -264,6 +267,9 @@ FILES+=		wins_nwstr1.chk
 FILES+=		wins_nwstr2.chk
 FILES+=		wins_wstr1.chk
 FILES+=		wins_wstr2.chk
+FILES+=		wins_wstr3.chk
+FILES+=		wins_wstr4.chk
+FILES+=		wins_wstr5.chk
 FILES+=		winsch1.chk
 FILES+=		winsch2.chk
 FILES+=		wprintw_refresh.chk

Index: src/tests/lib/libcurses/tests/ins_wstr
diff -u src/tests/lib/libcurses/tests/ins_wstr:1.1 src/tests/lib/libcurses/tests/ins_wstr:1.2
--- src/tests/lib/libcurses/tests/ins_wstr:1.1	Sat Oct 24 04:46:17 2020
+++ src/tests/lib/libcurses/tests/ins_wstr	Tue Nov 16 21:02:06 2021
@@ -20,9 +20,25 @@ call OK refresh
 call2 10 10 getyx STDSCR
 compare ins_wstr2.chk
 
-# lib/55433: Bug in special character handling of ins_wstr() of libcurses
-# test special character processing [FAILING]
-# wchar NSTR ["A"*3, "\r", "B"*2]
-# call OK move 20 0
-# call OK ins_wstr $NSTR
-# call OK refresh
+# This should result in just BB
+wchar NSTR ["A"*3, "\r", "B"*2]
+call OK move 20 0
+call OK ins_wstr $NSTR
+call OK refresh
+compare ins_wstr3.chk
+
+# Check handling of tabs
+# first try inserting too many, it should fail
+wchar TSTR [ "\t"*20 ]
+call ERR ins_wstr $TSTR
+call OK refresh
+call2 20 0 getyx STDSCR
+compare ins_wstr4.chk
+
+# Now insert a few tabs...
+wchar USTR [ "F", "\t"*3, "F" ]
+call OK ins_wstr $USTR
+call OK refresh
+call2 20 0 getyx STDSCR
+compare ins_wstr5.chk
+
Index: src/tests/lib/libcurses/tests/wins_wstr
diff -u src/tests/lib/libcurses/tests/wins_wstr:1.1 src/tests/lib/libcurses/tests/wins_wstr:1.2
--- src/tests/lib/libcurses/tests/wins_wstr:1.1	Sat Oct 24 04:46:17 2020
+++ src/tests/lib/libcurses/tests/wins_wstr	Tue Nov 16 21:02:06 2021
@@ -16,3 +16,35 @@ call OK wins_wstr $win1 $NSTR
 call OK wrefresh $win1
 call2 4 1 getyx $win1
 compare wins_wstr2.chk
+
+#
+# test the special character handling.
+#
+# handling of a carriage return
+wchar RSTR ["B", "\r", "C" ]
+call OK wmove $win1 5 1
+call OK wins_wstr $win1 $RSTR
+call OK wrefresh $win1
+call2 5 1 getyx $win1
+compare wins_wstr3.chk
+
+# handling of a newline
+wchar JSTR [ "D", "\n", "E" ]
+call OK wmove $win1 5 1
+# this should fail since scrollok is false
+call OK scrollok $win1 $FALSE
+call ERR wins_wstr $win1 $JSTR
+
+# try again after enabling scroll
+call OK scrollok $win1 $TRUE
+call OK wins_wstr $win1 $JSTR
+call OK wrefresh $win1
+call2 5 1 getyx $win1
+compare wins_wstr4.chk
+
+# handling of a backspace
+wchar BSTR [ "F"*3, "\b", "G"*2 ]
+call OK wins_wstr $win1 $BSTR
+call OK wrefresh $win1
+call2 5 1 getyx $win1
+compare wins_wstr5.chk

Added files:

Index: src/tests/lib/libcurses/check_files/ins_wstr3.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/ins_wstr3.chk:1.1
--- /dev/null	Tue Nov 16 21:02:06 2021
+++ src/tests/lib/libcurses/check_files/ins_wstr3.chk	Tue Nov 16 21:02:06 2021
@@ -0,0 +1 @@
+cup21;1XBB
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/ins_wstr5.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/ins_wstr5.chk:1.1
--- /dev/null	Tue Nov 16 21:02:06 2021
+++ src/tests/lib/libcurses/check_files/ins_wstr5.chk	Tue Nov 16 21:02:06 2021
@@ -0,0 +1 @@
+F			F
\ No newline at end 

CVS commit: src/tests/lib/libcurses

2021-11-16 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Nov 16 21:02:06 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
src/tests/lib/libcurses/tests: ins_wstr wins_wstr
Added Files:
src/tests/lib/libcurses/check_files: ins_wstr3.chk ins_wstr4.chk
ins_wstr5.chk wins_wstr3.chk wins_wstr4.chk wins_wstr5.chk

Log Message:
Add more testing for special character handling in ins_wstr family.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/ins_wstr3.chk \
src/tests/lib/libcurses/check_files/ins_wstr4.chk \
src/tests/lib/libcurses/check_files/ins_wstr5.chk \
src/tests/lib/libcurses/check_files/wins_wstr3.chk \
src/tests/lib/libcurses/check_files/wins_wstr4.chk \
src/tests/lib/libcurses/check_files/wins_wstr5.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/ins_wstr \
src/tests/lib/libcurses/tests/wins_wstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/director

2021-11-15 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov 15 21:45:47 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_conf.l

Log Message:
Add handling for backspace special character (\b)


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tests/lib/libcurses/director/testlang_conf.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_conf.l
diff -u src/tests/lib/libcurses/director/testlang_conf.l:1.25 src/tests/lib/libcurses/director/testlang_conf.l:1.26
--- src/tests/lib/libcurses/director/testlang_conf.l:1.25	Thu Feb 25 00:50:10 2021
+++ src/tests/lib/libcurses/director/testlang_conf.l	Mon Nov 15 21:45:46 2021
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_conf.l,v 1.25 2021/02/25 00:50:10 rillig Exp $ 	*/
+/*	$NetBSD: testlang_conf.l,v 1.26 2021/11/15 21:45:46 blymn Exp $ 	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -92,6 +92,12 @@ dequote(const char *s, size_t *len)
 			}
 
 			switch (*p) {
+			case 'b':
+/* backspace */
+*q++ = '\b';
+p++;
+break;
+
 			case 'e':
 /* escape */
 *q++ = '\e';



CVS commit: src/tests/lib/libcurses/director

2021-11-15 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov 15 21:45:47 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_conf.l

Log Message:
Add handling for backspace special character (\b)


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tests/lib/libcurses/director/testlang_conf.l

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-11-14 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov 15 06:31:22 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile ins_nwstr1.chk
src/tests/lib/libcurses/tests: mvwins_nwstr mvwins_wstr wins_nwstr
Added Files:
src/tests/lib/libcurses/check_files: mvwins_nwstr1.chk
mvwins_nwstr2.chk mvwins_wstr1.chk mvwins_wstr2.chk wins_nwstr1.chk
wins_nwstr2.chk

Log Message:
Update the ins_(n)wstr test family to split out the check files
for each call separately and update check files to reflect changed
behaviour due to a fix to related calls.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/ins_nwstr1.chk
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/mvwins_nwstr1.chk \
src/tests/lib/libcurses/check_files/mvwins_nwstr2.chk \
src/tests/lib/libcurses/check_files/mvwins_wstr1.chk \
src/tests/lib/libcurses/check_files/mvwins_wstr2.chk \
src/tests/lib/libcurses/check_files/wins_nwstr1.chk \
src/tests/lib/libcurses/check_files/wins_nwstr2.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/mvwins_nwstr \
src/tests/lib/libcurses/tests/mvwins_wstr \
src/tests/lib/libcurses/tests/wins_nwstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.7 src/tests/lib/libcurses/check_files/Makefile:1.8
--- src/tests/lib/libcurses/check_files/Makefile:1.7	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/check_files/Makefile	Mon Nov 15 06:31:21 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2021/06/06 04:57:58 blymn Exp $
+# $NetBSD: Makefile,v 1.8 2021/11/15 06:31:21 blymn Exp $
 
 NOMAN=		# defined
 
@@ -188,7 +188,11 @@ FILES+=		mvwaddwstr2.chk
 FILES+=		mvwaddwstr3.chk
 FILES+=		mvwchgat1.chk
 FILES+=		mvwchgat2.chk
+FILES+=		mvwins_nwstr1.chk
+FILES+=		mvwins_nwstr2.chk
 FILES+=		mvwins_wch.chk
+FILES+=		mvwins_wstr1.chk
+FILES+=		mvwins_wstr2.chk
 FILES+=		notimeout.chk
 FILES+=		overlay1.chk
 FILES+=		overlay2.chk
@@ -256,6 +260,8 @@ FILES+=		window_hierarchy.chk
 FILES+=		wins_wch1.chk
 FILES+=		wins_wch2.chk
 FILES+=		wins_wch3.chk
+FILES+=		wins_nwstr1.chk
+FILES+=		wins_nwstr2.chk
 FILES+=		wins_wstr1.chk
 FILES+=		wins_wstr2.chk
 FILES+=		winsch1.chk

Index: src/tests/lib/libcurses/check_files/ins_nwstr1.chk
diff -u src/tests/lib/libcurses/check_files/ins_nwstr1.chk:1.1 src/tests/lib/libcurses/check_files/ins_nwstr1.chk:1.2
--- src/tests/lib/libcurses/check_files/ins_nwstr1.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/ins_nwstr1.chk	Mon Nov 15 06:31:22 2021
@@ -1 +1 @@
-cup5;5XAAA㐁
\ No newline at end of file
+cup5;5XAAA
\ No newline at end of file

Index: src/tests/lib/libcurses/tests/mvwins_nwstr
diff -u src/tests/lib/libcurses/tests/mvwins_nwstr:1.1 src/tests/lib/libcurses/tests/mvwins_nwstr:1.2
--- src/tests/lib/libcurses/tests/mvwins_nwstr:1.1	Sat Oct 24 04:46:17 2020
+++ src/tests/lib/libcurses/tests/mvwins_nwstr	Mon Nov 15 06:31:22 2021
@@ -3,7 +3,7 @@ wchar WSTR ["A", 0x3401, "A"*3]
 call OK mvwins_nwstr $win1 2 1 $WSTR 3
 call OK wrefresh $win1
 call2 2 1 getyx $win1
-compare wins_wstr1.chk
+compare mvwins_nwstr1.chk
 
 call OK mvwaddstr $win1 4 4 "BB"
 call OK wrefresh $win1
@@ -13,4 +13,4 @@ wchar NSTR ["A"*2]
 call OK mvwins_nwstr $win1 4 1 $NSTR -1
 call OK wrefresh $win1
 call2 4 1 getyx $win1
-compare wins_wstr2.chk
+compare mvwins_nwstr2.chk
Index: src/tests/lib/libcurses/tests/mvwins_wstr
diff -u src/tests/lib/libcurses/tests/mvwins_wstr:1.1 src/tests/lib/libcurses/tests/mvwins_wstr:1.2
--- src/tests/lib/libcurses/tests/mvwins_wstr:1.1	Sat Oct 24 04:46:17 2020
+++ src/tests/lib/libcurses/tests/mvwins_wstr	Mon Nov 15 06:31:22 2021
@@ -3,7 +3,7 @@ wchar WSTR ["A", 0x3401, "A"]
 call OK mvwins_wstr $win1 2 1 $WSTR
 call OK wrefresh $win1
 call2 2 1 getyx $win1
-compare wins_wstr1.chk
+compare mvwins_wstr1.chk
 
 call OK mvwaddstr $win1 4 4 "BB"
 call OK wrefresh $win1
@@ -13,4 +13,4 @@ wchar NSTR ["A"*2]
 call OK mvwins_wstr $win1 4 1 $NSTR
 call OK wrefresh $win1
 call2 4 1 getyx $win1
-compare wins_wstr2.chk
+compare mvwins_wstr2.chk
Index: src/tests/lib/libcurses/tests/wins_nwstr
diff -u src/tests/lib/libcurses/tests/wins_nwstr:1.1 src/tests/lib/libcurses/tests/wins_nwstr:1.2
--- src/tests/lib/libcurses/tests/wins_nwstr:1.1	Sat Oct 24 04:46:17 2020
+++ src/tests/lib/libcurses/tests/wins_nwstr	Mon Nov 15 06:31:22 2021
@@ -4,7 +4,7 @@ call OK wmove $win1 2 1
 call OK wins_nwstr $win1 $WSTR 3
 call OK wrefresh $win1
 call2 2 1 getyx $win1
-compare wins_wstr1.chk
+compare wins_nwstr1.chk
 
 call OK mvwaddstr $win1 4 4 "BB"
 call OK wrefresh $win1
@@ -15,4 +15,4 @@ call OK wmove $win1 4 1
 call OK wins_nwstr $win1 $NSTR -1
 call OK wrefresh $win1
 

CVS commit: src/tests/lib/libcurses

2021-11-14 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Mon Nov 15 06:31:22 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile ins_nwstr1.chk
src/tests/lib/libcurses/tests: mvwins_nwstr mvwins_wstr wins_nwstr
Added Files:
src/tests/lib/libcurses/check_files: mvwins_nwstr1.chk
mvwins_nwstr2.chk mvwins_wstr1.chk mvwins_wstr2.chk wins_nwstr1.chk
wins_nwstr2.chk

Log Message:
Update the ins_(n)wstr test family to split out the check files
for each call separately and update check files to reflect changed
behaviour due to a fix to related calls.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/ins_nwstr1.chk
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/mvwins_nwstr1.chk \
src/tests/lib/libcurses/check_files/mvwins_nwstr2.chk \
src/tests/lib/libcurses/check_files/mvwins_wstr1.chk \
src/tests/lib/libcurses/check_files/mvwins_wstr2.chk \
src/tests/lib/libcurses/check_files/wins_nwstr1.chk \
src/tests/lib/libcurses/check_files/wins_nwstr2.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/mvwins_nwstr \
src/tests/lib/libcurses/tests/mvwins_wstr \
src/tests/lib/libcurses/tests/wins_nwstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2021-09-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Sep  7 01:29:13 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: addstr2.chk

Log Message:
PR lib/56388

Regen addstr2.chk after fix for the line-hash bug in libcurses.

Now, all t_curses tests successfully pass on all platforms I have tried.

Thanks blymn@ for kind advice!


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/addstr2.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/addstr2.chk
diff -u src/tests/lib/libcurses/check_files/addstr2.chk:1.2 src/tests/lib/libcurses/check_files/addstr2.chk:1.3
--- src/tests/lib/libcurses/check_files/addstr2.chk:1.2	Tue Jun 22 07:49:58 2021
+++ src/tests/lib/libcurses/check_files/addstr2.chk	Tue Sep  7 01:29:13 2021
@@ -1 +1 @@
-cup24;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456cup24;1Xclearcup24;76Xa   rmamhsmamcup24;1X
\ No newline at end of file
+cup24;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456cup24;1Xclearcsr1;24Xhomecup24;1Xindn4Xcsr1;24Xhomehomecup24;76Xa   rmamhsmamcup24;1X
\ No newline at end of file



CVS commit: src/tests/lib/libcurses/check_files

2021-09-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Sep  7 01:29:13 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: addstr2.chk

Log Message:
PR lib/56388

Regen addstr2.chk after fix for the line-hash bug in libcurses.

Now, all t_curses tests successfully pass on all platforms I have tried.

Thanks blymn@ for kind advice!


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/addstr2.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-09-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep  4 01:34:32 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: commands.c

Log Message:
Cosmetic fixes. No functional changes intended.
- Reorganize logic to reduce indent levels significantly.
- Use ``for'' rather than ``while''.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libcurses/slave/commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/commands.c
diff -u src/tests/lib/libcurses/slave/commands.c:1.15 src/tests/lib/libcurses/slave/commands.c:1.16
--- src/tests/lib/libcurses/slave/commands.c:1.15	Sun Jun 13 12:46:01 2021
+++ src/tests/lib/libcurses/slave/commands.c	Sat Sep  4 01:34:32 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: commands.c,v 1.15 2021/06/13 12:46:01 rillig Exp $	*/
+/*	$NetBSD: commands.c,v 1.16 2021/09/04 01:34:32 rin Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -53,32 +53,32 @@ command_execute(char *func, int nargs, c
 {
 	size_t i, j;
 
-	i = 0;
-	while (i < ncmds) {
-		if (strcmp(func, commands[i].name) == 0) {
-			/* Check only restricted set of functions is called before
-			 * initscr/newterm */
-			if (!initdone) {
-j = 0;
-while (j < nrcmds) {
-	if (strcmp(func, restricted_commands[j]) == 0) {
-		if (strcmp(func, "initscr") == 0  ||
-			strcmp(func, "newterm") == 0)
-			initdone = 1;
-		/* matched function */
-		commands[i].func(nargs, args);
-		return;
-	}
-	j++;
-}
-report_status("YOU NEED TO CALL INITSCR/NEWTERM FIRST");
-return;
-			}
+	for (i = 0; i < ncmds; i++) {
+		if (strcmp(func, commands[i].name) != 0)
+			continue;
+
+		/* Check only restricted set of functions is called before
+		 * initscr/newterm */
+		if (initdone) {
 			/* matched function */
 			commands[i].func(nargs, args);
 			return;
 		}
-		i++;
+
+		for (j = 0; j < nrcmds; j++) {
+			if (strcmp(func, restricted_commands[j]) != 0)
+continue;
+
+			if (strcmp(func, "initscr") == 0  ||
+			strcmp(func, "newterm") == 0)
+initdone = 1;
+
+			/* matched function */
+			commands[i].func(nargs, args);
+			return;
+		}
+		report_status("YOU NEED TO CALL INITSCR/NEWTERM FIRST");
+		return;
 	}
 
 	report_status("UNKNOWN_FUNCTION");



CVS commit: src/tests/lib/libcurses/slave

2021-09-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Sep  4 01:34:32 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: commands.c

Log Message:
Cosmetic fixes. No functional changes intended.
- Reorganize logic to reduce indent levels significantly.
- Use ``for'' rather than ``while''.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libcurses/slave/commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-06-22 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jun 22 07:49:59 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: addstr2.chk addstr3.chk
copywin6.chk copywin7.chk dupwin1.chk dupwin2.chk
src/tests/lib/libcurses/tests: addstr

Log Message:
Update the check files to account for fixes to addstr.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/addstr2.chk \
src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/copywin6.chk \
src/tests/lib/libcurses/check_files/copywin7.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/dupwin1.chk \
src/tests/lib/libcurses/check_files/dupwin2.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/tests/addstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/addstr2.chk
diff -u src/tests/lib/libcurses/check_files/addstr2.chk:1.1 src/tests/lib/libcurses/check_files/addstr2.chk:1.2
--- src/tests/lib/libcurses/check_files/addstr2.chk:1.1	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/check_files/addstr2.chk	Tue Jun 22 07:49:58 2021
@@ -1 +1 @@
-cup24;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456clearcup24;76Xa   
\ No newline at end of file
+cup24;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456cup24;1Xclearcup24;76Xa   rmamhsmamcup24;1X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/addstr3.chk
diff -u src/tests/lib/libcurses/check_files/addstr3.chk:1.1 src/tests/lib/libcurses/check_files/addstr3.chk:1.2
--- src/tests/lib/libcurses/check_files/addstr3.chk:1.1	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/check_files/addstr3.chk	Tue Jun 22 07:49:58 2021
@@ -1,2 +1,4 @@
-cup22;76Xa   0cup23;1X123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(cup24;1X)cup24;76Xel)clearcup23;76Xa
-hello
\ No newline at end of file
+csr2;24Xhomehome
+rin1Xcsr1;24Xhomehomecup24;1Xhome
+()cup23;1X0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*cup2;3Xclear
+hellocup23;76Xacup2;6X
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/copywin6.chk
diff -u src/tests/lib/libcurses/check_files/copywin6.chk:1.3 src/tests/lib/libcurses/check_files/copywin6.chk:1.4
--- src/tests/lib/libcurses/check_files/copywin6.chk:1.3	Sun May 26 07:28:15 2019
+++ src/tests/lib/libcurses/check_files/copywin6.chk	Tue Jun 22 07:49:58 2021
@@ -1,4 +1,4 @@
 cup3;6Xstingt
  ingtes
  gtesti
- estingcup8;6X
\ No newline at end of file
+ estingcup4;6X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/copywin7.chk
diff -u src/tests/lib/libcurses/check_files/copywin7.chk:1.3 src/tests/lib/libcurses/check_files/copywin7.chk:1.4
--- src/tests/lib/libcurses/check_files/copywin7.chk:1.3	Sun May 26 07:28:15 2019
+++ src/tests/lib/libcurses/check_files/copywin7.chk	Tue Jun 22 07:49:58 2021
@@ -1,4 +1,4 @@
-el
+el
  el
  el
  elcup11;15Xelcup12;15Xelcup13;15Xelcup14;15Xelcup15;15Xelcup17;15Xel
\ No newline at end of file

Index: src/tests/lib/libcurses/check_files/dupwin1.chk
diff -u src/tests/lib/libcurses/check_files/dupwin1.chk:1.2 src/tests/lib/libcurses/check_files/dupwin1.chk:1.3
--- src/tests/lib/libcurses/check_files/dupwin1.chk:1.2	Tue Jun 11 08:09:36 2019
+++ src/tests/lib/libcurses/check_files/dupwin1.chk	Tue Jun 22 07:49:58 2021
@@ -3,4 +3,4 @@
  33
  44
  55
- 66 cup9;13X11cup10;13X22cup11;13X33cup12;13X44cup13;13X55cup14;13X66cup14;13X
\ No newline at end of file
+ 66 cup9;13X11cup10;13X22cup11;13X33cup12;13X44cup13;13X55cup14;13X66 
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/dupwin2.chk
diff -u src/tests/lib/libcurses/check_files/dupwin2.chk:1.2 src/tests/lib/libcurses/check_files/dupwin2.chk:1.3
--- src/tests/lib/libcurses/check_files/dupwin2.chk:1.2	Tue Jun 11 08:09:36 2019
+++ src/tests/lib/libcurses/check_files/dupwin2.chk	Tue Jun 22 07:49:58 2021
@@ -1 +1 @@
-cup8;6Xcup9;13Xaacup10;13Xbbcup11;13Xcccup12;13Xddcup13;13Xeecup14;13Xffcup14;13X
\ No newline at end of file
+cup9;13Xaacup10;13Xbbcup11;13Xcccup12;13Xddcup13;13Xeecup14;13Xffcup14;13X
\ No newline at end of file

Index: src/tests/lib/libcurses/tests/addstr
diff -u src/tests/lib/libcurses/tests/addstr:1.3 src/tests/lib/libcurses/tests/addstr:1.4
--- src/tests/lib/libcurses/tests/addstr:1.3	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/tests/addstr	Tue Jun 22 07:49:58 2021
@@ -9,12 +9,12 @@ compare addstr.chk
 # Checks for PR#56224
 #
 call OK move 23 0
-# the addstr should be truncated since no scrolling
-call OK addstr 

CVS commit: src/tests/lib/libcurses

2021-06-22 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jun 22 07:49:59 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: addstr2.chk addstr3.chk
copywin6.chk copywin7.chk dupwin1.chk dupwin2.chk
src/tests/lib/libcurses/tests: addstr

Log Message:
Update the check files to account for fixes to addstr.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/addstr2.chk \
src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/copywin6.chk \
src/tests/lib/libcurses/check_files/copywin7.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/dupwin1.chk \
src/tests/lib/libcurses/check_files/dupwin2.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/tests/addstr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-06-22 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jun 22 07:29:16 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: slk1.chk slk3.chk slk5.chk
slk6.chk slk_init.chk
src/tests/lib/libcurses/tests: slk

Log Message:
Fix slk test and check files due to libcurses slk changes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/slk1.chk \
src/tests/lib/libcurses/check_files/slk3.chk \
src/tests/lib/libcurses/check_files/slk5.chk \
src/tests/lib/libcurses/check_files/slk6.chk \
src/tests/lib/libcurses/check_files/slk_init.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/slk1.chk
diff -u src/tests/lib/libcurses/check_files/slk1.chk:1.2 src/tests/lib/libcurses/check_files/slk1.chk:1.3
--- src/tests/lib/libcurses/check_files/slk1.chk:1.2	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/check_files/slk1.chk	Tue Jun 22 07:29:16 2021
@@ -1 +1 @@
-cup24;1Xrevone sgr0smsosmulrev  one   rmsormulsgr0smsorev onermsosgr0cup24;42Xsmulrev  five  cup24;73Xeight!!cup24;50Xrmulsgr0
\ No newline at end of file
+cup24;1Xrevone sgr0smsosmulrev  one   rmsormulsgr0smsorev onermsosgr0cup24;42Xsmulrev  five  cup24;73Xeight!!rmam!smamcup24;50Xrmulsgr0
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk3.chk
diff -u src/tests/lib/libcurses/check_files/slk3.chk:1.2 src/tests/lib/libcurses/check_files/slk3.chk:1.3
--- src/tests/lib/libcurses/check_files/slk3.chk:1.2	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/check_files/slk3.chk	Tue Jun 22 07:29:16 2021
@@ -1 +1 @@
-smulrev one  five  eight!!rmulsgr0
\ No newline at end of file
+smulrev one  five  eight!!rmam!smamrmulsgr0
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk5.chk
diff -u src/tests/lib/libcurses/check_files/slk5.chk:1.2 src/tests/lib/libcurses/check_files/slk5.chk:1.3
--- src/tests/lib/libcurses/check_files/slk5.chk:1.2	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/check_files/slk5.chk	Tue Jun 22 07:29:16 2021
@@ -1 +1 @@
-cup24;1Xsmulrev onesgr0 smulrev  two   sgr0 smulrevsgr0 smulrevsgr0  smulrev  five  sgr0 smulrevsgr0 smulrevsgr0 smulreveight!!rmulsgr0elcup24;18X
\ No newline at end of file
+cup24;1Xsmulrev onesgr0 smulrev  two   sgr0 smulrevsgr0 smulrevsgr0  smulrev  five  sgr0 smulrevsgr0 smulrevsgr0 smulreveight!!rmam!smamcup24;18Xrmulsgr0
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk6.chk
diff -u src/tests/lib/libcurses/check_files/slk6.chk:1.2 src/tests/lib/libcurses/check_files/slk6.chk:1.3
--- src/tests/lib/libcurses/check_files/slk6.chk:1.2	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/check_files/slk6.chk	Tue Jun 22 07:29:16 2021
@@ -1 +1 @@
-opsetaf7Xsetab0Xsmulrev onesgr0setaf7Xsetab0X smulrev  two   sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X setaf1Xsetab2Xsmulrevfoursgr0setaf7Xsetab0X  smulrev  five  sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulreveight!!rmulsgr0opsetaf7Xsetab0Xelcup24;40Xop
\ No newline at end of file
+opsetaf7Xsetab0Xsmulrev onesgr0setaf7Xsetab0X smulrev  two   sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X setaf1Xsetab2Xsmulrevfoursgr0setaf7Xsetab0X  smulrev  five  sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulreveight!!rmam!smamcup24;40Xrmulsgr0op
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk_init.chk
diff -u src/tests/lib/libcurses/check_files/slk_init.chk:1.2 src/tests/lib/libcurses/check_files/slk_init.chk:1.3
--- src/tests/lib/libcurses/check_files/slk_init.chk:1.2	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/check_files/slk_init.chk	Tue Jun 22 07:29:16 2021
@@ -1 +1 @@
-enacsenacssmcupcnormclearcup24;1Xrevsgr0 revsgr0 revsgr0 revsgr0  revsgr0 revsgr0 revsgr0 rev   sgr0elcup1;1X
\ No newline at end of file
+enacsenacssmcupcnormclearcup24;1Xrevsgr0 revsgr0 revsgr0 revsgr0  revsgr0 revsgr0 revsgr0 rev   rmam smamcup1;1Xsgr0
\ No newline at end of file

Index: src/tests/lib/libcurses/tests/slk
diff -u src/tests/lib/libcurses/tests/slk:1.3 src/tests/lib/libcurses/tests/slk:1.4
--- src/tests/lib/libcurses/tests/slk:1.3	Tue Jun 15 22:21:09 2021
+++ src/tests/lib/libcurses/tests/slk	Tue Jun 22 07:29:16 2021
@@ -54,8 +54,7 @@ call OK slk_refresh
 compare slk6.chk
 
 # test slk_wset
-# returning ERR now - blymn 20210606
 

CVS commit: src/tests/lib/libcurses

2021-06-22 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jun 22 07:29:16 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: slk1.chk slk3.chk slk5.chk
slk6.chk slk_init.chk
src/tests/lib/libcurses/tests: slk

Log Message:
Fix slk test and check files due to libcurses slk changes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/check_files/slk1.chk \
src/tests/lib/libcurses/check_files/slk3.chk \
src/tests/lib/libcurses/check_files/slk5.chk \
src/tests/lib/libcurses/check_files/slk6.chk \
src/tests/lib/libcurses/check_files/slk_init.chk
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/tests

2021-06-15 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jun 15 22:21:09 UTC 2021

Modified Files:
src/tests/lib/libcurses/tests: slk

Log Message:
Restore the slk_wset test after fixing a but in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/tests/slk
diff -u src/tests/lib/libcurses/tests/slk:1.2 src/tests/lib/libcurses/tests/slk:1.3
--- src/tests/lib/libcurses/tests/slk:1.2	Sun Jun  6 04:57:58 2021
+++ src/tests/lib/libcurses/tests/slk	Tue Jun 15 22:21:09 2021
@@ -56,6 +56,6 @@ compare slk6.chk
 # test slk_wset
 # returning ERR now - blymn 20210606
 # [buggy??] 'b' should be printed as (wcswidth(wstr) == 6) <= 8 
-#wchar WSTR [0x3401, "a", 0x3401, "b"]
-#call OK slk_wset 3 $WSTR 1
-#call OK slk_refresh
+wchar WSTR [0x3401, "a", 0x3401, "b"]
+call OK slk_wset 3 $WSTR 1
+call OK slk_refresh



CVS commit: src/tests/lib/libcurses/tests

2021-06-15 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Tue Jun 15 22:21:09 UTC 2021

Modified Files:
src/tests/lib/libcurses/tests: slk

Log Message:
Restore the slk_wset test after fixing a but in libcurses.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 21:54:52 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c

Log Message:
tests/libcurses: fix argument handling for mvwget_wch

There's currently no test for that function, therefore no functional
change.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libcurses/slave/curses_commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 21:54:52 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c

Log Message:
tests/libcurses: fix argument handling for mvwget_wch

There's currently no test for that function, therefore no functional
change.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libcurses/slave/curses_commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/curses_commands.c
diff -u src/tests/lib/libcurses/slave/curses_commands.c:1.28 src/tests/lib/libcurses/slave/curses_commands.c:1.29
--- src/tests/lib/libcurses/slave/curses_commands.c:1.28	Sun Jun 13 19:17:53 2021
+++ src/tests/lib/libcurses/slave/curses_commands.c	Sun Jun 13 21:54:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_commands.c,v 1.28 2021/06/13 19:17:53 rillig Exp $	*/
+/*	$NetBSD: curses_commands.c,v 1.29 2021/06/13 21:54:51 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -4084,7 +4084,7 @@ cmd_mvwget_wch(int nargs, char **args)
 {
 	wchar_t ch;
 
-	ARGC(1);	/* FIXME: 3 */
+	ARGC(3);
 	ARG_WINDOW(win);
 	ARG_INT(y);
 	ARG_INT(x);



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:50:18 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: lint.lua

Log Message:
tests/libcurses: make error handling in the linter simpler


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/slave/lint.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:50:18 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: lint.lua

Log Message:
tests/libcurses: make error handling in the linter simpler


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/slave/lint.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/lint.lua
diff -u src/tests/lib/libcurses/slave/lint.lua:1.5 src/tests/lib/libcurses/slave/lint.lua:1.6
--- src/tests/lib/libcurses/slave/lint.lua:1.5	Sun Jun 13 19:41:12 2021
+++ src/tests/lib/libcurses/slave/lint.lua	Sun Jun 13 19:50:18 2021
@@ -1,5 +1,5 @@
 #! /usr/bin/lua
--- $NetBSD: lint.lua,v 1.5 2021/06/13 19:41:12 rillig Exp $
+-- $NetBSD: lint.lua,v 1.6 2021/06/13 19:50:18 rillig Exp $
 
 --[[
 
@@ -24,18 +24,10 @@ local function load_lines(fname)
   return lines
 end
 
-
-local function new_errors()
-  local errors = {}
-  errors.add = function(self, fmt, ...)
-table.insert(self, string.format(fmt, ...))
-  end
-  errors.print = function(self)
-for _, msg in ipairs(self) do
-  print(msg)
-end
-  end
-  return errors
+local had_errors = false
+local function print_error(fmt, ...)
+  print(fmt:format(...))
+  had_errors = true
 end
 
 
@@ -46,7 +38,7 @@ end
 
 
 -- After each macro ARGC, there must be the corresponding macros for ARG.
-local function check_args(errors)
+local function check_args()
   local fname = "curses_commands.c"
   local lines = load_lines(fname)
   local curr_argc, curr_arg ---@type number|nil, number|nil
@@ -66,9 +58,9 @@ local function check_args(errors)
 curr_argc, curr_arg = nil, nil
   end
 elseif line_arg then
-  errors:add("%s:%d: ARG without preceding ARGC", fname, lineno)
+  print_error("%s:%d: ARG without preceding ARGC", fname, lineno)
 elseif curr_arg then
-  errors:add("%s:%d: expecting ARG %d, got %s",
+  print_error("%s:%d: expecting ARG %d, got %s",
 fname, lineno, curr_arg, line)
   curr_argc, curr_arg = nil, nil
 end
@@ -77,13 +69,5 @@ local function check_args(errors)
   end
 end
 
-
-local function main(arg)
-  local errors = new_errors()
-  check_args(errors)
-  errors:print()
-  return #errors == 0
-end
-
-
-os.exit(main(arg))
+check_args()
+os.exit(not had_errors)



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:41:12 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: lint.lua

Log Message:
tests/libcurses: improve code locality in linter

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/slave/lint.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:41:12 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: lint.lua

Log Message:
tests/libcurses: improve code locality in linter

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/slave/lint.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/lint.lua
diff -u src/tests/lib/libcurses/slave/lint.lua:1.4 src/tests/lib/libcurses/slave/lint.lua:1.5
--- src/tests/lib/libcurses/slave/lint.lua:1.4	Sun Jun 13 19:25:08 2021
+++ src/tests/lib/libcurses/slave/lint.lua	Sun Jun 13 19:41:12 2021
@@ -1,5 +1,5 @@
 #! /usr/bin/lua
--- $NetBSD: lint.lua,v 1.4 2021/06/13 19:25:08 rillig Exp $
+-- $NetBSD: lint.lua,v 1.5 2021/06/13 19:41:12 rillig Exp $
 
 --[[
 
@@ -53,29 +53,27 @@ local function check_args(errors)
 
   for lineno, line in ipairs(lines) do
 
-local line_argc = num(line:match("^\tARGC%((%d)"))
-local line_arg = line:match("^\tARG_[%w_]+%(")
-
+local line_argc = num(line:match("^\tARGC%((%d+)"))
 if line_argc and line_argc > 0 then
   curr_argc, curr_arg = line_argc, 0
+  goto next
 end
 
-if line_arg and not curr_arg then
-  errors:add("%s:%d: ARG without preceding ARGC", fname, lineno)
-end
-
-if not line_arg and curr_arg and not line_argc then
-  errors:add("%s:%d: expecting ARG %d, got %s",
-fname, lineno, curr_arg, line)
-  curr_argc, curr_arg = nil, nil
-end
-
+local line_arg = line:match("^\tARG_[%w_]+%(")
 if line_arg and curr_arg then
   curr_arg = curr_arg + 1
   if curr_arg == curr_argc then
 curr_argc, curr_arg = nil, nil
   end
+elseif line_arg then
+  errors:add("%s:%d: ARG without preceding ARGC", fname, lineno)
+elseif curr_arg then
+  errors:add("%s:%d: expecting ARG %d, got %s",
+fname, lineno, curr_arg, line)
+  curr_argc, curr_arg = nil, nil
 end
+
+::next::
   end
 end
 



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:25:08 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: lint.lua

Log Message:
tests/libcurses: improve local variable names in linter


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/slave/lint.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/lint.lua
diff -u src/tests/lib/libcurses/slave/lint.lua:1.3 src/tests/lib/libcurses/slave/lint.lua:1.4
--- src/tests/lib/libcurses/slave/lint.lua:1.3	Sun Jun 13 18:11:44 2021
+++ src/tests/lib/libcurses/slave/lint.lua	Sun Jun 13 19:25:08 2021
@@ -1,11 +1,11 @@
 #! /usr/bin/lua
--- $NetBSD: lint.lua,v 1.3 2021/06/13 18:11:44 rillig Exp $
+-- $NetBSD: lint.lua,v 1.4 2021/06/13 19:25:08 rillig Exp $
 
 --[[
 
 usage: lua ./lint.lua
 
-Check that the boilerplate code does not contain unintended
+Check that the argument handling code does not contain unintended
 inconsistencies.
 
 ]]
@@ -49,29 +49,31 @@ end
 local function check_args(errors)
   local fname = "curses_commands.c"
   local lines = load_lines(fname)
-  local argi, argc
+  local curr_argc, curr_arg ---@type number|nil, number|nil
 
   for lineno, line in ipairs(lines) do
 
-local c = num(line:match("^\tARGC%((%d)"))
-if c and c > 0 then
-  argc, argi = c, 0
+local line_argc = num(line:match("^\tARGC%((%d)"))
+local line_arg = line:match("^\tARG_[%w_]+%(")
+
+if line_argc and line_argc > 0 then
+  curr_argc, curr_arg = line_argc, 0
 end
 
-local arg = line:match("^\tARG_[%w_]+%(")
-if arg and not argi then
+if line_arg and not curr_arg then
   errors:add("%s:%d: ARG without preceding ARGC", fname, lineno)
 end
 
-if not arg and argi and not c then
-  errors:add("%s:%d: expecting ARG %d, got %s", fname, lineno, argi, line)
-  argc, argi = nil, nil
+if not line_arg and curr_arg and not line_argc then
+  errors:add("%s:%d: expecting ARG %d, got %s",
+fname, lineno, curr_arg, line)
+  curr_argc, curr_arg = nil, nil
 end
 
-if arg and argi then
-  argi = argi + 1
-  if argi == argc then
-argc, argi = nil, nil
+if line_arg and curr_arg then
+  curr_arg = curr_arg + 1
+  if curr_arg == curr_argc then
+curr_argc, curr_arg = nil, nil
   end
 end
   end



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:25:08 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: lint.lua

Log Message:
tests/libcurses: improve local variable names in linter


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/slave/lint.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:17:53 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c curses_commands.h

Log Message:
tests/libcurses: unexport argument handling functions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/tests/lib/libcurses/slave/curses_commands.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libcurses/slave/curses_commands.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:17:53 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c curses_commands.h

Log Message:
tests/libcurses: unexport argument handling functions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/tests/lib/libcurses/slave/curses_commands.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libcurses/slave/curses_commands.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/curses_commands.c
diff -u src/tests/lib/libcurses/slave/curses_commands.c:1.27 src/tests/lib/libcurses/slave/curses_commands.c:1.28
--- src/tests/lib/libcurses/slave/curses_commands.c:1.27	Sun Jun 13 19:13:20 2021
+++ src/tests/lib/libcurses/slave/curses_commands.c	Sun Jun 13 19:17:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_commands.c,v 1.27 2021/06/13 19:13:20 rillig Exp $	*/
+/*	$NetBSD: curses_commands.c,v 1.28 2021/06/13 19:17:53 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -38,8 +38,8 @@
 #include "slave.h"
 #include "curses_commands.h"
 
-int
-set_int(char *arg, int *x)
+static int
+set_int(const char *arg, int *x)
 {
 	if (sscanf(arg, "%d", x) == 0) {
 		report_count(1);
@@ -50,8 +50,8 @@ set_int(char *arg, int *x)
 	return 0;
 }
 
-int
-set_uint(char *arg, unsigned int *x)
+static int
+set_uint(const char *arg, unsigned int *x)
 {
 	if (sscanf(arg, "%u", x) == 0) {
 		report_count(1);
@@ -62,8 +62,8 @@ set_uint(char *arg, unsigned int *x)
 	return 0;
 }
 
-int
-set_short(char *arg, short *x)
+static int
+set_short(const char *arg, short *x)
 {
 	if (sscanf(arg, "%hd", x) == 0) {
 		report_count(1);
@@ -74,8 +74,8 @@ set_short(char *arg, short *x)
 	return 0;
 }
 
-int
-set_win(char *arg, WINDOW **x)
+static int
+set_win(const char *arg, WINDOW **x)
 {
 	if (sscanf(arg, "%p", x) == 0) {
 		report_count(1);
@@ -86,8 +86,8 @@ set_win(char *arg, WINDOW **x)
 	return 0;
 }
 
-int
-set_scrn(char *arg, SCREEN **x)
+static int
+set_scrn(const char *arg, SCREEN **x)
 {
 	if (sscanf(arg, "%p", x) == 0) {
 		report_count(1);

Index: src/tests/lib/libcurses/slave/curses_commands.h
diff -u src/tests/lib/libcurses/slave/curses_commands.h:1.7 src/tests/lib/libcurses/slave/curses_commands.h:1.8
--- src/tests/lib/libcurses/slave/curses_commands.h:1.7	Sat Feb 13 08:14:46 2021
+++ src/tests/lib/libcurses/slave/curses_commands.h	Sun Jun 13 19:17:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_commands.h,v 1.7 2021/02/13 08:14:46 rillig Exp $	*/
+/*	$NetBSD: curses_commands.h,v 1.8 2021/06/13 19:17:53 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -36,12 +36,6 @@ struct command_def {
 	void (*func)(int, char **);
 };
 
-int set_int(char *, int *);
-int set_uint(char *, unsigned int *);
-int set_short(char *, short *);
-int set_win(char *, WINDOW **);
-int set_scrn(char *, SCREEN **);
-
 /*
  * prototypes for test commands
  */



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:13:20 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c

Log Message:
tests/libcurses: KNF for while loop


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/lib/libcurses/slave/curses_commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/curses_commands.c
diff -u src/tests/lib/libcurses/slave/curses_commands.c:1.26 src/tests/lib/libcurses/slave/curses_commands.c:1.27
--- src/tests/lib/libcurses/slave/curses_commands.c:1.26	Sun Jun 13 18:11:44 2021
+++ src/tests/lib/libcurses/slave/curses_commands.c	Sun Jun 13 19:13:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_commands.c,v 1.26 2021/06/13 18:11:44 rillig Exp $	*/
+/*	$NetBSD: curses_commands.c,v 1.27 2021/06/13 19:13:20 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -165,7 +165,9 @@ cmd_DRAIN(int nargs, char **args)
 	ARGC(1);
 	ARG_WINDOW(win);
 
-	while (wgetch(win) != ERR);
+	while (wgetch(win) != ERR)
+		continue;
+
 	report_count(1);
 	report_return(OK);
 }



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 19:13:20 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c

Log Message:
tests/libcurses: KNF for while loop


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tests/lib/libcurses/slave/curses_commands.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 18:11:44 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c lint.lua

Log Message:
tests/libcurses: remove redundant argument numbers

Since all arguments are processed in increasing order, there is no need
to add the redundant argument numbers.  Most of the curses functions
have less than 5 arguments, which makes it easy enough to count the ARG
macros.

Changes to curses_commands.c:

* replace ^(\tARG_\w+\()\d(?:, |) with $1
* replace (define ARG_\w+\()i,\s with $1
* replace args\[i\] with *args++
* replace \(i\) with ()
* replace \(void\)0 with args++

The wrong argument count in cmd_mvwget_wch is still detected by
lint.lua, as it was before.  There is no test yet that covers this
function.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tests/lib/libcurses/slave/curses_commands.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/slave/lint.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/curses_commands.c
diff -u src/tests/lib/libcurses/slave/curses_commands.c:1.25 src/tests/lib/libcurses/slave/curses_commands.c:1.26
--- src/tests/lib/libcurses/slave/curses_commands.c:1.25	Sun Apr  4 09:49:13 2021
+++ src/tests/lib/libcurses/slave/curses_commands.c	Sun Jun 13 18:11:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_commands.c,v 1.25 2021/04/04 09:49:13 rin Exp $	*/
+/*	$NetBSD: curses_commands.c,v 1.26 2021/06/13 18:11:44 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -102,68 +102,68 @@ set_scrn(char *arg, SCREEN **x)
 	if (check_arg_count(nargs, n) == 1)\
 		return
 
-#define ARG_SHORT(i, arg) \
+#define ARG_SHORT(arg) \
 	short arg;			\
-	if (set_short(args[i], ) != 0)\
+	if (set_short(*args++, ) != 0)\
 		return
 
-#define ARG_INT(i, arg) \
+#define ARG_INT(arg) \
 	int arg;			\
-	if (set_int(args[i], ) != 0)\
+	if (set_int(*args++, ) != 0)\
 		return
 
-#define ARG_UINT(i, arg) \
+#define ARG_UINT(arg) \
 	unsigned int arg;		\
-	if (set_uint(args[i], ) != 0)\
+	if (set_uint(*args++, ) != 0)\
 		return
 
-#define ARG_CHTYPE(i, arg) \
-	chtype arg = ((const chtype *)args[i])[0]
+#define ARG_CHTYPE(arg) \
+	chtype arg = ((const chtype *)*args++)[0]
 
-#define ARG_WCHAR(i, arg) \
-	wchar_t arg = ((const wchar_t *)args[i])[0]
+#define ARG_WCHAR(arg) \
+	wchar_t arg = ((const wchar_t *)*args++)[0]
 
-#define ARG_STRING(i, arg) \
-	const char *arg = args[i]
+#define ARG_STRING(arg) \
+	const char *arg = *args++
 
 /* Only used for legacy interfaces that are missing the 'const'. */
-#define ARG_MODIFIABLE_STRING(i, arg) \
-	char *arg = args[i]
+#define ARG_MODIFIABLE_STRING(arg) \
+	char *arg = *args++
 
-#define ARG_CHTYPE_STRING(i, arg) \
-	const chtype *arg = (const chtype *)args[i]
+#define ARG_CHTYPE_STRING(arg) \
+	const chtype *arg = (const chtype *)*args++
 
-#define ARG_CCHAR_STRING(i, arg) \
-	const cchar_t *arg = (const cchar_t *)args[i]
+#define ARG_CCHAR_STRING(arg) \
+	const cchar_t *arg = (const cchar_t *)*args++
 
-#define ARG_WCHAR_STRING(i, arg) \
-	wchar_t *arg = (wchar_t *)args[i]
+#define ARG_WCHAR_STRING(arg) \
+	wchar_t *arg = (wchar_t *)*args++
 
-#define ARG_WINDOW(i, arg) \
+#define ARG_WINDOW(arg) \
 	WINDOW *arg;			\
-	if (set_win(args[i], ) != 0)\
+	if (set_win(*args++, ) != 0)\
 		return
 
-#define ARG_SCREEN(i, arg) \
+#define ARG_SCREEN(arg) \
 	SCREEN *arg;			\
-	if (set_scrn(args[i], ) != 0)\
+	if (set_scrn(*args++, ) != 0)\
 		return
 
 /*
  * Required by the API, intended for future extensions, but this
  * implementation does not support the extension.
  */
-#define ARG_NULL(i) \
-	(void)0
+#define ARG_NULL() \
+	args++
 
-#define ARG_IGNORE(i) \
-	(void)0
+#define ARG_IGNORE() \
+	args++
 
 void
 cmd_DRAIN(int nargs, char **args)
 {
 	ARGC(1);
-	ARG_WINDOW(0, win);
+	ARG_WINDOW(win);
 
 	while (wgetch(win) != ERR);
 	report_count(1);
@@ -174,8 +174,8 @@ void
 cmd_addbytes(int nargs, char **args)
 {
 	ARGC(2);
-	ARG_STRING(0, str);
-	ARG_INT(1, count);
+	ARG_STRING(str);
+	ARG_INT(count);
 
 	report_count(1);
 	report_return(addbytes(str, count));
@@ -186,7 +186,7 @@ void
 cmd_addch(int nargs, char **args)
 {
 	ARGC(1);
-	ARG_CHTYPE(0, ch);
+	ARG_CHTYPE(ch);
 
 	report_count(1);
 	report_return(addch(ch));
@@ -197,8 +197,8 @@ void
 cmd_addchnstr(int nargs, char **args)
 {
 	ARGC(2);
-	ARG_CHTYPE_STRING(0, chstr);
-	ARG_INT(1, count);
+	ARG_CHTYPE_STRING(chstr);
+	ARG_INT(count);
 
 	report_count(1);
 	report_return(addchnstr(chstr, count));
@@ -209,7 +209,7 @@ void
 cmd_addchstr(int nargs, char **args)
 {
 	ARGC(1);
-	ARG_CHTYPE_STRING(0, chstr);
+	ARG_CHTYPE_STRING(chstr);
 
 	report_count(1);
 	report_return(addchstr(chstr));
@@ -220,8 +220,8 @@ void
 cmd_addnstr(int nargs, char **args)
 {
 	ARGC(2);
-	ARG_STRING(0, str);
-	ARG_INT(1, count);
+	ARG_STRING(str);
+	

CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 18:11:44 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: curses_commands.c lint.lua

Log Message:
tests/libcurses: remove redundant argument numbers

Since all arguments are processed in increasing order, there is no need
to add the redundant argument numbers.  Most of the curses functions
have less than 5 arguments, which makes it easy enough to count the ARG
macros.

Changes to curses_commands.c:

* replace ^(\tARG_\w+\()\d(?:, |) with $1
* replace (define ARG_\w+\()i,\s with $1
* replace args\[i\] with *args++
* replace \(i\) with ()
* replace \(void\)0 with args++

The wrong argument count in cmd_mvwget_wch is still detected by
lint.lua, as it was before.  There is no test yet that covers this
function.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tests/lib/libcurses/slave/curses_commands.c
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/slave/lint.lua

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 12:46:02 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: commands.c slave.c

Log Message:
tests/libcurses: add parentheses around argument to sizeof


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libcurses/slave/commands.c
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libcurses/slave/slave.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/slave/commands.c
diff -u src/tests/lib/libcurses/slave/commands.c:1.14 src/tests/lib/libcurses/slave/commands.c:1.15
--- src/tests/lib/libcurses/slave/commands.c:1.14	Mon Feb 15 07:06:27 2021
+++ src/tests/lib/libcurses/slave/commands.c	Sun Jun 13 12:46:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: commands.c,v 1.14 2021/02/15 07:06:27 rillig Exp $	*/
+/*	$NetBSD: commands.c,v 1.15 2021/06/13 12:46:01 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -98,7 +98,7 @@ write_to_director(const void *mem, size_
 static void
 write_to_director_int(int i)
 {
-	write_to_director(, sizeof i);
+	write_to_director(, sizeof(i));
 }
 
 static void
@@ -218,7 +218,7 @@ report_nstr(chtype *string)
 	for (p = string; (*p & __CHARTEXT) != 0; p++)
 		continue;
 
-	size = (size_t)(p + 1 - string) * sizeof *p;
+	size = (size_t)(p + 1 - string) * sizeof(*p);
 
 	write_to_director_type(data_byte);
 	write_to_director_int(size);
@@ -233,8 +233,8 @@ report_cchar(cchar_t c)
 {
 
 	write_to_director_type(data_cchar);
-	write_to_director_int(sizeof c);
-	write_to_director(, sizeof c);
+	write_to_director_int(sizeof(c));
+	write_to_director(, sizeof(c));
 }
 
 /*
@@ -262,7 +262,7 @@ report_wstr(wchar_t *wstr)
 
 	for (p = wstr; *p != L'\0'; p++)
 		continue;
-	size = (size_t)(p + 1 - wstr) * sizeof *p;
+	size = (size_t)(p + 1 - wstr) * sizeof(*p);
 
 
 	write_to_director_type(data_wchar);

Index: src/tests/lib/libcurses/slave/slave.c
diff -u src/tests/lib/libcurses/slave/slave.c:1.16 src/tests/lib/libcurses/slave/slave.c:1.17
--- src/tests/lib/libcurses/slave/slave.c:1.16	Sat Feb 13 10:03:49 2021
+++ src/tests/lib/libcurses/slave/slave.c	Sun Jun 13 12:46:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: slave.c,v 1.16 2021/02/13 10:03:49 rillig Exp $	*/
+/*	$NetBSD: slave.c,v 1.17 2021/06/13 12:46:01 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -82,12 +82,12 @@ read_command_argument(char ***pargs, int
 	int type, len;
 	char **args = *pargs;
 
-	read_from_director(, sizeof type);
-	read_from_director(, sizeof len);
+	read_from_director(, sizeof(type));
+	read_from_director(, sizeof(len));
 	if (len < 0)
 		return false;
 
-	args = realloc(args, (argslen + 1) * sizeof args[0]);
+	args = realloc(args, (argslen + 1) * sizeof(args[0]));
 	if (args == NULL)
 		err(1, "slave realloc of args array failed");
 	*pargs = args;
@@ -134,11 +134,11 @@ process_commands(void)
 	if ((cmdbuf = malloc(maxlen)) == NULL)
 		err(1, "slave cmdbuf malloc failed");
 
-	while (try_read_from_director(, sizeof type)) {
+	while (try_read_from_director(, sizeof(type))) {
 		if (type != data_string)
 			errx(1, "Unexpected type for command, got %d", type);
 
-		read_from_director(, sizeof len);
+		read_from_director(, sizeof(len));
 
 		if ((len + 1) > maxlen) {
 			maxlen = len + 1;



CVS commit: src/tests/lib/libcurses/slave

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 12:46:02 UTC 2021

Modified Files:
src/tests/lib/libcurses/slave: commands.c slave.c

Log Message:
tests/libcurses: add parentheses around argument to sizeof


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libcurses/slave/commands.c
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libcurses/slave/slave.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/director

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 11:06:20 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: sprinkle 'const', normalize sizeof

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_parse.y
diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.52 src/tests/lib/libcurses/director/testlang_parse.y:1.53
--- src/tests/lib/libcurses/director/testlang_parse.y:1.52	Tue Apr  6 01:29:37 2021
+++ src/tests/lib/libcurses/director/testlang_parse.y	Sun Jun 13 11:06:20 2021
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_parse.y,v 1.52 2021/04/06 01:29:37 rillig Exp $	*/
+/*	$NetBSD: testlang_parse.y,v 1.53 2021/06/13 11:06:20 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -82,7 +82,7 @@ static bool no_input;	/* don't need more
 static wchar_t *vals = NULL;	/* wchars to attach to a cchar type */
 static unsigned nvals;		/* number of wchars */
 
-const char *enum_names[] = {	/* for data_enum_t */
+const char *const enum_names[] = {	/* for data_enum_t */
 	"unused", "numeric", "static", "string", "byte", "cchar", "wchar", "ERR",
 	"OK", "NULL", "not NULL", "variable", "reference", "return count",
 	"slave error"
@@ -116,7 +116,7 @@ typedef struct {
 static size_t nvars; 		/* Number of declared variables */
 static var_t *vars; 		/* Variables defined during the test. */
 
-static int	check_function_table(char *, const char *[], int);
+static int	check_function_table(char *, const char *const[], int);
 static int	find_var_index(const char *);
 static void 	assign_arg(data_enum_t, void *);
 static int	assign_var(const char *);
@@ -149,7 +149,7 @@ static void	set_wchar(char *);
 static wchar_t *add_to_vals(data_enum_t, void *);
 
 #define variants(fn) "" fn, "mv" fn, "w" fn, "mvw" fn
-static const char *input_functions[] = {
+static const char *const input_functions[] = {
 	variants("getch"),
 	variants("getnstr"),
 	variants("getstr"),
@@ -161,7 +161,7 @@ static const char *input_functions[] = {
 #undef variants
 
 static const unsigned ninput_functions =
-	sizeof(input_functions) / sizeof(char *);
+	sizeof(input_functions) / sizeof(input_functions[0]);
 
 extern saved_data_t saved_output;
 
@@ -875,7 +875,7 @@ find_var_index(const char *var_name)
  * there is a match.
  */
 static int
-check_function_table(char *function, const char *table[], int nfunctions)
+check_function_table(char *function, const char *const table[], int nfunctions)
 {
 	int i;
 



CVS commit: src/tests/lib/libcurses/director

2021-06-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 13 11:06:20 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: sprinkle 'const', normalize sizeof

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/director

2021-06-10 Thread Michael Forney
Module Name:src
Committed By:   mcf
Date:   Thu Jun 10 07:21:07 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: director.c

Log Message:
Unset ESCDELAY in libcurses test director to ensure consistent results

Non-default values of ESCDELAY may result in unexpected test failures.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libcurses/director/director.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/director.c
diff -u src/tests/lib/libcurses/director/director.c:1.28 src/tests/lib/libcurses/director/director.c:1.29
--- src/tests/lib/libcurses/director/director.c:1.28	Sat Feb 13 09:18:12 2021
+++ src/tests/lib/libcurses/director/director.c	Thu Jun 10 07:21:07 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: director.c,v 1.28 2021/02/13 09:18:12 rillig Exp $	*/
+/*	$NetBSD: director.c,v 1.29 2021/06/10 07:21:07 mcf Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -195,6 +195,9 @@ main(int argc, char *argv[])
 	if (setenv("TERM", term, 1) != 0)
 		err(2, "Failed to set TERM variable");
 
+	if (unsetenv("ESCDELAY") != 0)
+		err(2, "Failed to unset ESCDELAY variable");
+
 	if (stat(termpath, ) == -1)
 		err(1, "Cannot stat %s", termpath);
 



CVS commit: src/tests/lib/libcurses/director

2021-06-10 Thread Michael Forney
Module Name:src
Committed By:   mcf
Date:   Thu Jun 10 07:21:07 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: director.c

Log Message:
Unset ESCDELAY in libcurses test director to ensure consistent results

Non-default values of ESCDELAY may result in unexpected test failures.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tests/lib/libcurses/director/director.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-06-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun  6 04:57:58 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile slk1.chk slk3.chk
slk5.chk slk6.chk slk_init.chk
src/tests/lib/libcurses/tests: addstr slk
Added Files:
src/tests/lib/libcurses/check_files: addstr2.chk addstr3.chk

Log Message:
New tests and updates for corrected behaviour due to fix for PR56224
* Added extra testing to the addstr test to demonstrate bug described
  in PR#56224 and validate case when scrolling enabled still works.
* Fixed slk test, the slk_init output changed due to corrected wrapping,
  slk_restore no longer returns ERR probably due to addwchar no longer
  returning ERR when an implicit scroll was attempted when scrolling
  disabled.  Commented out the slk_wset test, this is now returning ERR
  instead of misbehaving, needs investigation.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/addstr2.chk \
src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/slk1.chk \
src/tests/lib/libcurses/check_files/slk3.chk \
src/tests/lib/libcurses/check_files/slk5.chk \
src/tests/lib/libcurses/check_files/slk6.chk \
src/tests/lib/libcurses/check_files/slk_init.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/addstr
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.6 src/tests/lib/libcurses/check_files/Makefile:1.7
--- src/tests/lib/libcurses/check_files/Makefile:1.6	Sat Jun  5 06:11:09 2021
+++ src/tests/lib/libcurses/check_files/Makefile	Sun Jun  6 04:57:58 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2021/06/05 06:11:09 blymn Exp $
+# $NetBSD: Makefile,v 1.7 2021/06/06 04:57:58 blymn Exp $
 
 NOMAN=		# defined
 
@@ -21,6 +21,8 @@ FILES+=		addnstr.chk
 FILES+=		addnwstr1.chk
 FILES+=		addnwstr2.chk
 FILES+=		addstr.chk
+FILES+=		addstr2.chk
+FILES+=		addstr3.chk
 FILES+=		addwstr1.chk
 FILES+=		addwstr2.chk
 FILES+=		addwstr3.chk

Index: src/tests/lib/libcurses/check_files/slk1.chk
diff -u src/tests/lib/libcurses/check_files/slk1.chk:1.1 src/tests/lib/libcurses/check_files/slk1.chk:1.2
--- src/tests/lib/libcurses/check_files/slk1.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/slk1.chk	Sun Jun  6 04:57:58 2021
@@ -1 +1 @@
-cup24;1Xrevone sgr0smsosmulrev  one   rmsormulsgr0smsorev onermsosgr0cup24;42Xsmulrev  five  cup24;73Xeight!!rmam!smamcup24;50Xrmulsgr0
\ No newline at end of file
+cup24;1Xrevone sgr0smsosmulrev  one   rmsormulsgr0smsorev onermsosgr0cup24;42Xsmulrev  five  cup24;73Xeight!!cup24;50Xrmulsgr0
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk3.chk
diff -u src/tests/lib/libcurses/check_files/slk3.chk:1.1 src/tests/lib/libcurses/check_files/slk3.chk:1.2
--- src/tests/lib/libcurses/check_files/slk3.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/slk3.chk	Sun Jun  6 04:57:58 2021
@@ -1 +1 @@
-smulrev one  five  eight!!rmam!smamcup24;1Xrmulsgr0
\ No newline at end of file
+smulrev one  five  eight!!rmulsgr0
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk5.chk
diff -u src/tests/lib/libcurses/check_files/slk5.chk:1.1 src/tests/lib/libcurses/check_files/slk5.chk:1.2
--- src/tests/lib/libcurses/check_files/slk5.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/slk5.chk	Sun Jun  6 04:57:58 2021
@@ -1 +1 @@
-cup24;1Xsmulrev onesgr0 smulrev  two   sgr0 smulrevsgr0 smulrevsgr0  smulrev  five  sgr0 smulrevsgr0 smulrevsgr0 smulreveight!!rmam!smamcup24;18Xrmulsgr0
\ No newline at end of file
+cup24;1Xsmulrev onesgr0 smulrev  two   sgr0 smulrevsgr0 smulrevsgr0  smulrev  five  sgr0 smulrevsgr0 smulrevsgr0 smulreveight!!rmulsgr0elcup24;18X
\ No newline at end of file
Index: src/tests/lib/libcurses/check_files/slk6.chk
diff -u src/tests/lib/libcurses/check_files/slk6.chk:1.1 src/tests/lib/libcurses/check_files/slk6.chk:1.2
--- src/tests/lib/libcurses/check_files/slk6.chk:1.1	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/check_files/slk6.chk	Sun Jun  6 04:57:58 2021
@@ -1 +1 @@
-opsetaf7Xsetab0Xsmulrev onesgr0setaf7Xsetab0X smulrev  two   sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X setaf1Xsetab2Xsmulrevfoursgr0setaf7Xsetab0X  smulrev  five  sgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X smulrevsgr0setaf7Xsetab0X 

CVS commit: src/tests/lib/libcurses

2021-06-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sun Jun  6 04:57:58 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile slk1.chk slk3.chk
slk5.chk slk6.chk slk_init.chk
src/tests/lib/libcurses/tests: addstr slk
Added Files:
src/tests/lib/libcurses/check_files: addstr2.chk addstr3.chk

Log Message:
New tests and updates for corrected behaviour due to fix for PR56224
* Added extra testing to the addstr test to demonstrate bug described
  in PR#56224 and validate case when scrolling enabled still works.
* Fixed slk test, the slk_init output changed due to corrected wrapping,
  slk_restore no longer returns ERR probably due to addwchar no longer
  returning ERR when an implicit scroll was attempted when scrolling
  disabled.  Commented out the slk_wset test, this is now returning ERR
  instead of misbehaving, needs investigation.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/addstr2.chk \
src/tests/lib/libcurses/check_files/addstr3.chk
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/check_files/slk1.chk \
src/tests/lib/libcurses/check_files/slk3.chk \
src/tests/lib/libcurses/check_files/slk5.chk \
src/tests/lib/libcurses/check_files/slk6.chk \
src/tests/lib/libcurses/check_files/slk_init.chk
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libcurses/tests/addstr
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/slk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-06-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sat Jun  5 06:23:48 UTC 2021

Modified Files:
src/tests/lib/libcurses: chk_gen

Log Message:
Convert % into %% in input string so printf won't barf


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/chk_gen

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-06-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sat Jun  5 06:23:48 UTC 2021

Modified Files:
src/tests/lib/libcurses: chk_gen

Log Message:
Convert % into %% in input string so printf won't barf


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/chk_gen

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/chk_gen
diff -u src/tests/lib/libcurses/chk_gen:1.1 src/tests/lib/libcurses/chk_gen:1.2
--- src/tests/lib/libcurses/chk_gen:1.1	Sun Jun  9 07:54:55 2019
+++ src/tests/lib/libcurses/chk_gen	Sat Jun  5 06:23:48 2021
@@ -8,7 +8,7 @@
 OUT=""
 while read -r line
 do
-	next=`echo $line | sed -e 's/\n//' -e 's/\\015/\\r/g' -e 's/\\012/\\n/g'`
+	next=`echo $line | sed -e 's/%/%%/g' -e 's/\n//' -e 's/\\015/\\r/g' -e 's/\\012/\\n/g'`
 	OUT="${OUT}${next}"
 done
 OUT=`echo "${OUT}" | sed 's/\n//'`



CVS commit: src/tests/lib/libcurses/tests

2021-06-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sat Jun  5 06:13:37 UTC 2021

Modified Files:
src/tests/lib/libcurses/tests: clear

Log Message:
Decouple the clear test from the addstr test, they should not be linked
together because they are not really related.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/clear

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/tests/clear
diff -u src/tests/lib/libcurses/tests/clear:1.1 src/tests/lib/libcurses/tests/clear:1.2
--- src/tests/lib/libcurses/tests/clear:1.1	Sun Apr 10 09:55:10 2011
+++ src/tests/lib/libcurses/tests/clear	Sat Jun  5 06:13:36 2021
@@ -1,4 +1,10 @@
-include addstr
+include start
+call OK addstr "abcde\n"
+call OK addstr "\n"
+call OK addstr "\t8\n"
+call OK addstr "0123456\t8\n"
+call OK refresh
+compare clear0.chk
 call OK clear
 call OK refresh
 compare clear1.chk



CVS commit: src/tests/lib/libcurses/tests

2021-06-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sat Jun  5 06:13:37 UTC 2021

Modified Files:
src/tests/lib/libcurses/tests: clear

Log Message:
Decouple the clear test from the addstr test, they should not be linked
together because they are not really related.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libcurses/tests/clear

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/check_files

2021-06-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sat Jun  5 06:11:09 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
Added Files:
src/tests/lib/libcurses/check_files: clear0.chk

Log Message:
Add new check file for the clear test.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/clear0.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/check_files/Makefile
diff -u src/tests/lib/libcurses/check_files/Makefile:1.5 src/tests/lib/libcurses/check_files/Makefile:1.6
--- src/tests/lib/libcurses/check_files/Makefile:1.5	Sun Feb  7 01:53:54 2021
+++ src/tests/lib/libcurses/check_files/Makefile	Sat Jun  5 06:11:09 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2021/02/07 01:53:54 rillig Exp $
+# $NetBSD: Makefile,v 1.6 2021/06/05 06:11:09 blymn Exp $
 
 NOMAN=		# defined
 
@@ -41,6 +41,7 @@ FILES+=		box_standout.chk
 FILES+=		chgat1.chk
 FILES+=		chgat2.chk
 FILES+=		chgat3.chk
+FILES+=		clear0.chk
 FILES+=		clear1.chk
 FILES+=		clear10.chk
 FILES+=		clear2.chk

Added files:

Index: src/tests/lib/libcurses/check_files/clear0.chk
diff -u /dev/null src/tests/lib/libcurses/check_files/clear0.chk:1.1
--- /dev/null	Sat Jun  5 06:11:09 2021
+++ src/tests/lib/libcurses/check_files/clear0.chk	Sat Jun  5 06:11:09 2021
@@ -0,0 +1,2 @@
+abcdecup3;9X8
+0123456 8



CVS commit: src/tests/lib/libcurses/check_files

2021-06-05 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sat Jun  5 06:11:09 UTC 2021

Modified Files:
src/tests/lib/libcurses/check_files: Makefile
Added Files:
src/tests/lib/libcurses/check_files: clear0.chk

Log Message:
Add new check file for the clear test.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libcurses/check_files/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libcurses/check_files/clear0.chk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-06-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Jun  4 23:07:39 UTC 2021

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Fix debug_test so it actually works and does not do damage
* disable blind clearing of /tmp.  The comment says this is needed for 
getwin/putwin
  those tests need to be looked at to correct this.
* remove invalid -I option from director arguments for now.
* fix paths to executables so debug_test will work with installed versions by 
default
  the previous version was using the src tree locations but basedir was wrong 
for that.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses

2021-06-04 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Fri Jun  4 23:07:39 UTC 2021

Modified Files:
src/tests/lib/libcurses: debug_test

Log Message:
Fix debug_test so it actually works and does not do damage
* disable blind clearing of /tmp.  The comment says this is needed for 
getwin/putwin
  those tests need to be looked at to correct this.
* remove invalid -I option from director arguments for now.
* fix paths to executables so debug_test will work with installed versions by 
default
  the previous version was using the src tree locations but basedir was wrong 
for that.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libcurses/debug_test

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/debug_test
diff -u src/tests/lib/libcurses/debug_test:1.4 src/tests/lib/libcurses/debug_test:1.5
--- src/tests/lib/libcurses/debug_test:1.4	Sat Oct 24 04:46:16 2020
+++ src/tests/lib/libcurses/debug_test	Fri Jun  4 23:07:39 2021
@@ -8,7 +8,7 @@ INCLUDE_PATH="${BASEDIR}/tests/"
 export INCLUDE_PATH
 #
 CURSES_TRACE_FILE="/tmp/ctrace"
-SLAVE="${BASEDIR}/slave/slave"
+SLAVE="${BASEDIR}/slave"
 
 usage() {
 	echo "Set up the environment to run the test frame.  Option flags:"
@@ -31,10 +31,11 @@ usage() {
 
 # This is needed for getwin/putwin test case and /tmp can be used for any file
 # related tests.
-rm -rf /tmp/*
+#rm -rf /tmp/*
 
 #
-ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
+#ARGS="-T ${BASEDIR} -I ${INCLUDE_PATH} -C ${CHECK_PATH}"
+ARGS="-T ${BASEDIR} -C ${CHECK_PATH}"
 #
 while getopts cf:L:s:vg opt
 do
@@ -90,4 +91,4 @@ then
 	exit 1
 fi
 #
-exec ${BASEDIR}/director/director ${ARGS} -s ${SLAVE} "${INCLUDE_PATH}/$1"
+exec ${BASEDIR}/director ${ARGS} -s ${SLAVE} "${INCLUDE_PATH}/$1"



CVS commit: src/tests/lib/libcurses/director

2021-04-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr  6 01:29:37 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: fix names of over-the-wire data types

The test 'mvscanw' reported that it would send '%s' as 'numeric', which
was rather suspicious.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_parse.y
diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.51 src/tests/lib/libcurses/director/testlang_parse.y:1.52
--- src/tests/lib/libcurses/director/testlang_parse.y:1.51	Tue Apr  6 00:47:00 2021
+++ src/tests/lib/libcurses/director/testlang_parse.y	Tue Apr  6 01:29:37 2021
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_parse.y,v 1.51 2021/04/06 00:47:00 rillig Exp $	*/
+/*	$NetBSD: testlang_parse.y,v 1.52 2021/04/06 01:29:37 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -82,9 +82,9 @@ static bool no_input;	/* don't need more
 static wchar_t *vals = NULL;	/* wchars to attach to a cchar type */
 static unsigned nvals;		/* number of wchars */
 
-const char *enum_names[] = {
-	"unused", "static", "numeric", "string", "byte", "cchar", "wchar", "ERR",
-	"OK", "NULL", "not NULL", "variable", "reference", "returns count",
+const char *enum_names[] = {	/* for data_enum_t */
+	"unused", "numeric", "static", "string", "byte", "cchar", "wchar", "ERR",
+	"OK", "NULL", "not NULL", "variable", "reference", "return count",
 	"slave error"
 };
 



CVS commit: src/tests/lib/libcurses/director

2021-04-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr  6 01:29:37 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: fix names of over-the-wire data types

The test 'mvscanw' reported that it would send '%s' as 'numeric', which
was rather suspicious.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/tests/lib/libcurses/director

2021-04-05 Thread Valery Ushakov
On Tue, Apr 06, 2021 at 00:47:00 +, Roland Illig wrote:

> The previous "table" was an insult to any reader.  It was unsorted,
> listed the functions shuffled, and was not even formatted consistently.

That's pretty rude.  Please, tone down your commit "messages".


-uwe


CVS commit: src/tests/lib/libcurses/director

2021-04-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr  6 00:47:00 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: clean up table of input functions

The previous "table" was an insult to any reader.  It was unsorted,
listed the functions shuffled, and was not even formatted consistently.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libcurses/director

2021-04-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr  6 00:47:00 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: clean up table of input functions

The previous "table" was an insult to any reader.  It was unsorted,
listed the functions shuffled, and was not even formatted consistently.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_parse.y
diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.50 src/tests/lib/libcurses/director/testlang_parse.y:1.51
--- src/tests/lib/libcurses/director/testlang_parse.y:1.50	Tue Apr  6 00:35:58 2021
+++ src/tests/lib/libcurses/director/testlang_parse.y	Tue Apr  6 00:47:00 2021
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_parse.y,v 1.50 2021/04/06 00:35:58 rillig Exp $	*/
+/*	$NetBSD: testlang_parse.y,v 1.51 2021/04/06 00:47:00 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -148,13 +148,17 @@ static void	set_cchar(char *, void *);
 static void	set_wchar(char *);
 static wchar_t *add_to_vals(data_enum_t, void *);
 
+#define variants(fn) "" fn, "mv" fn, "w" fn, "mvw" fn
 static const char *input_functions[] = {
-	"getch", "mvgetch", "mvwgetch", "wgetch", "getnstr", "getstr", "mvgetnstr",
-	"mvgetstr", "mvwgetnstr", "mvwgetstr", "wgetnstr", "wgetstr", "mvscanw",
-	"mvwscanw", "scanw", "wscanw", "get_wch", "mvget_wch", "mvwget_wch",
-	"wget_wch", "getn_wstr", "get_wstr", "mvgetn_wstr", "mvget_wstr",
-	"mvwgetn_wstr","mvwget_wstr", "wgetn_wstr", "wget_wstr"
+	variants("getch"),
+	variants("getnstr"),
+	variants("getstr"),
+	variants("getn_wstr"),
+	variants("get_wch"),
+	variants("get_wstr"),
+	variants("scanw"),
 };
+#undef variants
 
 static const unsigned ninput_functions =
 	sizeof(input_functions) / sizeof(char *);



CVS commit: src/tests/lib/libcurses/director

2021-04-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr  6 00:35:58 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: don't waste time calling strlen needlessly


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libcurses/director/testlang_parse.y
diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.49 src/tests/lib/libcurses/director/testlang_parse.y:1.50
--- src/tests/lib/libcurses/director/testlang_parse.y:1.49	Mon Feb 15 15:55:50 2021
+++ src/tests/lib/libcurses/director/testlang_parse.y	Tue Apr  6 00:35:58 2021
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: testlang_parse.y,v 1.49 2021/02/15 15:55:50 joerg Exp $	*/
+/*	$NetBSD: testlang_parse.y,v 1.50 2021/04/06 00:35:58 rillig Exp $	*/
 
 /*-
  * Copyright 2009 Brett Lymn 
@@ -876,8 +876,7 @@ check_function_table(char *function, con
 	int i;
 
 	for (i = 0; i < nfunctions; i++) {
-		if ((strlen(function) == strlen(table[i])) &&
-		(strcmp(function, table[i]) == 0))
+		if (strcmp(function, table[i]) == 0)
 			return 1;
 	}
 



CVS commit: src/tests/lib/libcurses/director

2021-04-05 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Apr  6 00:35:58 UTC 2021

Modified Files:
src/tests/lib/libcurses/director: testlang_parse.y

Log Message:
tests/libcurses: don't waste time calling strlen needlessly


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/tests/lib/libcurses/director/testlang_parse.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



  1   2   3   4   5   >