00001 #ifndef STATIC_CONTIANER_TEST_DUMP_H 00002 00003 #define STATIC_CONTIANER_TEST_DUMP_H 00004 00005 #include <boost/test/minimal.hpp> 00006 #include <sstream> 00007 00008 namespace static_container { 00009 namespace test { 00011 template < typename Cont > 00012 void dump( const Cont& cont ) { 00013 char fileImage1[ sizeof( Cont ) ]; 00014 char fileImage2[ sizeof( Cont ) ]; 00015 00016 memcpy( fileImage1, &cont, sizeof( Cont ) ); 00017 memcpy( fileImage2, fileImage1, sizeof( Cont ) ); 00018 Cont* dest = reinterpret_cast< Cont* >( fileImage2 ); 00019 BOOST_REQUIRE( cont == *dest ); 00020 } 00021 00022 template < typename ContGen > 00023 void dump() { 00024 ContGen::gen< int, 10 >::type iv; 00025 test::dump( iv ); 00026 00027 iv.push_back( 100 ); 00028 iv.push_back( 50 ); 00029 test::dump( iv ); 00030 } 00031 } 00032 } 00033 00034 #endif