Boost logo

Boost-Commit :

From: troyer_at_[hidden]
Date: 2008-06-14 07:31:28


Author: troyer
Date: 2008-06-14 07:31:27 EDT (Sat, 14 Jun 2008)
New Revision: 46386
URL: http://svn.boost.org/trac/boost/changeset/46386

Log:
Added array test for 2-dimensional arrays
Text files modified:
   trunk/libs/serialization/test/B.hpp | 1 +
   trunk/libs/serialization/test/test_array.cpp | 6 ++++++
   2 files changed, 7 insertions(+), 0 deletions(-)

Modified: trunk/libs/serialization/test/B.hpp
==============================================================================
--- trunk/libs/serialization/test/B.hpp (original)
+++ trunk/libs/serialization/test/B.hpp 2008-06-14 07:31:27 EDT (Sat, 14 Jun 2008)
@@ -17,6 +17,7 @@
 // See http://www.boost.org for updates, documentation, and revision history.
 
 #include <cstdlib> // for rand()
+#include <cmath>
 
 #include <boost/config.hpp>
 #if defined(BOOST_NO_STDC_NAMESPACE)

Modified: trunk/libs/serialization/test/test_array.cpp
==============================================================================
--- trunk/libs/serialization/test/test_array.cpp (original)
+++ trunk/libs/serialization/test/test_array.cpp 2008-06-14 07:31:27 EDT (Sat, 14 Jun 2008)
@@ -57,19 +57,25 @@
 
     // test array of objects
     const T a_array[10]={T(),T(),T(),T(),T(),T(),T(),T(),T(),T()};
+ const T b_array[2][3]={{T(),T(),T()},{T(),T(),T()}};
     {
         test_ostream os(testfile, TEST_STREAM_FLAGS);
         test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
         oa << boost::serialization::make_nvp("a_array", a_array);
+ oa << boost::serialization::make_nvp("b_array", b_array);
     }
     {
         T a_array1[10];
+ T b_array1[2][3];
         test_istream is(testfile, TEST_STREAM_FLAGS);
         test_iarchive ia(is, TEST_ARCHIVE_FLAGS);
         ia >> boost::serialization::make_nvp("a_array", a_array1);
+ ia >> boost::serialization::make_nvp("b_array", b_array1);
 
         array_equal_to/*<A[10]>*/ Compare;
         BOOST_CHECK(Compare(a_array, a_array1));
+ BOOST_CHECK(Compare(b_array[0], b_array1[0]));
+ BOOST_CHECK(Compare(b_array[1], b_array1[1]));
     }
     {
         T a_array1[9];


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