Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libcurses Update of tests to account for output ch...



details:   https://anonhg.NetBSD.org/src/rev/5fabf5d641c3
branches:  trunk
changeset: 359819:5fabf5d641c3
user:      blymn <blymn%NetBSD.org@localhost>
date:      Tue Jan 25 03:23:05 2022 +0000

description:
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.

diffstat:

 tests/lib/libcurses/check_files/add_wch3.chk   |    2 +-
 tests/lib/libcurses/check_files/get_wstr.chk   |    2 +-
 tests/lib/libcurses/check_files/getn_wstr.chk  |    2 +-
 tests/lib/libcurses/check_files/ins_wch1.chk   |    2 +-
 tests/lib/libcurses/check_files/ins_wch2.chk   |    2 +-
 tests/lib/libcurses/check_files/ins_wch3.chk   |    2 +-
 tests/lib/libcurses/check_files/mvins_wch.chk  |    2 +-
 tests/lib/libcurses/check_files/wget_wstr.chk  |    2 +-
 tests/lib/libcurses/check_files/wgetn_wstr.chk |    2 +-
 tests/lib/libcurses/check_files/wins_wch1.chk  |    2 +-
 tests/lib/libcurses/check_files/wins_wch2.chk  |    2 +-
 tests/lib/libcurses/check_files/wins_wch3.chk  |    2 +-
 tests/lib/libcurses/check_files/wvline_set.chk |    2 +-
 tests/lib/libcurses/debug_test                 |    4 +
 tests/lib/libcurses/t_curses.sh                |  137 ++++++++++++------------
 tests/lib/libcurses/tests/add_wch              |    7 +-
 tests/lib/libcurses/tests/ins_wch              |    3 +
 tests/lib/libcurses/tests/overwrite            |    4 +-
 18 files changed, 93 insertions(+), 88 deletions(-)

diffs (truncated from 816 to 300 lines):

diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/add_wch3.chk
--- a/tests/lib/libcurses/check_files/add_wch3.chk      Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/add_wch3.chk      Tue Jan 25 03:23:05 2022 +0000
@@ -1,2 +1,2 @@
 smso㐁rmsohome
-㐁㐁

\ No newline at end of file
+㐁㐁
 
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/get_wstr.chk
--- a/tests/lib/libcurses/check_files/get_wstr.chk      Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/get_wstr.chk      Tue Jan 25 03:23:05 2022 +0000
@@ -1,6 +1,6 @@
 
 
-   㐁                                                                           cup3;6X
+   㐁el
 a                                                                               cup4;2X
ab                                                                              cup4;3X
                                                                                cup4;1Xc                                                                               cup4;2X
cd                                                                              cup4;3X
cde                                                                             cup4;4X
cd                                                                              cup4;3X
cdf                                                                             cup4;4X
     
    a                                                                           cup5;6X
    ab                                                                          cup5;7X
    a                                                                           cup5;6X
    ac                                                                          cup5;7X
    acd                                                                         cup5;8X
    acd                                                                        cup5;9X
    acdO                                                                       cup5;10X
    acdOD                                                                      cup5;11Xsmkx
  
 a                                                                              cup6;3X
 ab                                                                             cup6;4X
 abc                                                                            cup6;5X
el 
 d                                                                              cup6;3X
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/getn_wstr.chk
--- a/tests/lib/libcurses/check_files/getn_wstr.chk     Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/getn_wstr.chk     Tue Jan 25 03:23:05 2022 +0000
@@ -1,6 +1,6 @@
 
 
-   㐁                                                                           cup3;6X
+   㐁el
 a                                                                               cup4;2X
ab                                                                              cup4;3X
                                                                                cup4;1Xc                                                                               cup4;2X
cd                                                                              cup4;3X
cde                                                                             cup4;4X
cd                                                                              cup4;3X
cdf                                                                             cup4;4X
cdf                                                                             cup4;4X
cdf                                                                             cup4;4X
cdf                                                                             cup4;4X
     
    a                                                                           cup5;6X
    ab                                                                          cup5;7X
    a                                                                           cup5;6X
    ac                                                                          cup5;7X
    acd                                                                         cup5;8X
    acd                                                                        cup5;9X
    acdO                                                                       cup5;10X
    acdOD                                                                      cup5;11Xsmkx
  
 a                                                                              cup6;3X
 ab                                                                             cup6;4X
 abc                                                                            cup6;5X
el 
 d                                                                              cup6;3X
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/ins_wch1.chk
--- a/tests/lib/libcurses/check_files/ins_wch1.chk      Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/ins_wch1.chk      Tue Jan 25 03:23:05 2022 +0000
@@ -1,1 +1,1 @@
-smulArmulsmso㐁rmsohome
\ No newline at end of file
+smulArmulsmso㐁homermso
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/ins_wch2.chk
--- a/tests/lib/libcurses/check_files/ins_wch2.chk      Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/ins_wch2.chk      Tue Jan 25 03:23:05 2022 +0000
@@ -1,1 +1,1 @@
-cup11;76XAAAAcup11;11Xsmso㐁rmsosmso㐁rmsocup11;76X    Acup11;11X
\ No newline at end of file
+cup11;76XAAAAcup11;11Xsmso㐁㐁cup11;78Xrmso  cup11;11X
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/ins_wch3.chk
--- a/tests/lib/libcurses/check_files/ins_wch3.chk      Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/ins_wch3.chk      Tue Jan 25 03:23:05 2022 +0000
@@ -1,1 +1,1 @@
-cup11;80Xelcup11;76XsmulArmul
\ No newline at end of file
+cup11;78Xelcup11;76XsmulArmul
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/mvins_wch.chk
--- a/tests/lib/libcurses/check_files/mvins_wch.chk     Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/mvins_wch.chk     Tue Jan 25 03:23:05 2022 +0000
@@ -1,1 +1,1 @@
-cup3;6XsmulArmulsmso㐁rmso
     
\ No newline at end of file
+cup3;6XsmulArmulsmso㐁
rmso
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/wget_wstr.chk
--- a/tests/lib/libcurses/check_files/wget_wstr.chk     Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/wget_wstr.chk     Tue Jan 25 03:23:05 2022 +0000
@@ -1,3 +1,3 @@
-cup5;6X   㐁 cup5;11X
+cup5;6X   㐁el
      a     cup6;7X
     ab    cup6;8X
     elc     cup6;7X
     cd    cup6;8X
     cde   cup6;9X
     cd    cup6;8X
     cdf   cup6;9X
      a     cup7;7X
     ab    cup7;8X
     a     cup7;7X
     ac    cup7;8X
     ac   cup7;9X
     acO  cup7;10X
     acOD cup7;11Xsmkxcup8;7X
      a    cup8;8X
      ab   cup8;9X
      abc  cup8;10X
     el 
      d    cup8;8X
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/wgetn_wstr.chk
--- a/tests/lib/libcurses/check_files/wgetn_wstr.chk    Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/wgetn_wstr.chk    Tue Jan 25 03:23:05 2022 +0000
@@ -1,3 +1,3 @@
-cup5;6X   㐁 cup5;11X
+cup5;6X   㐁el
      a     cup6;7X
     ab    cup6;8X
     elc     cup6;7X
     cd    cup6;8X
     cde   cup6;9X
     cd    cup6;8X
     cdf   cup6;9X
     cdf   cup6;9X
     cdf   cup6;9X
     cdf   cup6;9X
      a     cup7;7X
     ab    cup7;8X
     a     cup7;7X
     ac    cup7;8X
     ac   cup7;9X
     acO  cup7;10X
     acOD cup7;11Xsmkxcup8;7X
      a    cup8;8X
      ab   cup8;9X
      abc  cup8;10X
     el 
      d    cup8;8X
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/wins_wch1.chk
--- a/tests/lib/libcurses/check_files/wins_wch1.chk     Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/wins_wch1.chk     Tue Jan 25 03:23:05 2022 +0000
@@ -1,1 +1,1 @@
-smulArmulsmso㐁rmso
     
\ No newline at end of file
+smulArmulsmso㐁
rmso
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/wins_wch2.chk
--- a/tests/lib/libcurses/check_files/wins_wch2.chk     Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/wins_wch2.chk     Tue Jan 25 03:23:05 2022 +0000
@@ -1,1 +1,1 @@
-cup5;9XAAcup5;7Xsmso㐁rmso  Acup5;7X
\ No newline at end of file
+cup5;9XAAcup5;7Xsmso㐁rmso cup5;7X
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/wins_wch3.chk
--- a/tests/lib/libcurses/check_files/wins_wch3.chk     Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/wins_wch3.chk     Tue Jan 25 03:23:05 2022 +0000
@@ -1,1 +1,1 @@
-  elcup5;10XsmulArmul
     
\ No newline at end of file
+  elsmulArmul
     
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/check_files/wvline_set.chk
--- a/tests/lib/libcurses/check_files/wvline_set.chk    Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/check_files/wvline_set.chk    Tue Jan 25 03:23:05 2022 +0000
@@ -3,4 +3,4 @@
 㐁
 㐁
 㐁
-㐁cup4;6Xrmsocup5;8Xsmso㐁cup6;8X㐁cup7;8X㐁cup5;8Xrmsocup4;7Xsmsocup5;7Xcup6;7Xrmso
\ No newline at end of file
+㐁cup4;6Xrmsocup5;8Xsmso㐁cup6;8X㐁cup7;8X㐁cup5;8Xrmsosmso㐁cup5;8X㐁㐁cup3;11Xrmso
\ No newline at end of file
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/debug_test
--- a/tests/lib/libcurses/debug_test    Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/debug_test    Tue Jan 25 03:23:05 2022 +0000
@@ -9,6 +9,10 @@
 #
 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:"
diff -r 6c4711489415 -r 5fabf5d641c3 tests/lib/libcurses/t_curses.sh
--- a/tests/lib/libcurses/t_curses.sh   Tue Jan 25 03:05:06 2022 +0000
+++ b/tests/lib/libcurses/t_curses.sh   Tue Jan 25 03:23:05 2022 +0000
@@ -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_body()
 {
-    h_run addwstr en_US.UTF-8
+    h_run addwstr
 }
 
 atf_test_case waddstr
@@ -254,7 +251,7 @@
 }
 waddwstr_body()
 {
-    h_run waddwstr en_US.UTF-8
+    h_run waddwstr
 }
 
 atf_test_case addnstr
@@ -274,7 +271,7 @@
 }
 addnwstr_body()
 {
-    h_run addnwstr en_US.UTF-8
+    h_run addnwstr
 }
 
 atf_test_case waddnstr
@@ -294,7 +291,7 @@
 }
 waddnwstr_body()
 {
-    h_run waddnwstr en_US.UTF-8
+    h_run waddnwstr
 }
 
 atf_test_case mvwaddnwstr
@@ -304,7 +301,7 @@
 }
 mvwaddnwstr_body()
 {
-    h_run mvwaddnwstr en_US.UTF-8
+    h_run mvwaddnwstr
 }
 
 atf_test_case mvaddstr
@@ -324,7 +321,7 @@
 }
 mvaddwstr_body()
 {
-    h_run mvaddwstr en_US.UTF-8


Home | Main Index | Thread Index | Old Index