Deepak Kodihalli | 79f9eee | 2016-12-02 07:10:14 -0600 | [diff] [blame] | 1 | #include <defines.hpp> |
| 2 | #include <store.hpp> |
| 3 | #include <parser.hpp> |
| 4 | #include <cassert> |
| 5 | #include <fstream> |
| 6 | #include <iterator> |
| 7 | |
| 8 | void 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 | |
| 25 | int main() |
| 26 | { |
| 27 | runTests(); |
| 28 | |
| 29 | return 0; |
| 30 | } |