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/serializetext.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/old/tests/serializetext.cpp (limited to 'src/old/tests/serializetext.cpp') diff --git a/src/old/tests/serializetext.cpp b/src/old/tests/serializetext.cpp new file mode 100644 index 0000000..f6be7d3 --- /dev/null +++ b/src/old/tests/serializetext.cpp @@ -0,0 +1,28 @@ +#include "serializertext.h" +#include "staticstring.h" +#include + +int main() +{ + StaticString s("You're a dog!!"); + SerializerText ar("hello.dat", false); + + ar << 4 << 3.993 << true << s; + + ar.close(); + + int one=0;float two=0.0;bool three=false; s = ""; + + SerializerText ar2("hello.dat", true); + + ar2 >> one; + ar2 >> two; + ar2 >> three; + ar2 >> s; + + //printf("out: %d, %f, %s, \"%s\"\n", one, two, (three ? "true" : "false"), s.getString()); + std::cout << one << ", " << two << ", " << three << ", " << s.getString() << "\n"; + + return 0; +} + -- cgit v1.2.3