Matt Spinler | 835a869 | 2019-08-27 13:56:05 -0500 | [diff] [blame] | 1 | #include "extensions/openpower-pels/pel_values.hpp" |
| 2 | |
| 3 | #include <gtest/gtest.h> |
| 4 | |
| 5 | using namespace openpower::pels::pel_values; |
| 6 | |
| 7 | TEST(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 | } |