blob: aec7c7bc6e8ecdb2716338619f1c96529aa2b411 [file] [log] [blame]
Rekha Aparna17ddfb52025-10-09 20:45:53 -05001#include "utility/common_utility.hpp"
2
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -05003#include <utility/vpd_specific_utility.hpp>
4
5#include <cassert>
6#include <string>
7
8#include <gtest/gtest.h>
9
10using namespace vpd;
11
12TEST(UtilsTest, TestValidValue)
13{
Rekha Aparna17ddfb52025-10-09 20:45:53 -050014 uint16_t l_errCode = 0;
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050015 std::string key = "VINI";
16 std::string encoding = "MAC";
17 std::string expected = "56:49:4e:49";
Rekha Aparna17ddfb52025-10-09 20:45:53 -050018 EXPECT_EQ(expected,
19 vpdSpecificUtility::encodeKeyword(key, encoding, l_errCode));
20 if (l_errCode)
21 {
22 logging::logMessage(
23 "Failed to get encoded keyword value for : " + key +
24 ", error : " + commonUtility::getErrCodeMsg(l_errCode));
25 }
Sunny Srivastavafa5e4d32023-03-12 11:59:49 -050026}
27
28int main(int argc, char** argv)
29{
30 ::testing::InitGoogleTest(&argc, argv);
31
32 return RUN_ALL_TESTS();
33}