Matt Spinler | 0d92b52 | 2021-06-16 13:28:17 -0600 | [diff] [blame] | 1 | #include "extensions/openpower-pels/data_interface.hpp" |
| 2 | |
| 3 | #include <gtest/gtest.h> |
| 4 | |
| 5 | using namespace openpower::pels; |
| 6 | |
| 7 | TEST(DataInterfaceTest, ExtractConnectorLocCode) |
| 8 | { |
| 9 | { |
| 10 | auto [base, connector] = |
| 11 | DataInterface::extractConnectorFromLocCode("Ufcs-P0-C2-T11"); |
| 12 | |
| 13 | EXPECT_EQ(base, "Ufcs-P0-C2"); |
| 14 | EXPECT_EQ(connector, "-T11"); |
| 15 | } |
| 16 | |
| 17 | { |
| 18 | auto [base, connector] = |
| 19 | DataInterface::extractConnectorFromLocCode("Ufcs-P0-C2"); |
| 20 | |
| 21 | EXPECT_EQ(base, "Ufcs-P0-C2"); |
| 22 | EXPECT_TRUE(connector.empty()); |
| 23 | } |
| 24 | } |