platform-mc: test: remove C type cast
Change C type casting to C++ type casting in platform-mc test code.
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Change-Id: Ia050f01871825e3d078a4c3c3ac1dead942f854c
diff --git a/platform-mc/test/platform_manager_test.cpp b/platform-mc/test/platform_manager_test.cpp
index fe2b96a..8afad35 100644
--- a/platform-mc/test/platform_manager_test.cpp
+++ b/platform-mc/test/platform_manager_test.cpp
@@ -69,7 +69,7 @@
0x0 // dataTransferHandleTimeout
};
auto rc = mockTerminusManager.enqueueResponse(
- (pldm_msg*)getPDRRepositoryInfoResp.data(),
+ reinterpret_cast<pldm_msg*>(getPDRRepositoryInfoResp.data()),
sizeof(getPDRRepositoryInfoResp));
EXPECT_EQ(rc, PLDM_SUCCESS);
@@ -143,8 +143,8 @@
0, // fatalHigh
0 // fatalLow
};
- rc = mockTerminusManager.enqueueResponse((pldm_msg*)getPdrResp.data(),
- sizeof(getPdrResp));
+ rc = mockTerminusManager.enqueueResponse(
+ reinterpret_cast<pldm_msg*>(getPdrResp.data()), sizeof(getPdrResp));
EXPECT_EQ(rc, PLDM_SUCCESS);
stdexec::sync_wait(platformManager.initTerminus());
@@ -345,7 +345,7 @@
0x0 // dataTransferHandleTimeout
};
auto rc = mockTerminusManager.enqueueResponse(
- (pldm_msg*)getPDRRepositoryInfoResp.data(),
+ reinterpret_cast<pldm_msg*>(getPDRRepositoryInfoResp.data()),
sizeof(getPDRRepositoryInfoResp));
EXPECT_EQ(rc, PLDM_SUCCESS);
@@ -419,8 +419,8 @@
0, // fatalHigh
0 // fatalLow
};
- rc = mockTerminusManager.enqueueResponse((pldm_msg*)getPdrResp.data(),
- sizeof(getPdrResp));
+ rc = mockTerminusManager.enqueueResponse(
+ reinterpret_cast<pldm_msg*>(getPdrResp.data()), sizeof(getPdrResp));
EXPECT_EQ(rc, PLDM_SUCCESS);
stdexec::sync_wait(platformManager.initTerminus());
@@ -456,7 +456,7 @@
std::array<uint8_t, sizeof(pldm_msg_hdr) + getPDRRepositoryInfoLen>
getPDRRepositoryInfoResp{0x0, 0x02, 0x50, PLDM_ERROR};
auto rc = mockTerminusManager.enqueueResponse(
- (pldm_msg*)getPDRRepositoryInfoResp.data(),
+ reinterpret_cast<pldm_msg*>(getPDRRepositoryInfoResp.data()),
sizeof(getPDRRepositoryInfoResp));
EXPECT_EQ(rc, PLDM_SUCCESS);
@@ -464,8 +464,8 @@
const size_t getPdrRespLen = 1;
std::array<uint8_t, sizeof(pldm_msg_hdr) + getPdrRespLen> getPdrResp{
0x0, 0x02, 0x51, PLDM_ERROR};
- rc = mockTerminusManager.enqueueResponse((pldm_msg*)getPdrResp.data(),
- sizeof(getPdrResp));
+ rc = mockTerminusManager.enqueueResponse(
+ reinterpret_cast<pldm_msg*>(getPdrResp.data()), sizeof(getPdrResp));
EXPECT_EQ(rc, PLDM_SUCCESS);
stdexec::sync_wait(platformManager.initTerminus());