Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58943 - trunk/libs/spirit/test/karma
From: hartmut.kaiser_at_[hidden]
Date: 2010-01-12 11:20:02


Author: hkaiser
Date: 2010-01-12 11:20:01 EST (Tue, 12 Jan 2010)
New Revision: 58943
URL: http://svn.boost.org/trac/boost/changeset/58943

Log:
Spirit: more tests for recent binary fix
Text files modified:
   trunk/libs/spirit/test/karma/binary.cpp | 58 ++++++++++++++++++++++++++-------------
   1 files changed, 38 insertions(+), 20 deletions(-)

Modified: trunk/libs/spirit/test/karma/binary.cpp
==============================================================================
--- trunk/libs/spirit/test/karma/binary.cpp (original)
+++ trunk/libs/spirit/test/karma/binary.cpp 2010-01-12 11:20:01 EST (Tue, 12 Jan 2010)
@@ -28,11 +28,16 @@
     { // test native endian binaries
 #ifdef BOOST_LITTLE_ENDIAN
         BOOST_TEST(binary_test("\x01", 1, byte_, 0x01));
- BOOST_TEST(binary_test("\x01\x02", 2, word, 0x0201));
- BOOST_TEST(binary_test("\x01\x02\x03\x04", 4, dword, 0x04030201));
-#ifdef BOOST_HAS_LONG_LONG
- BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x08", 8, qword,
- 0x0807060504030201LL));
+ BOOST_TEST(binary_test("\x80", 1, byte_, 0x80));
+ BOOST_TEST(binary_test("\x01\x82", 2, word, 0x8201));
+ BOOST_TEST(binary_test("\x81\x02", 2, word, 0x0281));
+ BOOST_TEST(binary_test("\x01\x02\x03\x84", 4, dword, 0x84030201));
+ BOOST_TEST(binary_test("\x81\x02\x03\x04", 4, dword, 0x04030281));
+#ifdef BOOST_HAS_LONG_LONG
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x88", 8, qword,
+ 0x8807060504030201LL));
+ BOOST_TEST(binary_test("\x81\x02\x03\x04\x05\x06\x07\x08", 8, qword,
+ 0x0807060504030281LL));
 #endif
 
         BOOST_TEST(binary_test_delimited("\x01\x00\x00\x00", 4, byte_, 0x01, pad(4)));
@@ -46,11 +51,16 @@
 #else // BOOST_LITTLE_ENDIAN
 
         BOOST_TEST(binary_test("\x01", 1, byte_, 0x01));
- BOOST_TEST(binary_test("\x01\x02", 2, word, 0x0102));
- BOOST_TEST(binary_test("\x01\x02\x03\x04", 4, dword, 0x01020304));
-#ifdef BOOST_HAS_LONG_LONG
- BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x08", 8, qword,
- 0x0102030405060708LL));
+ BOOST_TEST(binary_test("\x80", 1, byte_, 0x80));
+ BOOST_TEST(binary_test("\x01\x82", 2, word, 0x0182));
+ BOOST_TEST(binary_test("\x81\x02", 2, word, 0x8102));
+ BOOST_TEST(binary_test("\x01\x02\x03\x84", 4, dword, 0x01020384));
+ BOOST_TEST(binary_test("\x81\x02\x03\x04", 4, dword, 0x81020304));
+#ifdef BOOST_HAS_LONG_LONG
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x88", 8, qword,
+ 0x0102030405060788LL));
+ BOOST_TEST(binary_test("\x81\x02\x03\x04\x05\x06\x07\x08", 8, qword,
+ 0x8102030405060708LL));
 #endif
 
         BOOST_TEST(binary_test_delimited("\x01\x00\x00\x00", 4, byte_, 0x01, pad(4)));
@@ -84,11 +94,15 @@
     }
 
     { // test big endian binaries
- BOOST_TEST(binary_test("\x01\x02", 2, big_word, 0x0102));
- BOOST_TEST(binary_test("\x01\x02\x03\x04", 4, big_dword, 0x01020304));
-#ifdef BOOST_HAS_LONG_LONG
- BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x08", 8, big_qword,
- 0x0102030405060708LL));
+ BOOST_TEST(binary_test("\x01\x82", 2, big_word, 0x0182));
+ BOOST_TEST(binary_test("\x81\x02", 2, big_word, 0x8102));
+ BOOST_TEST(binary_test("\x01\x02\x03\x84", 4, big_dword, 0x01020384));
+ BOOST_TEST(binary_test("\x81\x02\x03\x04", 4, big_dword, 0x81020304));
+#ifdef BOOST_HAS_LONG_LONG
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x88", 8, big_qword,
+ 0x0102030405060788LL));
+ BOOST_TEST(binary_test("\x81\x02\x03\x04\x05\x06\x07\x08", 8, big_qword,
+ 0x8102030405060708LL));
         BOOST_TEST(binary_test_delimited("\x01\x02\x03\x04\x05\x06\x07\x08\x00\x00",
             10, big_qword, 0x0102030405060708LL, pad(10)));
 #endif
@@ -106,11 +120,15 @@
     }
 
     { // test little endian binaries
- BOOST_TEST(binary_test("\x01\x02", 2, little_word, 0x0201));
- BOOST_TEST(binary_test("\x01\x02\x03\x04", 4, little_dword, 0x04030201));
-#ifdef BOOST_HAS_LONG_LONG
- BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x08", 8, little_qword,
- 0x0807060504030201LL));
+ BOOST_TEST(binary_test("\x01\x82", 2, little_word, 0x8201));
+ BOOST_TEST(binary_test("\x81\x02", 2, little_word, 0x0281));
+ BOOST_TEST(binary_test("\x01\x02\x03\x84", 4, little_dword, 0x84030201));
+ BOOST_TEST(binary_test("\x81\x02\x03\x04", 4, little_dword, 0x04030281));
+#ifdef BOOST_HAS_LONG_LONG
+ BOOST_TEST(binary_test("\x01\x02\x03\x04\x05\x06\x07\x88", 8, little_qword,
+ 0x8807060504030201LL));
+ BOOST_TEST(binary_test("\x81\x02\x03\x04\x05\x06\x07\x08", 8, little_qword,
+ 0x0807060504030281LL));
         BOOST_TEST(binary_test_delimited("\x01\x02\x03\x04\x05\x06\x07\x08\x00\x00",
             10, little_qword, 0x0807060504030201LL, pad(10)));
 #endif


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