nanosleep: simplify carrying
[pspp] / tests / test-strerror.c
index 46d339e64c1cf3066652f338a51e2ae08f9ae720..3ffb12e8f614304038478250f3f0e84cea7318b7 100644 (file)
@@ -51,16 +51,17 @@ main (void)
   ASSERT (*str);
   ASSERT (errno == 0);
 
-  /* POSIX requires strerror (0) to succeed; use of "Unknown error" or
-     "error 0" does not count as success, but "No error" works.
+  /* POSIX requires strerror (0) to succeed.  Reject use of "Unknown
+     error", but allow "Success", "No error", or even Solaris' "Error
+     0" which are distinct patterns from true out-of-range strings.
      http://austingroupbugs.net/view.php?id=382  */
   errno = 0;
   str = strerror (0);
   ASSERT (str);
   ASSERT (*str);
   ASSERT (errno == 0);
-  ASSERT (strchr (str, '0') == NULL);
   ASSERT (strstr (str, "nknown") == NULL);
+  ASSERT (strstr (str, "ndefined") == NULL);
 
   /* POSIX requires strerror to produce a non-NULL result for all
      inputs; as an extension, we also guarantee a non-empty reseult.