summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWilly Tu <wltu@google.com>2023-06-08 18:48:19 +0300
committerEd Tanous <ed@tanous.net>2023-06-08 21:05:01 +0300
commitb5b62cc15edd2f4f2053a629cbcf6340b15e307e (patch)
treeaf636538d3394bb4c93a6a4f0ac35fec20355f37 /test
parentc51a58ee9231e48bb25ede75307591758f911395 (diff)
downloadbmcweb-b5b62cc15edd2f4f2053a629cbcf6340b15e307e.tar.xz
hex_units: Fix Werror=conversion
Convert all types to uint8_t to not hit the conversion warning. Change-Id: Ia535ca0a2f4045cbde06a2f8f8eaad9570a0f4a5 Signed-off-by: Willy Tu <wltu@google.com> Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'test')
-rw-r--r--test/redfish-core/include/utils/hex_utils_test.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/redfish-core/include/utils/hex_utils_test.cpp b/test/redfish-core/include/utils/hex_utils_test.cpp
index d96e4d4681..c80158a663 100644
--- a/test/redfish-core/include/utils/hex_utils_test.cpp
+++ b/test/redfish-core/include/utils/hex_utils_test.cpp
@@ -54,11 +54,11 @@ TEST(HexCharToNibble, ReturnsCorrectNibbleForEveryHexChar)
}
else if (c >= 'A' && c <= 'F')
{
- expected = static_cast<uint8_t>(c) - 'A' + 10;
+ expected = static_cast<uint8_t>(c - 'A') + 10U;
}
else if (c >= 'a' && c <= 'f')
{
- expected = static_cast<uint8_t>(c) - 'a' + 10;
+ expected = static_cast<uint8_t>(c - 'a') + 10U;
}
EXPECT_EQ(hexCharToNibble(c), expected);