summaryrefslogtreecommitdiffstats
path: root/test/parser/parser.cpp
blob: 69b2005f362476e36afe0c669ef11348f1ff434c (plain)
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
#include <cassert>
#include <defines.hpp>
#include <fstream>
#include <iterator>
#include <parser.hpp>
#include <store.hpp>

void runTests()
{
    using namespace openpower::vpd;

    // Test parse() API
    {
        std::ifstream vpdFile("test.vpd", std::ios::binary);
        Binary vpd((std::istreambuf_iterator<char>(vpdFile)),
                   std::istreambuf_iterator<char>());

        auto vpdStore = parse(std::move(vpd));

        assert(("P012" == vpdStore.get<Record::VINI, record::Keyword::CC>()));
    }
}

int main()
{
    runTests();

    return 0;
}
OpenPOWER on IntegriCloud