Skip to content

Commit 49e3419

Browse files
Added tests for handlign of null PRef in DPCTLPlatformMgr_GetInfo
1 parent 34b4d4f commit 49e3419

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libsyclinterface/tests/test_sycl_platform_interface.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,14 @@ TEST_F(TestDPCTLSyclDefaultPlatform, ChkGetInfo3)
295295
EXPECT_NO_FATAL_FAILURE(DPCTLCString_Delete(info_str));
296296
}
297297

298+
TEST_F(TestDPCTLSyclDefaultPlatform, ChkGetInfoNull)
299+
{
300+
const char *info_str = nullptr;
301+
DPCTLSyclPlatformRef NullPRef = nullptr;
302+
EXPECT_NO_FATAL_FAILURE(info_str = DPCTLPlatformMgr_GetInfo(NullPRef, 0));
303+
ASSERT_TRUE(info_str == nullptr);
304+
}
305+
298306
TEST_F(TestDPCTLSyclDefaultPlatform, ChkPrintInfo0)
299307
{
300308
EXPECT_NO_FATAL_FAILURE(DPCTLPlatformMgr_PrintInfo(PRef, 0));

0 commit comments

Comments
 (0)