-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtestXML_base.cc
35 lines (31 loc) · 892 Bytes
/
testXML_base.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
@copyright Russell Standish 2000-2013
@author Russell Standish
This file is part of Classdesc
Open source licensed under the MIT license. See LICENSE for details.
*/
#include "xml_unpack_base.h"
#include <fstream>
#include "classdesc_epilogue.h"
int main()
{
classdesc::xml_unpack_t X(std::cin);
X.printContentMap();
{
// check that various boolean cases are handled
std::string data="<x><a>1</a><b>t</b><c>TRUE</c>"
"<d>Y</d><e>yes</e><f>ON</f><g>false</g><h>0</h></x>";
std::istringstream i(data);
classdesc::xml_unpack_t x(i);
bool b;
assert((x.unpack("x.a",b), b));
assert((x.unpack("x.b",b), b));
assert((x.unpack("x.c",b), b));
assert((x.unpack("x.d",b), b));
assert((x.unpack("x.e",b), b));
assert((x.unpack("x.f",b), b));
assert((x.unpack("x.g",b), !b));
assert((x.unpack("x.h",b), !b));
}
return 0;
}