summaryrefslogtreecommitdiffstats
path: root/test/store/store.cpp
blob: 4c83ba753df5af525b7f1f450b29550ad863f64b (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
30
31
32
33
34
35
36
37
38
#include "store.hpp"

#include "defines.hpp"

#include <cassert>
#include <string>
#include <unordered_map>
#include <utility>

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

    // Test Store::get API
    {
        Parsed vpd;
        using inner = Parsed::mapped_type;
        inner i;

        i.emplace("SN", "1001");
        i.emplace("PN", "F001");
        i.emplace("DR", "Fake FRU");
        vpd.emplace("VINI", i);

        Store s(std::move(vpd));

        assert(("1001" == s.get<Record::VINI, record::Keyword::SN>()));
        assert(("F001" == s.get<Record::VINI, record::Keyword::PN>()));
        assert(("Fake FRU" == s.get<Record::VINI, record::Keyword::DR>()));
    }
}

int main()
{
    runTests();

    return 0;
}
OpenPOWER on IntegriCloud