stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r677764 - /stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp
Date Thu, 17 Jul 2008 22:31:30 GMT
Author: sebor
Date: Thu Jul 17 15:31:29 2008
New Revision: 677764

URL: http://svn.apache.org/viewvc?rev=677764&view=rev
Log:
2008-07-17  Martin Sebor  <sebor@roguewave.com>

	* tests/regress/18.c.limits.stdcxx-988.cpp (main): Avoided testing
	macros for specific values to prevent failures on non-conforming
	systems.

Modified:
    stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp

Modified: stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp?rev=677764&r1=677763&r2=677764&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp (original)
+++ stdcxx/branches/4.2.x/tests/regress/18.c.limits.stdcxx-988.cpp Thu Jul 17 15:31:29 2008
@@ -29,6 +29,7 @@
 #include <cassert>
 #include <limits.h>
 
+
 int main ()
 {
 #if    (defined __unix__ || defined __unix || defined unix) \
@@ -73,37 +74,41 @@
     // shall provide values at least this large. A strictly conforming
     // application must not require a larger value for correct operation.
 
-    assert (_POSIX_ARG_MAX        ==  4096);
-    assert (_POSIX_CHILD_MAX      ==    25);
-    assert (_POSIX_HOST_NAME_MAX  ==   255);
-    assert (_POSIX_LINK_MAX       ==     8);
-    assert (_POSIX_LOGIN_NAME_MAX ==     9);
-    assert (_POSIX_MAX_CANON      ==   255);
-    assert (_POSIX_MAX_INPUT      ==   255);
-    assert (_POSIX_NAME_MAX       ==    14);
-    assert (_POSIX_NGROUPS_MAX    ==     8);
-    assert (_POSIX_OPEN_MAX       ==    20);
-    assert (_POSIX_PATH_MAX       ==   256);
-    assert (_POSIX_PIPE_BUF       ==   512);
-    assert (_POSIX_RE_DUP_MAX     ==   255);
-    assert (_POSIX_SSIZE_MAX      == 32767);
-    assert (_POSIX_STREAM_MAX     ==     8);
-    assert (_POSIX_SYMLINK_MAX    ==   255);
-    assert (_POSIX_SYMLOOP_MAX    ==     8);
-    assert (_POSIX_TTY_NAME_MAX   ==     9);
-    assert (_POSIX_TZNAME_MAX     ==     6);
+    // avoid testing specific values since they're not important here
+    // all we care is that the macros be defined (i.e., that thet are
+    // not somehow hidden or #undef'd by our implementation)
+
+    assert (_POSIX_ARG_MAX        != 0 /* ==  4096 */);
+    assert (_POSIX_CHILD_MAX      != 0 /* ==    25 */);
+    assert (_POSIX_HOST_NAME_MAX  != 0 /* ==   255 */);
+    assert (_POSIX_LINK_MAX       != 0 /* ==     8 */);
+    assert (_POSIX_LOGIN_NAME_MAX != 0 /* ==     9 */);
+    assert (_POSIX_MAX_CANON      != 0 /* ==   255 */);
+    assert (_POSIX_MAX_INPUT      != 0 /* ==   255 */);
+    assert (_POSIX_NAME_MAX       != 0 /* ==    14 */);
+    assert (_POSIX_NGROUPS_MAX    != 0 /* ==     8 */);
+    assert (_POSIX_OPEN_MAX       != 0 /* ==    20 */);
+    assert (_POSIX_PATH_MAX       != 0 /* ==   256 */);
+    assert (_POSIX_PIPE_BUF       != 0 /* ==   512 */);
+    assert (_POSIX_RE_DUP_MAX     != 0 /* ==   255 */);
+    assert (_POSIX_SSIZE_MAX      != 0 /* == 32767 */);
+    assert (_POSIX_STREAM_MAX     != 0 /* ==     8 */);
+    assert (_POSIX_SYMLINK_MAX    != 0 /* ==   255 */);
+    assert (_POSIX_SYMLOOP_MAX    != 0 /* ==     8 */);
+    assert (_POSIX_TTY_NAME_MAX   != 0 /* ==     9 */);
+    assert (_POSIX_TZNAME_MAX     != 0 /* ==     6 */);
 
 #  ifdef _POSIX2_VERSION
 
-    assert (_POSIX2_BC_BASE_MAX        ==   99);
-    assert (_POSIX2_BC_DIM_MAX         == 2048);
-    assert (_POSIX2_BC_SCALE_MAX       ==   99);
-    assert (_POSIX2_BC_STRING_MAX      == 1000);
-    assert (_POSIX2_CHARCLASS_NAME_MAX ==   14);
-    assert (_POSIX2_COLL_WEIGHTS_MAX   ==    2);
-    assert (_POSIX2_EXPR_NEST_MAX      ==   32);
-    assert (_POSIX2_LINE_MAX           == 2048);
-    assert (_POSIX2_RE_DUP_MAX         ==  255);
+    assert (_POSIX2_BC_BASE_MAX        != 0 /* ==   99 */);
+    assert (_POSIX2_BC_DIM_MAX         != 0 /* == 2048 */);
+    assert (_POSIX2_BC_SCALE_MAX       != 0 /* ==   99 */);
+    assert (_POSIX2_BC_STRING_MAX      != 0 /* == 1000 */);
+    assert (_POSIX2_CHARCLASS_NAME_MAX != 0 /* ==   14 */);
+    assert (_POSIX2_COLL_WEIGHTS_MAX   != 0 /* ==    2 */);
+    assert (_POSIX2_EXPR_NEST_MAX      != 0 /* ==   32 */);
+    assert (_POSIX2_LINE_MAX           != 0 /* == 2048 */);
+    assert (_POSIX2_RE_DUP_MAX         != 0 /* ==  255 */);
 
 #  endif   // _POSIX2_VERSION
 



Mime
View raw message