Implement document saving and loading
[ipdf/code.git] / src / tests / saveload.cpp
1 #include "../common.h"
2
3 #include "../document.h"
4 #include "../view.h"
5
6 using namespace std;
7 using namespace IPDF;
8
9 unsigned test_objects = 4;
10
11 int main(int argc, char ** argv)
12 {
13         srand(time(NULL));
14         Document doc;
15         for (unsigned id = 0; id < test_objects; ++id)
16         {
17                 doc.Add(Random(), Random(), Random(), Random());
18         }
19         doc.Save("test.ipdf");
20
21         Document equ("test.ipdf");
22         //doc.Add(Random(), Random(), Random(), Random());
23         if (doc != equ || equ != doc)
24         {
25                 Error("Loaded document is not equivelant to saved document!");
26                 doc.DebugDumpObjects();
27                 equ.DebugDumpObjects();
28         }
29         
30
31         return 0;
32 }

UCC git Repository :: git.ucc.asn.au