From 9555293fe8aea1a02cea24259acc2f397ba11479 Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Wed, 31 May 2023 00:55:47 +0530 Subject: [PATCH] SWDEV-387508 - do not treat uuid as a string (#253) Change-Id: Ic093384947637fe9242c5840349f6d71aea28e69 [ROCm/hip-tests commit: 9726351ae8d73262d67514776bbe989d3c34e94c] --- .../catch/unit/device/hipDeviceGetUuid.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/projects/hip-tests/catch/unit/device/hipDeviceGetUuid.cc b/projects/hip-tests/catch/unit/device/hipDeviceGetUuid.cc index 47a9bd2c4f..d7557527ea 100644 --- a/projects/hip-tests/catch/unit/device/hipDeviceGetUuid.cc +++ b/projects/hip-tests/catch/unit/device/hipDeviceGetUuid.cc @@ -36,14 +36,24 @@ Unit_hipDeviceGetUuid_Negative - Test unsuccessful execution of hipDeviceGetUuid */ TEST_CASE("Unit_hipDeviceGetUuid_Positive") { hipDevice_t device; - hipUUID uuid; + hipUUID uuid{0}; + bool uuidValid = false; const int deviceId = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipDeviceGet(&device, deviceId)); // Scenario 1 HIP_CHECK(hipDeviceGetUuid(&uuid, device)); - REQUIRE(strcmp(uuid.bytes, "") != 0); + + // Atleast one non zero value + size_t uuidSize = sizeof(uuid.bytes) / sizeof(uuid.bytes[0]); + for (int i = 0; i < uuidSize; i++) { + if (uuid.bytes[i] != 0) { + uuidValid = true; + break; + } + } + REQUIRE(uuidValid == true); } /**