aboutsummaryrefslogtreecommitdiff
path: root/src/test/serialize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/serialize.cpp')
-rw-r--r--src/test/serialize.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/serialize.cpp b/src/test/serialize.cpp
new file mode 100644
index 0000000..883be5e
--- /dev/null
+++ b/src/test/serialize.cpp
@@ -0,0 +1,24 @@
1#include "serializerbinary.h"
2#include <stdio.h>
3
4int main()
5{
6 int32_t one;
7 double two;
8 bool three;
9 SerializerBinary ar("hello.dat", false);
10 ar << (int)85;
11 ar << (double)2.63434;
12 ar << false;
13 ar.close();
14
15 one = 0; two = 0; three = true;
16
17 SerializerBinary ar2("hello.dat", true);
18 ar2 >> one;
19 ar2 >> two;
20 ar2 >> three;
21
22 printf("we got %d - %f - %s\n", one, two, (three ? "true":"false"));
23 return 0;
24}