From 0a283a8f0002316bde12c9164e8397feb0529e3c Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 13 Sep 2007 21:47:25 +0000 Subject: [PATCH] Ensure error_category::operator< test works regardless of how compiler lays out memory. [SVN r39248] --- test/error_code_test.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/error_code_test.cpp b/test/error_code_test.cpp index b020ef0..0206ea1 100644 --- a/test/error_code_test.cpp +++ b/test/error_code_test.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include // Although using directives are not the best programming practice, testing @@ -66,8 +67,18 @@ int test_main( int, char ** ) BOOST_CHECK( system_category == system_category ); BOOST_CHECK( posix_category != system_category ); BOOST_CHECK( system_category != posix_category ); - BOOST_CHECK( posix_category < system_category ); - BOOST_CHECK( !(system_category < posix_category) ); + + if ( std::less()( &posix_category, &system_category ) ) + { + BOOST_CHECK( posix_category < system_category ); + BOOST_CHECK( !(system_category < posix_category) ); + } + else + { + BOOST_CHECK( system_category < posix_category ); + BOOST_CHECK( !(posix_category < system_category) ); + } + error_code ec; error_condition dec;