2 * QEMU Marshalling Framework
5 * Copyright IBM, Corp. 2010
8 * Anthony Liguori <aliguori@us.ibm.com>
10 * This work is licensed under the terms of the GNU GPL, version 2. See
11 * the COPYING file in the top-level directory.
16 #include "test-marshal.h"
17 #include "xml-writer.h"
18 #include "xml-reader.h"
20 int main(int argc
, char **argv
)
29 test
.mem
= malloc(test
.mem_len
);
30 for (i
= 0; i
< test
.mem_len
; i
++) {
34 test
.bank2
.bank2_enabled
= true;
35 test
.bank2
.mem_len
= 0;
36 test
.bank2
.mem
= NULL
;
38 test
.bank2
.bank3
.bank3_enabled
= true;
39 memset(test
.bank2
.bank3
.mem
, 0, sizeof(test
.bank2
.bank3
.mem
));
41 f
= fopen("test.xml", "w");
42 m
= xml_writer_open(f
);
43 marshal_TestDevice(m
, &test
, "test", NULL
);
47 memset(test
.mem
, 0, test
.mem_len
);
49 f
= fopen("test.xml", "r");
50 m
= xml_reader_open(f
);
51 marshal_TestDevice(m
, &test
, "test", &err
);
56 fprintf(stderr
, "FAIL: %s\n", err
->message
);
61 m
= xml_writer_open(stdout
);
62 marshal_TestDevice(m
, &test
, "test", NULL
);