1 #include <defines.hpp>
2 #include <store.hpp>
3 #include <vpd-parser/ipz_parser.hpp>
4 
5 #include <cassert>
6 #include <fstream>
7 #include <iterator>
8 
9 void runTests()
10 {
11     using namespace openpower::vpd;
12     using namespace openpower::vpd::ipz::parser;
13     // Test parse() API
14     {
15         std::ifstream vpdFile("test.vpd", std::ios::binary);
16         Binary vpd((std::istreambuf_iterator<char>(vpdFile)),
17                    std::istreambuf_iterator<char>());
18 
19         IpzVpdParser ipzParser(std::move(vpd));
20         auto vpdStore = std::move(std::get<Store>(ipzParser.parse()));
21 
22         assert(("P012" == vpdStore.get<Record::VINI, record::Keyword::CC>()));
23         assert(("2019-01-01-08:30:00" ==
24                 vpdStore.get<Record::VINI, record::Keyword::MB>()));
25     }
26 }
27 
28 int main()
29 {
30     runTests();
31 
32     return 0;
33 }
34