Update of /cvsroot/boost/boost/libs/serialization/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24067
Modified Files:
test_array.cpp test_vector.cpp
Log Message:
Index: test_array.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/serialization/test/test_array.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- test_array.cpp 22 Jun 2006 07:21:22 -0000 1.10
+++ test_array.cpp 11 Dec 2006 06:32:28 -0000 1.11
@@ -26,10 +26,10 @@
#include <boost/serialization/nvp.hpp>
#include "A.hpp"
-template<class T>
-struct array_equal_to : public std::binary_function<T, T, bool>
+struct array_equal_to //: public std::binary_function<T, T, bool>
{
- bool operator()(const T & _Left, const T & _Right) const
+template<class T, class U>
+ bool operator()(const T & _Left, const U & _Right) const
{
// consider alignment
int count_left = sizeof(_Left) / (
@@ -58,23 +58,23 @@
BOOST_REQUIRE(NULL != testfile);
// test array of objects
- const A a_array[10];
+ const T a_array[10]={T(),T(),T(),T(),T(),T(),T(),T(),T(),T()};
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os);
oa << boost::serialization::make_nvp("a_array", a_array);
}
{
- A a_array1[10];
+ T a_array1[10];
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is);
ia >> boost::serialization::make_nvp("a_array", a_array1);
- array_equal_to<A[10]> Compare;
+ array_equal_to/*<A[10]>*/ Compare;
BOOST_CHECK(Compare(a_array, a_array1));
}
{
- A a_array1[9];
+ T a_array1[9];
test_istream is(testfile, TEST_STREAM_FLAGS);
BOOST_TRY {
test_iarchive ia(is);
Index: test_vector.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/serialization/test/test_vector.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- test_vector.cpp 22 Jun 2006 07:21:22 -0000 1.8
+++ test_vector.cpp 11 Dec 2006 06:32:28 -0000 1.9
@@ -33,15 +33,15 @@
BOOST_REQUIRE(NULL != testfile);
// test array of objects
- std::vector<A> avector;
- avector.push_back(A());
- avector.push_back(A());
+ std::vector<T> avector;
+ avector.push_back(T());
+ avector.push_back(T());
{
test_ostream os(testfile, TEST_STREAM_FLAGS);
test_oarchive oa(os);
oa << boost::serialization::make_nvp("avector", avector);
}
- std::vector<A> avector1;
+ std::vector<T> avector1;
{
test_istream is(testfile, TEST_STREAM_FLAGS);
test_iarchive ia(is);
@@ -55,9 +55,12 @@
int test_main( int /* argc */, char* /* argv */[] )
{
int res = test_vector(A());
- // test an int array for which optimized versions should be available
+ // test an int vector for which optimized versions should be available
if (res == EXIT_SUCCESS)
res = test_vector(0);
+ // test a bool vector
+ if (res == EXIT_SUCCESS)
+ res = test_vector(false);
return res;
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs