Tue Nov 16 21:02:06 2021 UTC ()
Add more testing for special character handling in ins_wstr family.


(blymn)
diff -r1.8 -r1.9 src/tests/lib/libcurses/check_files/Makefile
diff -r0 -r1.1 src/tests/lib/libcurses/check_files/ins_wstr3.chk
diff -r0 -r1.1 src/tests/lib/libcurses/check_files/ins_wstr4.chk
diff -r0 -r1.1 src/tests/lib/libcurses/check_files/ins_wstr5.chk
diff -r0 -r1.1 src/tests/lib/libcurses/check_files/wins_wstr3.chk
diff -r0 -r1.1 src/tests/lib/libcurses/check_files/wins_wstr4.chk
diff -r0 -r1.1 src/tests/lib/libcurses/check_files/wins_wstr5.chk
diff -r1.1 -r1.2 src/tests/lib/libcurses/tests/ins_wstr
diff -r1.1 -r1.2 src/tests/lib/libcurses/tests/wins_wstr

cvs diff -r1.8 -r1.9 src/tests/lib/libcurses/check_files/Makefile (expand / switch to unified diff)

--- src/tests/lib/libcurses/check_files/Makefile 2021/11/15 06:31:21 1.8
+++ src/tests/lib/libcurses/check_files/Makefile 2021/11/16 21:02:06 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.8 2021/11/15 06:31:21 blymn Exp $ 1# $NetBSD: Makefile,v 1.9 2021/11/16 21:02:06 blymn Exp $
2 2
3NOMAN= # defined 3NOMAN= # defined
4 4
5.include <bsd.own.mk> 5.include <bsd.own.mk>
6 6
7ATFFILE= no 7ATFFILE= no
8 8
9TESTSDIR= ${TESTSBASE}/lib/libcurses 9TESTSDIR= ${TESTSBASE}/lib/libcurses
10 10
11FILESDIR= ${TESTSDIR}/check_files 11FILESDIR= ${TESTSDIR}/check_files
12FILES= curses_start.chk 12FILES= curses_start.chk
13FILES+= add_wch1.chk 13FILES+= add_wch1.chk
14FILES+= add_wch2.chk 14FILES+= add_wch2.chk
@@ -112,26 +112,29 @@ FILES+= getch.chk @@ -112,26 +112,29 @@ FILES+= getch.chk
112FILES+= getn_wstr.chk 112FILES+= getn_wstr.chk
113FILES+= hline.chk 113FILES+= hline.chk
114FILES+= hline1.chk 114FILES+= hline1.chk
115FILES+= hline2.chk 115FILES+= hline2.chk
116FILES+= hline_set.chk 116FILES+= hline_set.chk
117FILES+= home.chk 117FILES+= home.chk
118FILES+= immedok.chk 118FILES+= immedok.chk
119FILES+= ins_nwstr1.chk 119FILES+= ins_nwstr1.chk
120FILES+= ins_wch1.chk 120FILES+= ins_wch1.chk
121FILES+= ins_wch2.chk 121FILES+= ins_wch2.chk
122FILES+= ins_wch3.chk 122FILES+= ins_wch3.chk
123FILES+= ins_wstr1.chk 123FILES+= ins_wstr1.chk
124FILES+= ins_wstr2.chk 124FILES+= ins_wstr2.chk
 125FILES+= ins_wstr3.chk
 126FILES+= ins_wstr4.chk
 127FILES+= ins_wstr5.chk
125FILES+= insch.chk 128FILES+= insch.chk
126FILES+= insch1.chk 129FILES+= insch1.chk
127FILES+= insch2.chk 130FILES+= insch2.chk
128FILES+= insdelln1.chk 131FILES+= insdelln1.chk
129FILES+= insdelln3.chk 132FILES+= insdelln3.chk
130FILES+= insdelln4.chk 133FILES+= insdelln4.chk
131FILES+= insdelln5.chk 134FILES+= insdelln5.chk
132FILES+= insdelln6.chk 135FILES+= insdelln6.chk
133FILES+= insdelln7.chk 136FILES+= insdelln7.chk
134FILES+= insdelln_1.chk 137FILES+= insdelln_1.chk
135FILES+= insdelln_3.chk 138FILES+= insdelln_3.chk
136FILES+= insdelln_4.chk 139FILES+= insdelln_4.chk
137FILES+= insdelln_5.chk 140FILES+= insdelln_5.chk
@@ -254,26 +257,29 @@ FILES+= wgetstr_refresh.chk @@ -254,26 +257,29 @@ FILES+= wgetstr_refresh.chk
254FILES+= whline1.chk 257FILES+= whline1.chk
255FILES+= whline2.chk 258FILES+= whline2.chk
256FILES+= whline_set.chk 259FILES+= whline_set.chk
257FILES+= window.chk 260FILES+= window.chk
258FILES+= window2.chk 261FILES+= window2.chk
259FILES+= window_hierarchy.chk 262FILES+= window_hierarchy.chk
260FILES+= wins_wch1.chk 263FILES+= wins_wch1.chk
261FILES+= wins_wch2.chk 264FILES+= wins_wch2.chk
262FILES+= wins_wch3.chk 265FILES+= wins_wch3.chk
263FILES+= wins_nwstr1.chk 266FILES+= wins_nwstr1.chk
264FILES+= wins_nwstr2.chk 267FILES+= wins_nwstr2.chk
265FILES+= wins_wstr1.chk 268FILES+= wins_wstr1.chk
266FILES+= wins_wstr2.chk 269FILES+= wins_wstr2.chk
 270FILES+= wins_wstr3.chk
 271FILES+= wins_wstr4.chk
 272FILES+= wins_wstr5.chk
267FILES+= winsch1.chk 273FILES+= winsch1.chk
268FILES+= winsch2.chk 274FILES+= winsch2.chk
269FILES+= wprintw_refresh.chk 275FILES+= wprintw_refresh.chk
270FILES+= wredrawln1.chk 276FILES+= wredrawln1.chk
271FILES+= wredrawln2.chk 277FILES+= wredrawln2.chk
272FILES+= wscrl1.chk 278FILES+= wscrl1.chk
273FILES+= wscrl2.chk 279FILES+= wscrl2.chk
274FILES+= wsetscrreg.chk 280FILES+= wsetscrreg.chk
275FILES+= wtouchln.chk 281FILES+= wtouchln.chk
276FILES+= wvline1.chk 282FILES+= wvline1.chk
277FILES+= wvline2.chk 283FILES+= wvline2.chk
278FILES+= wvline_set.chk 284FILES+= wvline_set.chk
279 285

File Added: src/tests/lib/libcurses/check_files/ins_wstr3.chk
cup21;1XBB

File Added: src/tests/lib/libcurses/check_files/ins_wstr4.chk

File Added: src/tests/lib/libcurses/check_files/ins_wstr5.chk
F			F

File Added: src/tests/lib/libcurses/check_files/wins_wstr3.chk
cup8;7XCcup8;7X

File Added: src/tests/lib/libcurses/check_files/wins_wstr4.chk
A㐁Acup5;7Xelcup6;7XAAcup7;7XD cup8;7X Ecup8;7X

File Added: src/tests/lib/libcurses/check_files/wins_wstr5.chk
FFGGcup8;7X

cvs diff -r1.1 -r1.2 src/tests/lib/libcurses/tests/ins_wstr (expand / switch to unified diff)

--- src/tests/lib/libcurses/tests/ins_wstr 2020/10/24 04:46:17 1.1
+++ src/tests/lib/libcurses/tests/ins_wstr 2021/11/16 21:02:06 1.2
@@ -10,19 +10,35 @@ wchar FWSTR [0x300, "A"*2] @@ -10,19 +10,35 @@ wchar FWSTR [0x300, "A"*2]
10call ERR ins_wstr $FWSTR 10call ERR ins_wstr $FWSTR
11 11
12call OK mvaddstr 10 75 "AAA" 12call OK mvaddstr 10 75 "AAA"
13call OK refresh 13call OK refresh
14 14
15# test shifting of above added characters, test do not wrap property  15# test shifting of above added characters, test do not wrap property
16wchar NSTR ["A"*4] 16wchar NSTR ["A"*4]
17call OK move 10 10 17call OK move 10 10
18call OK ins_wstr $NSTR 18call OK ins_wstr $NSTR
19call OK refresh 19call OK refresh
20call2 10 10 getyx STDSCR 20call2 10 10 getyx STDSCR
21compare ins_wstr2.chk 21compare ins_wstr2.chk
22 22
23# lib/55433: Bug in special character handling of ins_wstr() of libcurses 23# This should result in just BB
24# test special character processing [FAILING] 24wchar NSTR ["A"*3, "\r", "B"*2]
25# wchar NSTR ["A"*3, "\r", "B"*2] 25call OK move 20 0
26# call OK move 20 0 26call OK ins_wstr $NSTR
27# call OK ins_wstr $NSTR 27call OK refresh
28# call OK refresh 28compare ins_wstr3.chk
 29
 30# Check handling of tabs
 31# first try inserting too many, it should fail
 32wchar TSTR [ "\t"*20 ]
 33call ERR ins_wstr $TSTR
 34call OK refresh
 35call2 20 0 getyx STDSCR
 36compare ins_wstr4.chk
 37
 38# Now insert a few tabs...
 39wchar USTR [ "F", "\t"*3, "F" ]
 40call OK ins_wstr $USTR
 41call OK refresh
 42call2 20 0 getyx STDSCR
 43compare ins_wstr5.chk
 44

cvs diff -r1.1 -r1.2 src/tests/lib/libcurses/tests/wins_wstr (expand / switch to unified diff)

--- src/tests/lib/libcurses/tests/wins_wstr 2020/10/24 04:46:17 1.1
+++ src/tests/lib/libcurses/tests/wins_wstr 2021/11/16 21:02:06 1.2
@@ -6,13 +6,45 @@ call OK wrefresh $win1 @@ -6,13 +6,45 @@ call OK wrefresh $win1
6call2 2 1 getyx $win1 6call2 2 1 getyx $win1
7compare wins_wstr1.chk 7compare wins_wstr1.chk
8 8
9call OK mvwaddstr $win1 4 4 "BB" 9call OK mvwaddstr $win1 4 4 "BB"
10call OK wrefresh $win1 10call OK wrefresh $win1
11 11
12# test shifting of above added characters, test do not wrap property  12# test shifting of above added characters, test do not wrap property
13wchar NSTR ["A"*2] 13wchar NSTR ["A"*2]
14call OK wmove $win1 4 1 14call OK wmove $win1 4 1
15call OK wins_wstr $win1 $NSTR 15call OK wins_wstr $win1 $NSTR
16call OK wrefresh $win1 16call OK wrefresh $win1
17call2 4 1 getyx $win1 17call2 4 1 getyx $win1
18compare wins_wstr2.chk 18compare wins_wstr2.chk
 19
 20#
 21# test the special character handling.
 22#
 23# handling of a carriage return
 24wchar RSTR ["B", "\r", "C" ]
 25call OK wmove $win1 5 1
 26call OK wins_wstr $win1 $RSTR
 27call OK wrefresh $win1
 28call2 5 1 getyx $win1
 29compare wins_wstr3.chk
 30
 31# handling of a newline
 32wchar JSTR [ "D", "\n", "E" ]
 33call OK wmove $win1 5 1
 34# this should fail since scrollok is false
 35call OK scrollok $win1 $FALSE
 36call ERR wins_wstr $win1 $JSTR
 37
 38# try again after enabling scroll
 39call OK scrollok $win1 $TRUE
 40call OK wins_wstr $win1 $JSTR
 41call OK wrefresh $win1
 42call2 5 1 getyx $win1
 43compare wins_wstr4.chk
 44
 45# handling of a backspace
 46wchar BSTR [ "F"*3, "\b", "G"*2 ]
 47call OK wins_wstr $win1 $BSTR
 48call OK wrefresh $win1
 49call2 5 1 getyx $win1
 50compare wins_wstr5.chk