| Rekha Aparna | 17ddfb5 | 2025-10-09 20:45:53 -0500 | [diff] [blame] | 1 | #include "utility/common_utility.hpp" |
| 2 | |
| Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 3 | #include <utility/vpd_specific_utility.hpp> |
| 4 | |
| 5 | #include <cassert> |
| 6 | #include <string> |
| 7 | |
| 8 | #include <gtest/gtest.h> |
| 9 | |
| 10 | using namespace vpd; |
| 11 | |
| 12 | TEST(UtilsTest, TestValidValue) |
| 13 | { |
| Rekha Aparna | 17ddfb5 | 2025-10-09 20:45:53 -0500 | [diff] [blame] | 14 | uint16_t l_errCode = 0; |
| Sunny Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 15 | std::string key = "VINI"; |
| 16 | std::string encoding = "MAC"; |
| 17 | std::string expected = "56:49:4e:49"; |
| Rekha Aparna | 17ddfb5 | 2025-10-09 20:45:53 -0500 | [diff] [blame] | 18 | 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 Srivastava | fa5e4d3 | 2023-03-12 11:59:49 -0500 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | int main(int argc, char** argv) |
| 29 | { |
| 30 | ::testing::InitGoogleTest(&argc, argv); |
| 31 | |
| 32 | return RUN_ALL_TESTS(); |
| 33 | } |