Update of /cvsroot/pclasses/pclasses2/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17857/test
Modified Files:
SimplePropertyStoreTest.cpp
Log Message:
Added an SIO test.
Index: SimplePropertyStoreTest.cpp
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/test/SimplePropertyStoreTest.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- SimplePropertyStoreTest.cpp 30 Dec 2004 22:56:03 -0000 1.6
+++ SimplePropertyStoreTest.cpp 6 Jan 2005 17:04:28 -0000 1.7
@@ -3,7 +3,6 @@
#include <pclasses/SIO/SIO.h>
#include <pclasses/s11n/pods_streamable.h>
#include <pclasses/s11n/map.h>
-#include <pclasses/Util/SimplePropertyStore.h>
#include <pclasses/SIO/Proxy/SimplePropertyStore_s11n.h>
#include <memory> // auto_ptr
#include <cassert>
@@ -16,6 +15,11 @@
#define PropMap P::Util::SimplePropertyStore
+#define PS11N_TYPE std::map<std::string,std::string>
+#define PS11N_TYPE_NAME "map"
+#define PS11N_SERIALIZE_FUNCTOR ::P::s11n::map::streamable_map_serializable_proxy
+#include <pclasses/SIO/RegisterSerializable.h>
+
// i wish i could make this a P::App...
int main( int argc, char ** argv )
{
@@ -40,5 +44,14 @@
save( m, std::cout );
+ typedef std::map<std::string,std::string> OtherMap;
+ OtherMap m2;
+ if( ! s11nCast( m, m2 ) )
+ {
+ CERR << "Map conversion failed!\n";
+ return 1;
+ }
+ CERR << "s11nCast() to map<string,string>:\n";
+ save( m2, std::cout );
return 0;
}
|