From f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Apr 2007 03:49:53 +0000 Subject: Ok, no code is left in src, it's all in src/old. We'll gradually move code back into src as it's fixed and re-org'd. This includes tests, which, I may write a unit test system into libbu++ just to make my life easier. --- src/old/tests/serialize.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/old/tests/serialize.cpp (limited to 'src/old/tests/serialize.cpp') diff --git a/src/old/tests/serialize.cpp b/src/old/tests/serialize.cpp new file mode 100644 index 0000000..e233704 --- /dev/null +++ b/src/old/tests/serialize.cpp @@ -0,0 +1,30 @@ +#include "serializerbinary.h" +#include "staticstring.h" +#include +#include + +int main() +{ + int32_t one; + double two; + bool three; + StaticString s("Test string!"); + std::string ss("Another test string"); + SerializerBinary ar("hello.dat", false); + ar << (int)85; + ar << (double)2.63434; + ar << false; + ar << ss; + ar.close(); + + one = 0; two = 0; three = true; s = "die"; + + SerializerBinary ar2("hello.dat", true); + ar2 >> one; + ar2 >> two; + ar2 >> three; + ar2 >> s; + + printf("we got %d - %f - %s - \"%s\"\n", one, two, (three ? "true":"false"), s.getString() ); + return 0; +} -- cgit v1.2.3