[Lsb-messages] /var/www/bzr/lsb/devel/olver-core-tests r103: fix for olver term tests (bug 3788)

Mats Wichmann mats at linuxfoundation.org
Sat Feb 15 13:43:45 UTC 2014


------------------------------------------------------------
revno: 103 [merge]
committer: Mats Wichmann <mats at linuxfoundation.org>
branch nick: olver-core-tests
timestamp: Sat 2014-02-15 06:43:45 -0700
message:
  fix for olver term tests (bug 3788)
modified:
  package/Makefile
  src/model/io/term/tests/pt_scenario.sec
  src/model/io/term/tests/rw_canon_scenario.sec
  src/model/io/term/tests/rw_case_a_scenario.sec
  src/model/io/term/tests/rw_case_b_scenario.sec
  src/model/io/term/tests/rw_case_c_scenario.sec
  src/model/io/term/tests/rw_case_d_scenario.sec
  src/model/io/term/tests/tc_scenario.sec
  src/model/io/term/tests/tcpgrp_scenario.sec
  src/model/io/term/tests/tty_scenario.sec
-------------- next part --------------
=== modified file 'package/Makefile'
--- a/package/Makefile	2013-07-10 14:41:38 +0000
+++ b/package/Makefile	2014-02-15 13:43:45 +0000
@@ -1,5 +1,5 @@
 PACKAGE=lsb-test-olver-core
-VERSION=4.1.81
+VERSION=4.1.82
 RELEASE=1
 
 # for pkgchk

=== modified file 'src/model/io/term/tests/pt_scenario.sec'
--- a/src/model/io/term/tests/pt_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/pt_scenario.sec	2013-12-15 18:47:22 +0000
@@ -142,8 +142,8 @@
 
     for(i = 0; i < PT_NUMBER; i++)
     {
-        if(pre_openpty_spec(context, &amaster, &aslave, name, termp, winp, error))
-            openpty_spec(context, &amaster, &aslave, name, termp, winp, error);
+        if(pre_openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error))
+            openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error);
 
         if(pre_ttyio_TIOCGWINSZ_spec(context, aslave, winp, error))
             ttyio_TIOCGWINSZ_spec(context, aslave, winp, error);

=== modified file 'src/model/io/term/tests/rw_canon_scenario.sec'
--- a/src/model/io/term/tests/rw_canon_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/rw_canon_scenario.sec	2013-12-15 18:52:07 +0000
@@ -51,6 +51,42 @@
     /* 14 */ "Linux\r\n"
 };
 
+/*
+ * Depending on  igncr, icrnl, inlcr flags different number of "read" operations 
+ * is needed to read line+EOF symbol 
+ * Default for olver is igncr=0, icrnl=0, inlcr=0 and it needs one read.
+ 
+ * TODO need to add an iteration through all combinations of values of ingcr, ictrnl, inlcr.
+ * to do it these tables will help
+
+ * igncr, icrnl, inlcr    type
+ *   0      0      0     -  3  <--Default
+ *   0      0      1     -  3 
+ *   0      1      0     -  2 
+ *   0      1      1     -  0 
+ *   1      0      0     -  1 
+ *   1      0      1     -  3
+ *   1      1      0     -  1
+ *   1      1      1     -  3
+
+               type:  __0__|__1__|__2__|__3__
+ *   0  "",             1,    1,    1,    1,    
+ *   1  " ",            1,    1,    1,    1,    
+ *   2  "\n",           1,    2,    2,    1,    
+ *   3  "\r",           2,    1,    2,    1,    
+ *   4  "\t",           1,    1,    1,    1,    
+ *   5  "\v",           1,    1,    1,    1,    
+ *   6  "\f",           1,    1,    1,    1,    
+ *   7  "\a",           1,    1,    1,    1,    
+ *   8  "\b",           1,    1,    1,    1,    
+ *   9  "\r\n",         2,    2,    3,    1,    
+ *  10  "\r\r",         3,    1,    3,    1,    
+ *  11  "\n\n",         1,    3,    3,    1,    
+ *  12  "Linux",        1,    1,    1,    1,    
+ *  13  "Linux\n",      1,    2,    2,    1,    
+ *  14  "Linux\r\n"     2,    2,    3,    1,    
+ *
+ */
 static int LINE_NUMBER = sizeof(line)/sizeof(char*);
 
 /********************************************************************/
@@ -169,10 +205,16 @@
 {
     if(isWrong_FileDescId(ptm_desc_id))
     {
-        openpty_spec(context1, &ptm_desc_id, &pts_desc_id, NULL, ptm_termp, NULL, error);
+        openpty_spec(context1, &ptm_desc_id, &pts_desc_id, NULL, NULL_VoidTPtr, NULL, error);
 
         tcgetattr_spec(context1, ptm_desc_id, ptm_termp, error);
         tcgetattr_spec(context1, pts_desc_id, pts_termp, error);
+        settermios_spec(context1, pts_termp, default_TermIOS());
+        settermios_spec(context1, ptm_termp, default_TermIOS());
+        tcsetattr_spec(context1, ptm_desc_id, SUT_TCSANOW,ptm_termp);
+        tcsetattr_spec(context1, pts_desc_id, SUT_TCSANOW,pts_termp);
+        tcgetattr_spec(context1, ptm_desc_id, ptm_termp, error);
+        tcgetattr_spec(context1, pts_desc_id, pts_termp, error);
     }
 
     return true;

=== modified file 'src/model/io/term/tests/rw_case_a_scenario.sec'
--- a/src/model/io/term/tests/rw_case_a_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/rw_case_a_scenario.sec	2013-12-15 18:47:22 +0000
@@ -221,8 +221,14 @@
 {
     if(isWrong_FileDescId(ptm_desc_id))
     {
-        openpty_spec(read_context, &ptm_desc_id, &pts_desc_id, NULL, pts_termp, NULL, error);
+        openpty_spec(read_context, &ptm_desc_id, &pts_desc_id, NULL, NULL_VoidTPtr, NULL, error);
 
+        tcgetattr_spec(read_context, ptm_desc_id, ptm_termp, error);
+        tcgetattr_spec(read_context, pts_desc_id, pts_termp, error);
+        settermios_spec(read_context, pts_termp, default_TermIOS());
+        settermios_spec(read_context, ptm_termp, default_TermIOS());
+        tcsetattr_spec(read_context, ptm_desc_id, SUT_TCSANOW,ptm_termp);
+        tcsetattr_spec(read_context, pts_desc_id, SUT_TCSANOW,pts_termp);
         tcgetattr_spec(read_context, ptm_desc_id, ptm_termp, error);
         tcgetattr_spec(read_context, pts_desc_id, pts_termp, error);
 

=== modified file 'src/model/io/term/tests/rw_case_b_scenario.sec'
--- a/src/model/io/term/tests/rw_case_b_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/rw_case_b_scenario.sec	2013-12-15 18:47:22 +0000
@@ -242,8 +242,14 @@
 {
     if(isWrong_FileDescId(ptm_desc_id))
     {
-        openpty_spec(read_context, &ptm_desc_id, &pts_desc_id, NULL, pts_termp, NULL, error);
+        openpty_spec(read_context, &ptm_desc_id, &pts_desc_id, NULL, NULL_VoidTPtr, NULL, error);
 
+        tcgetattr_spec(read_context, ptm_desc_id, ptm_termp, error);
+        tcgetattr_spec(read_context, pts_desc_id, pts_termp, error);
+        settermios_spec(read_context, pts_termp, default_TermIOS());
+        settermios_spec(read_context, ptm_termp, default_TermIOS());
+        tcsetattr_spec(read_context, ptm_desc_id, SUT_TCSANOW,ptm_termp);
+        tcsetattr_spec(read_context, pts_desc_id, SUT_TCSANOW,pts_termp);
         tcgetattr_spec(read_context, ptm_desc_id, ptm_termp, error);
         tcgetattr_spec(read_context, pts_desc_id, pts_termp, error);
 

=== modified file 'src/model/io/term/tests/rw_case_c_scenario.sec'
--- a/src/model/io/term/tests/rw_case_c_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/rw_case_c_scenario.sec	2013-12-15 18:47:22 +0000
@@ -227,8 +227,14 @@
 {
     if(isWrong_FileDescId(ptm_desc_id))
     {
-        openpty_spec(read_context, &ptm_desc_id, &pts_desc_id, NULL, pts_termp, NULL, error);
+        openpty_spec(read_context, &ptm_desc_id, &pts_desc_id, NULL, NULL_VoidTPtr, NULL, error);
 
+        tcgetattr_spec(read_context, ptm_desc_id, ptm_termp, error);
+        tcgetattr_spec(read_context, pts_desc_id, pts_termp, error);
+        settermios_spec(read_context, pts_termp, default_TermIOS());
+        settermios_spec(read_context, ptm_termp, default_TermIOS());
+        tcsetattr_spec(read_context, ptm_desc_id, SUT_TCSANOW,ptm_termp);
+        tcsetattr_spec(read_context, pts_desc_id, SUT_TCSANOW,pts_termp);
         tcgetattr_spec(read_context, ptm_desc_id, ptm_termp, error);
         tcgetattr_spec(read_context, pts_desc_id, pts_termp, error);
 

=== modified file 'src/model/io/term/tests/rw_case_d_scenario.sec'
--- a/src/model/io/term/tests/rw_case_d_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/rw_case_d_scenario.sec	2013-12-15 18:47:22 +0000
@@ -124,10 +124,17 @@
 {
     if(isWrong_FileDescId(ptm_desc_id))
     {
-        openpty_spec(context, &ptm_desc_id, &pts_desc_id, NULL, ptm_termp, NULL, error);
-
-        tcgetattr_spec(context, ptm_desc_id, ptm_termp, error);
-        tcgetattr_spec(context, pts_desc_id, pts_termp, error);
+        openpty_spec(context, &ptm_desc_id, &pts_desc_id, NULL, NULL_VoidTPtr, NULL, error);
+
+        tcgetattr_spec(context, ptm_desc_id, ptm_termp, error);
+        tcgetattr_spec(context, pts_desc_id, pts_termp, error);
+        settermios_spec(context, pts_termp, default_TermIOS());
+        settermios_spec(context, ptm_termp, default_TermIOS());
+        tcsetattr_spec(context, ptm_desc_id, SUT_TCSANOW,ptm_termp);
+        tcsetattr_spec(context, pts_desc_id, SUT_TCSANOW,pts_termp);
+        tcgetattr_spec(context, ptm_desc_id, ptm_termp, error);
+        tcgetattr_spec(context, pts_desc_id, pts_termp, error);
+
     }
 
     return true;

=== modified file 'src/model/io/term/tests/tc_scenario.sec'
--- a/src/model/io/term/tests/tc_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/tc_scenario.sec	2013-12-15 18:47:22 +0000
@@ -141,7 +141,7 @@
 {
     if(isWrong_FileDescId(aslave))
     {
-        openpty_spec(context, &amaster, &aslave, name, pts_termp, winp, error);
+        openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error);
         tcgetattr_spec(context, amaster, ptm_termp, error);
         tcgetattr_spec(context, aslave, pts_termp, error);
     }
@@ -156,7 +156,7 @@
 {
     if(isWrong_FileDescId(aslave))
     {
-        openpty_spec(context, &amaster, &aslave, name, pts_termp, winp, error);
+        openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error);
         tcgetattr_spec(context, amaster, ptm_termp, error);
         tcgetattr_spec(context, aslave, pts_termp, error);
     }
@@ -178,7 +178,7 @@
 {
     if(isWrong_FileDescId(aslave))
     {
-        openpty_spec(context, &amaster, &aslave, name, pts_termp, winp, error);
+        openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error);
         tcgetattr_spec(context, amaster, ptm_termp, error);
         tcgetattr_spec(context, aslave, pts_termp, error);
     }
@@ -196,7 +196,7 @@
 {
     if(isWrong_FileDescId(aslave))
     {
-        openpty_spec(context, &amaster, &aslave, name, pts_termp, winp, error);
+        openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error);
         tcgetattr_spec(context, amaster, ptm_termp, error);
         tcgetattr_spec(context, aslave, pts_termp, error);
     }
@@ -211,7 +211,7 @@
 {
     if(isWrong_FileDescId(aslave))
     {
-        openpty_spec(context, &amaster, &aslave, name, pts_termp, winp, error);
+        openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error);
         tcgetattr_spec(context, amaster, ptm_termp, error);
         tcgetattr_spec(context, aslave, pts_termp, error);
     }
@@ -233,7 +233,7 @@
 {
     if(isWrong_FileDescId(aslave))
     {
-        openpty_spec(context, &amaster, &aslave, name, pts_termp, winp, error);
+        openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error);
         tcgetattr_spec(context, amaster, ptm_termp, error);
         tcgetattr_spec(context, aslave, pts_termp, error);
     }

=== modified file 'src/model/io/term/tests/tcpgrp_scenario.sec'
--- a/src/model/io/term/tests/tcpgrp_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/tcpgrp_scenario.sec	2013-12-15 18:47:22 +0000
@@ -101,7 +101,7 @@
     CString *name = create_CString("");
     WinSize *winp = default_WinSize();
 
-    openpty_spec(context, &amaster, &aslave, name, termp, winp, error);
+    openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, error);
     tcgetattr_spec(context, aslave, termp, error);
     tcgetpgrp_spec(context, aslave, error);
     tcgetsid_spec(context, aslave, error);

=== modified file 'src/model/io/term/tests/tty_scenario.sec'
--- a/src/model/io/term/tests/tty_scenario.sec	2009-08-25 16:37:01 +0000
+++ b/src/model/io/term/tests/tty_scenario.sec	2013-12-15 18:47:22 +0000
@@ -161,8 +161,8 @@
     CString *name = create_CString("");
     WinSize *winp = default_WinSize();
 
-    if(pre_openpty_spec(context, &amaster, &aslave, name, termp, winp, requestErrorCode()))
-        openpty_spec(context, &amaster, &aslave, name, termp, winp, requestErrorCode());
+    if(pre_openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, requestErrorCode()))
+        openpty_spec(context, &amaster, &aslave, name, NULL_VoidTPtr, winp, requestErrorCode());
 
     if(pre_isatty_spec(context, amaster, requestErrorCode()))
         isatty_spec(context, amaster, requestErrorCode());



More information about the lsb-messages mailing list