blob: d44153ca483e0579ba16b9bff121fdd64144ad1f [file] [log] [blame]
Matt Spinler835a8692019-08-27 13:56:05 -05001#include "extensions/openpower-pels/pel_values.hpp"
2
3#include <gtest/gtest.h>
4
5using namespace openpower::pels::pel_values;
6
7TEST(PELFieldsTest, TestFindFields)
8{
9 auto s = findByValue(0x5D, subsystemValues);
10 ASSERT_NE(s, subsystemValues.end());
11 ASSERT_EQ(0x5D, std::get<fieldValuePos>(*s));
12 ASSERT_EQ("cec_service_network", std::get<registryNamePos>(*s));
13
14 s = findByName("cec_clocks", subsystemValues);
15 ASSERT_NE(s, subsystemValues.end());
16 ASSERT_EQ(0x58, std::get<fieldValuePos>(*s));
17 ASSERT_EQ("cec_clocks", std::get<registryNamePos>(*s));
18
19 s = findByValue(0xFF, subsystemValues);
20 ASSERT_EQ(s, subsystemValues.end());
21
22 s = findByName("foo", subsystemValues);
23 ASSERT_EQ(s, subsystemValues.end());
24}