changeset 18373:ba7c2fe347c8

maint: port tests to z/OS errno behavior * tests/test-nonblocking-reader.h: * tests/test-nonblocking-writer.h: Accommodate z/OS errno code preferences. (I believe this should still be within spec; IBM is good at following the letter if not the spirit of such things.)
author Daniel Richard G <skunk@iSKUNK.ORG>
date Wed, 17 Aug 2016 16:57:35 -0700
parents d9961cf477d9
children 57ef9394aa74
files ChangeLog tests/test-nonblocking-reader.h tests/test-nonblocking-writer.h
diffstat 3 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Aug 17 16:55:13 2016 -0700
+++ b/ChangeLog	Wed Aug 17 16:57:35 2016 -0700
@@ -1,5 +1,12 @@
 2016-08-17  Daniel Richard G.  <skunk@iSKUNK.ORG>
 
+	maint: port tests to z/OS errno behavior
+	* tests/test-nonblocking-reader.h:
+	* tests/test-nonblocking-writer.h:
+	Accommodate z/OS errno code preferences. (I believe this should
+	still be within spec; IBM is good at following the letter if not
+	the spirit of such things.)
+
 	maint: preprocessor changes to support z/OS
 	* lib/alloca.in.h, lib/fnmatch.c, lib/get-rusage-as.c:
 	* lib/glob.c, lib/math.in.h, lib/ptsname_r.c:
--- a/tests/test-nonblocking-reader.h	Wed Aug 17 16:55:13 2016 -0700
+++ b/tests/test-nonblocking-reader.h	Wed Aug 17 16:57:35 2016 -0700
@@ -110,7 +110,7 @@
       ASSERT (spent_time < 0.5);
       if (ret < 0)
         {
-          ASSERT (saved_errno == EAGAIN);
+          ASSERT (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK);
           usleep (SMALL_DELAY);
         }
       else
--- a/tests/test-nonblocking-writer.h	Wed Aug 17 16:55:13 2016 -0700
+++ b/tests/test-nonblocking-writer.h	Wed Aug 17 16:57:35 2016 -0700
@@ -124,7 +124,7 @@
                         (long) ret, dbgstrerror (ret < 0, saved_errno));
             if (ret < 0 && bytes_written >= data_block_size)
               {
-                ASSERT (saved_errno == EAGAIN);
+                ASSERT (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK);
                 ASSERT (spent_time < 0.5);
                 break;
               }
@@ -133,7 +133,7 @@
             ASSERT (spent_time < 0.5);
             if (ret < 0)
               {
-                ASSERT (saved_errno == EAGAIN);
+                ASSERT (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK);
                 usleep (SMALL_DELAY);
               }
             else
@@ -165,7 +165,7 @@
             ASSERT (spent_time < 0.5);
             if (ret < 0)
               {
-                ASSERT (saved_errno == EAGAIN);
+                ASSERT (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK);
                 usleep (SMALL_DELAY);
               }
             else