blob: eda30afbdb8f8430ec4e41baba6967929b4c5f14 [file] [log] [blame]
Deepak Kodihalli79f9eee2016-12-02 07:10:14 -06001#include <defines.hpp>
2#include <store.hpp>
3#include <parser.hpp>
4#include <cassert>
5#include <fstream>
6#include <iterator>
7
8void runTests()
9{
10 using namespace openpower::vpd;
11
12 // Test parse() API
13 {
14 std::ifstream vpdFile("test.vpd", std::ios::binary);
15 Binary vpd((std::istreambuf_iterator<char>(vpdFile)),
16 std::istreambuf_iterator<char>());
17
18 auto vpdStore = parse(std::move(vpd));
19
20 assert(("P012" ==
21 vpdStore.get<Record::VINI, record::Keyword::CC>()));
22 }
23}
24
25int main()
26{
27 runTests();
28
29 return 0;
30}