diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp index fac5623d2524c0..a4bdd10aefe05c 100644 --- a/src/messaging/tests/TestReliableMessageProtocol.cpp +++ b/src/messaging/tests/TestReliableMessageProtocol.cpp @@ -179,7 +179,7 @@ class MockSessionEstablishmentDelegate : public ExchangeDelegate void test_os_sleep_ms(uint64_t millisecs) { - usleep((useconds_t)(millisecs * 1000)); + usleep(static_cast(millisecs * 1000)); } void CheckAddClearRetrans(nlTestSuite * inSuite, void * inContext) diff --git a/src/platform/tests/TestPlatformMgr.cpp b/src/platform/tests/TestPlatformMgr.cpp index cf1716110bb7c6..c825964d9bec9f 100644 --- a/src/platform/tests/TestPlatformMgr.cpp +++ b/src/platform/tests/TestPlatformMgr.cpp @@ -98,7 +98,7 @@ static bool sleepRan; static void SleepSome(intptr_t) { - usleep((useconds_t)(1 * 1000 * 1000)); + usleep(static_cast(1 * 1000 * 1000)); sleepRan = true; } diff --git a/src/platform/tests/TestPlatformTime.cpp b/src/platform/tests/TestPlatformTime.cpp index a489dad7f69b51..8f245f736b5460 100644 --- a/src/platform/tests/TestPlatformTime.cpp +++ b/src/platform/tests/TestPlatformTime.cpp @@ -72,7 +72,7 @@ static const struct time_test_vector test_vector_system_time_us[] = { void test_os_sleep_us(uint64_t microsecs) { - usleep(microsecs); + usleep(static_cast(microsecs)); } void test_os_sleep_ms(uint64_t millisecs) diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp index faf99d437de4c8..7f432092bc5926 100644 --- a/src/protocols/secure_channel/tests/TestPASESession.cpp +++ b/src/protocols/secure_channel/tests/TestPASESession.cpp @@ -44,7 +44,7 @@ using TestContext = chip::Test::MessagingContext; static void test_os_sleep_ms(uint64_t millisecs) { - usleep((useconds_t) millisecs * 1000); + usleep(static_cast(millisecs * 1000)); } class PASETestLoopbackTransport : public Test::LoopbackTransport