Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82187 - trunk/libs/conversion/test
From: antoshkka_at_[hidden]
Date: 2012-12-23 10:16:01


Author: apolukhin
Date: 2012-12-23 10:16:01 EST (Sun, 23 Dec 2012)
New Revision: 82187
URL: http://svn.boost.org/trac/boost/changeset/82187

Log:
Fix bug in array conversion test (refs #7799)
Text files modified:
   trunk/libs/conversion/test/lexical_cast_arrays_test.cpp | 60 ++++++++++++++++++++--------------------
   1 files changed, 30 insertions(+), 30 deletions(-)

Modified: trunk/libs/conversion/test/lexical_cast_arrays_test.cpp
==============================================================================
--- trunk/libs/conversion/test/lexical_cast_arrays_test.cpp (original)
+++ trunk/libs/conversion/test/lexical_cast_arrays_test.cpp 2012-12-23 10:16:01 EST (Sun, 23 Dec 2012)
@@ -50,25 +50,25 @@
 
     {
         arr_type res1 = lexical_cast<arr_type>(val);
- BOOST_CHECK_EQUAL(res1.begin(), ethalon);
+ BOOST_CHECK_EQUAL(&res1[0], ethalon);
         const arr_type res2 = lexical_cast<arr_type>(val);
- BOOST_CHECK_EQUAL(res2.begin(), ethalon);
+ BOOST_CHECK_EQUAL(&res2[0], ethalon);
         BOOST_CHECK_THROW(lexical_cast<short_arr_type>(val), boost::bad_lexical_cast);
     }
     
     {
         uarr_type res1 = lexical_cast<uarr_type>(val);
- BOOST_CHECK_EQUAL(reinterpret_cast<char*>(res1.begin()), ethalon);
+ BOOST_CHECK_EQUAL(reinterpret_cast<char*>(&res1[0]), ethalon);
         const uarr_type res2 = lexical_cast<uarr_type>(val);
- BOOST_CHECK_EQUAL(reinterpret_cast<const char*>(res2.begin()), ethalon);
+ BOOST_CHECK_EQUAL(reinterpret_cast<const char*>(&res2[0]), ethalon);
         BOOST_CHECK_THROW(lexical_cast<ushort_arr_type>(val), boost::bad_lexical_cast);
     }
     
     {
         sarr_type res1 = lexical_cast<sarr_type>(val);
- BOOST_CHECK_EQUAL(reinterpret_cast<char*>(res1.begin()), ethalon);
+ BOOST_CHECK_EQUAL(reinterpret_cast<char*>(&res1[0]), ethalon);
         const sarr_type res2 = lexical_cast<sarr_type>(val);
- BOOST_CHECK_EQUAL(reinterpret_cast<const char*>(res2.begin()), ethalon);
+ BOOST_CHECK_EQUAL(reinterpret_cast<const char*>(&res2[0]), ethalon);
         BOOST_CHECK_THROW(lexical_cast<sshort_arr_type>(val), boost::bad_lexical_cast);
     }
 
@@ -79,12 +79,12 @@
 
     {
         warr_type res = lexical_cast<warr_type>(val);
- BOOST_CHECK(res.begin() == wethalon);
+ BOOST_CHECK(&res[0] == wethalon);
     }
 
     {
         const warr_type res = lexical_cast<warr_type>(val);
- BOOST_CHECK(res.begin() == wethalon);
+ BOOST_CHECK(&res[0] == wethalon);
     }
     
     BOOST_CHECK_THROW(lexical_cast<wshort_arr_type>(val), boost::bad_lexical_cast);
@@ -98,12 +98,12 @@
 
     {
         u16arr_type res = lexical_cast<u16arr_type>(val);
- BOOST_CHECK(res.begin() == u16ethalon);
+ BOOST_CHECK(&res[0] == u16ethalon);
     }
 
     {
         const u16arr_type res = lexical_cast<u16arr_type>(val);
- BOOST_CHECK(res.begin() == u16ethalon);
+ BOOST_CHECK(&res[0] == u16ethalon);
     }
     
     BOOST_CHECK_THROW(lexical_cast<u16short_arr_type>(val), boost::bad_lexical_cast);
@@ -116,12 +116,12 @@
 
     {
         u32arr_type res = lexical_cast<u32arr_type>(val);
- BOOST_CHECK(res.begin() == u32ethalon);
+ BOOST_CHECK(&res[0] == u32ethalon);
     }
 
     {
         const u32arr_type res = lexical_cast<u32arr_type>(val);
- BOOST_CHECK(res.begin() == u32ethalon);
+ BOOST_CHECK(&res[0] == u32ethalon);
     }
     
     BOOST_CHECK_THROW(lexical_cast<u32short_arr_type>(val), boost::bad_lexical_cast);
@@ -145,25 +145,25 @@
 
     {
         arr_type res1 = lexical_cast<arr_type>(val);
- BOOST_CHECK_EQUAL(res1.begin(), ethalon);
+ BOOST_CHECK_EQUAL(&res1[0], ethalon);
         const arr_type res2 = lexical_cast<arr_type>(val);
- BOOST_CHECK_EQUAL(res2.begin(), ethalon);
+ BOOST_CHECK_EQUAL(&res2[0], ethalon);
         BOOST_CHECK_THROW(lexical_cast<short_arr_type>(val), boost::bad_lexical_cast);
     }
     
     {
         uarr_type res1 = lexical_cast<uarr_type>(val);
- BOOST_CHECK_EQUAL(reinterpret_cast<char*>(res1.begin()), ethalon);
+ BOOST_CHECK_EQUAL(reinterpret_cast<char*>(&res1[0]), ethalon);
         const uarr_type res2 = lexical_cast<uarr_type>(val);
- BOOST_CHECK_EQUAL(reinterpret_cast<const char*>(res2.begin()), ethalon);
+ BOOST_CHECK_EQUAL(reinterpret_cast<const char*>(&res2[0]), ethalon);
         BOOST_CHECK_THROW(lexical_cast<ushort_arr_type>(val), boost::bad_lexical_cast);
     }
     
     {
         sarr_type res1 = lexical_cast<sarr_type>(val);
- BOOST_CHECK_EQUAL(reinterpret_cast<char*>(res1.begin()), ethalon);
+ BOOST_CHECK_EQUAL(reinterpret_cast<char*>(&res1[0]), ethalon);
         const sarr_type res2 = lexical_cast<sarr_type>(val);
- BOOST_CHECK_EQUAL(reinterpret_cast<const char*>(res2.begin()), ethalon);
+ BOOST_CHECK_EQUAL(reinterpret_cast<const char*>(&res2[0]), ethalon);
         BOOST_CHECK_THROW(lexical_cast<sshort_arr_type>(val), boost::bad_lexical_cast);
     }
 
@@ -174,16 +174,16 @@
 
     {
         warr_type res = lexical_cast<warr_type>(val);
- BOOST_CHECK(res.begin() == wethalon);
+ BOOST_CHECK(&res[0] == wethalon);
         warr_type res3 = lexical_cast<warr_type>(wethalon);
- BOOST_CHECK(res3.begin() == wethalon);
+ BOOST_CHECK(&res3[0] == wethalon);
     }
 
     {
         const warr_type res = lexical_cast<warr_type>(val);
- BOOST_CHECK(res.begin() == wethalon);
+ BOOST_CHECK(&res[0] == wethalon);
         const warr_type res3 = lexical_cast<warr_type>(wethalon);
- BOOST_CHECK(res3.begin() == wethalon);
+ BOOST_CHECK(&res3[0] == wethalon);
     }
     
     BOOST_CHECK_THROW(lexical_cast<wshort_arr_type>(val), boost::bad_lexical_cast);
@@ -198,20 +198,20 @@
     {
 #ifdef BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES
         u16arr_type res = lexical_cast<u16arr_type>(val);
- BOOST_CHECK(res.begin() == u16ethalon);
+ BOOST_CHECK(&res[0] == u16ethalon);
 #endif
 
         u16arr_type res3 = lexical_cast<u16arr_type>(u16ethalon);
- BOOST_CHECK(res3.begin() == u16ethalon);
+ BOOST_CHECK(&res3[0] == u16ethalon);
     }
 
     {
 #ifdef BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES
         const u16arr_type res = lexical_cast<u16arr_type>(val);
- BOOST_CHECK(res.begin() == u16ethalon);
+ BOOST_CHECK(&res[0] == u16ethalon);
 #endif
         const u16arr_type res3 = lexical_cast<u16arr_type>(u16ethalon);
- BOOST_CHECK(res3.begin() == u16ethalon);
+ BOOST_CHECK(&res3[0] == u16ethalon);
     }
     
     BOOST_CHECK_THROW(lexical_cast<u16short_arr_type>(val), boost::bad_lexical_cast);
@@ -225,19 +225,19 @@
     {
 #ifdef BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES
         u32arr_type res = lexical_cast<u32arr_type>(val);
- BOOST_CHECK(res.begin() == u32ethalon);
+ BOOST_CHECK(&res[0] == u32ethalon);
 #endif
         u32arr_type res3 = lexical_cast<u32arr_type>(u32ethalon);
- BOOST_CHECK(res3.begin() == u32ethalon);
+ BOOST_CHECK(&res3[0] == u32ethalon);
     }
 
     {
 #ifdef BOOST_STL_SUPPORTS_NEW_UNICODE_LOCALES
         const u32arr_type res = lexical_cast<u32arr_type>(val);
- BOOST_CHECK(res.begin() == u32ethalon);
+ BOOST_CHECK(&res[0] == u32ethalon);
 #endif
         const u32arr_type res3 = lexical_cast<u32arr_type>(u32ethalon);
- BOOST_CHECK(res3.begin() == u32ethalon);
+ BOOST_CHECK(&res3[0] == u32ethalon);
     }
     
     BOOST_CHECK_THROW(lexical_cast<u32short_arr_type>(val), boost::bad_lexical_cast);


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