|
Boost-Commit : |
From: bdawes_at_[hidden]
Date: 2007-11-05 21:29:50
Author: bemandawes
Date: 2007-11-05 21:29:50 EST (Mon, 05 Nov 2007)
New Revision: 40824
URL: http://svn.boost.org/trac/boost/changeset/40824
Log:
Make message test conditional for Windows, Linux, HP-UX, OSF, and VMS (Boris Gubenko)
Text files modified:
trunk/libs/system/test/error_code_test.cpp | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
Modified: trunk/libs/system/test/error_code_test.cpp
==============================================================================
--- trunk/libs/system/test/error_code_test.cpp (original)
+++ trunk/libs/system/test/error_code_test.cpp 2007-11-05 21:29:50 EST (Mon, 05 Nov 2007)
@@ -20,6 +20,9 @@
#include <boost/test/minimal.hpp>
#include <boost/system/error_code.hpp>
+#include <boost/system/cygwin_error.hpp>
+#include <boost/system/linux_error.hpp>
+#include <boost/system/windows_error.hpp>
#include <iostream>
#include <sstream>
#include <string>
@@ -144,17 +147,40 @@
BOOST_CHECK( system_category == native_ecat );
BOOST_CHECK( posix_category == errno_ecat );
- // test error_code and error_condition message(),
+ // test error_code and error_condition message();
// see Boost.Filesystem operations_test for code specific message() tests
ec = error_code( -1, system_category );
std::cout << "error_code message for -1 is \"" << ec.message() << "\"\n";
- BOOST_CHECK( ec.message().substr( 0, 13) == "Unknown error" );
+#if defined(BOOST_WINDOWS_API)
+ BOOST_CHECK( ec.message() == "Unknown error" );
+#elif defined(linux) || defined(__linux) || defined(__linux__)
+ BOOST_CHECK( ec.message() == "Unknown error 4294967295" );
+#elif defined(__hpux)
+ BOOST_CHECK( ec.message() == "" );
+#elif defined(__osf__)
+ BOOST_CHECK( ec.message() == "Error -1 occurred." );
+#elif defined(__vms)
+ BOOST_CHECK( ec.message() == "error -1" );
+#endif
+
ec = error_code( BOOST_ACCESS_ERROR_MACRO, system_category );
BOOST_CHECK( ec.message() != "" );
BOOST_CHECK( ec.message().substr( 0, 13) != "Unknown error" );
+
dec = error_condition( -1, posix_category );
std::cout << "error_condition message for -1 is \"" << dec.message() << "\"\n";
- BOOST_CHECK( dec.message().substr( 0, 13) == "Unknown error" );
+#if defined(BOOST_WINDOWS_API)
+ BOOST_CHECK( dec.message() == "Unknown error" );
+#elif defined(linux) || defined(__linux) || defined(__linux__)
+ BOOST_CHECK( dec.message() == "Unknown error 4294967295" );
+#elif defined(__hpux)
+ BOOST_CHECK( dec.message() == "" );
+#elif defined(__osf__)
+ BOOST_CHECK( dec.message() == "Error -1 occurred." );
+#elif defined(__vms)
+ BOOST_CHECK( dec.message() == "error -1" );
+#endif
+
dec = error_condition( BOOST_ACCESS_ERROR_MACRO, posix_category );
BOOST_CHECK( dec.message() != "" );
BOOST_CHECK( dec.message().substr( 0, 13) != "Unknown error" );
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk