blob: 28e455f5cb296ebb6b7b895ccf586fa013d38c9d [file] [log] [blame]
Matt Spinler0d92b522021-06-16 13:28:17 -06001#include "extensions/openpower-pels/data_interface.hpp"
2
3#include <gtest/gtest.h>
4
5using namespace openpower::pels;
6
7TEST(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}