Update of /cvsroot/boost/boost/libs/system/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15673

Modified Files:
      Tag: c++0x
        error_code_test.cpp 
Log Message:
Bring into sync with Toronto proposals

Index: error_code_test.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/system/test/error_code_test.cpp,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- error_code_test.cpp 19 Jun 2007 01:51:19 -0000      1.1.2.4
+++ error_code_test.cpp 24 Jul 2007 00:51:51 -0000      1.1.2.5
@@ -10,10 +10,10 @@
 
//----------------------------------------------------------------------------//
 
 
 //  VC++ 8.0 warns on usage of certain Standard Library and API functions that
-//  can be cause buffer overruns or other possible security issues if misused.
+//  can be cause buffer overruns or no_posix_equivalent possible security 
issues if misused.
 //  See http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
 //  But the wording of the warning is misleading and unsettling, there are no
-//  portable alternative functions, and VC++ 8.0's own libraries use the
+//  portable altersystem functions, and VC++ 8.0's own libraries use the
 //  functions in question. So turn off the warnings.
 #define _CRT_SECURE_NO_DEPRECATE
 #define _SCL_SECURE_NO_DEPRECATE
@@ -48,97 +48,96 @@
 
 //  test_main  
---------------------------------------------------------------//
 
-// TODO: add message decoder tests
 // TODO: add hash_value tests
 
 int test_main( int, char ** )
 {
   error_code ec;
-  error_code ec_0_native( 0, native_category );
-  error_code ec_0_posix( 0, posix_category );
-  error_code ec_1_native( 1, native_category );
-  error_code ec_1_posix( 1, posix_category );
+  error_code ec_0_system( 0, system_category );
+  error_code ec_1_system( 1, system_category );
 
   BOOST_CHECK( !ec );
   BOOST_CHECK( ec.value() == 0 );
   BOOST_CHECK( ec.posix() == 0 );
+  BOOST_CHECK( ec.category() == system_category );
 
-  BOOST_CHECK( !ec_0_native );
-  BOOST_CHECK( ec_0_native.value() == 0 );
-  BOOST_CHECK( ec_0_native.posix() == 0 );
+  BOOST_CHECK( !ec_0_system );
+  BOOST_CHECK( ec_0_system.value() == 0 );
+  BOOST_CHECK( ec_0_system.posix() == 0 );
 
-  BOOST_CHECK( !ec_0_posix );
-  BOOST_CHECK( ec_0_posix.value() == 0 );
-  BOOST_CHECK( ec_0_posix.posix() == 0 );
-  BOOST_CHECK( ec == ec_0_posix );
-  BOOST_CHECK( ec_0_native != ec_0_posix );
+  BOOST_CHECK( ec_0_system == ec );
+  BOOST_CHECK( ec_0_system.category() == ec.category() );
 
-  BOOST_CHECK( ec_1_native );
-  BOOST_CHECK( ec_1_native.value() == 1 );
-  BOOST_CHECK( ec_1_native.value() != 0 );
-  BOOST_CHECK( ec_1_native.posix() != 0 );
-  BOOST_CHECK( ec != ec_1_native );
-  BOOST_CHECK( ec_0_native != ec_1_native );
-  BOOST_CHECK( ec_0_posix != ec_1_native );
+  //BOOST_CHECK( !ec_0_posix );
+  //BOOST_CHECK( ec_0_posix.value() == 0 );
+  //BOOST_CHECK( ec_0_posix.posix() == 0 );
+  //BOOST_CHECK( ec == ec_0_posix );
+  //BOOST_CHECK( ec_0_system != ec_0_posix );
 
-  BOOST_CHECK( ec_1_posix );
-  BOOST_CHECK( ec_1_posix.value() == 1 );
-  BOOST_CHECK( ec_1_posix.posix() == 1 );
-  BOOST_CHECK( ec_1_posix.posix() != 0 );
-  BOOST_CHECK( ec != ec_1_posix );
-  BOOST_CHECK( ec_0_native != ec_1_posix );
-  BOOST_CHECK( ec_0_posix != ec_1_posix );
+  BOOST_CHECK( ec_1_system );
+  BOOST_CHECK( ec_1_system.value() == 1 );
+  BOOST_CHECK( ec_1_system.value() != 0 );
+  //BOOST_CHECK( ec_1_system.posix() != 0 );
+  BOOST_CHECK( ec != ec_1_system );
+  BOOST_CHECK( ec_0_system != ec_1_system );
+  //BOOST_CHECK( ec_0_posix != ec_1_system );
 
-  BOOST_CHECK( ec_0_posix.category() == posix_category );
-  BOOST_CHECK( ec_0_posix.category() == ec_1_posix.category() );
-  BOOST_CHECK( ec_0_posix.category() != native_category );
-  BOOST_CHECK( ec_0_posix.category() != ec_0_native.category() );
+  //BOOST_CHECK( ec_1_posix );
+  //BOOST_CHECK( ec_1_posix.value() == 1 );
+  //BOOST_CHECK( ec_1_posix.posix() == 1 );
+  //BOOST_CHECK( ec_1_posix.posix() != 0 );
+  //BOOST_CHECK( ec != ec_1_posix );
+  //BOOST_CHECK( ec_0_system != ec_1_posix );
+  //BOOST_CHECK( ec_0_posix != ec_1_posix );
 
-  BOOST_CHECK( ec_0_posix.category().name() == "POSIX" );
-  BOOST_CHECK( ec_0_native.category().name() == "native" );
+  //BOOST_CHECK( ec_0_posix.category() == posix_category );
+  //BOOST_CHECK( ec_0_posix.category() == ec_1_posix.category() );
+  //BOOST_CHECK( ec_0_posix.category() != system_category );
+  //BOOST_CHECK( ec_0_posix.category() != ec_0_system.category() );
 
-  BOOST_CHECK( ec_0_posix.category() < ec_0_native.category() );
-  BOOST_CHECK( ec_0_posix < ec_0_native );
+  //BOOST_CHECK( ec_0_posix.category().name() == "POSIX" );
+  BOOST_CHECK( ec_0_system.category().name() == "system" );
 
-  check_ostream( ec_0_posix, "POSIX:0" );
-  check_ostream( ec_1_posix, "POSIX:1" );
-  check_ostream( ec_0_native, "native:0" );
-  check_ostream( ec_1_native, "native:1" );
+  //BOOST_CHECK( ec_0_posix.category() < ec_0_system.category() );
+  //BOOST_CHECK( ec_0_posix < ec_0_system );
 
-  error_code ec_2_posix( no_such_file_or_directory );
-  error_code ec_3_posix( no_such_file_or_directory, posix_category );
+  check_ostream( ec_0_system, "system:0" );
+  check_ostream( ec_1_system, "system:1" );
 
-  BOOST_CHECK( ec_2_posix == ec_3_posix );
-  BOOST_CHECK( ec_2_posix == no_such_file_or_directory );
-  BOOST_CHECK( no_such_file_or_directory == ec_2_posix );
+  //error_code ec_2_posix( no_such_file_or_directory );
+  //error_code ec_3_posix( no_such_file_or_directory, posix_category );
+
+  //BOOST_CHECK( ec_2_posix == ec_3_posix );
+  //BOOST_CHECK( ec_2_posix == no_such_file_or_directory );
+  //BOOST_CHECK( no_such_file_or_directory == ec_2_posix );
 
 
 #ifdef BOOST_WINDOWS_API
   // these tests probe the Windows posix decoder
   //   test the first entry in the decoder table:
-  ec = error_code( ERROR_FILE_NOT_FOUND, native_category );
+  ec = error_code( ERROR_FILE_NOT_FOUND, system_category );
   BOOST_CHECK( ec.value() == ERROR_FILE_NOT_FOUND );
   BOOST_CHECK( ec.posix() == no_such_file_or_directory );
 
   //   test the second entry in the decoder table:
-  ec = error_code( ERROR_PATH_NOT_FOUND, native_category );
+  ec = error_code( ERROR_PATH_NOT_FOUND, system_category );
   BOOST_CHECK( ec.value() == ERROR_PATH_NOT_FOUND );
   BOOST_CHECK( ec.posix() == no_such_file_or_directory );
 
   //   test the third entry in the decoder table:
-  ec = error_code( ERROR_ACCESS_DENIED, native_category );
+  ec = error_code( ERROR_ACCESS_DENIED, system_category );
   BOOST_CHECK( ec.value() == ERROR_ACCESS_DENIED );
   BOOST_CHECK( ec.posix() == permission_denied );
 
   //   test the last regular entry in the decoder table:
-  ec = error_code( ERROR_WRITE_PROTECT, native_category );
+  ec = error_code( ERROR_WRITE_PROTECT, system_category );
   BOOST_CHECK( ec.value() == ERROR_WRITE_PROTECT );
   BOOST_CHECK( ec.posix() == permission_denied );
 
   //   test not-in-table condition:
-  ec = error_code( 1234567890, native_category );
+  ec = error_code( 1234567890, system_category );
   BOOST_CHECK( ec.value() == 1234567890 );
-  BOOST_CHECK( ec.posix() == other );
+  BOOST_CHECK( ec.posix() == no_posix_equivalent );
 
 #else
   // TODO: write some POSIX tests


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to