SWDEV-345188 - Windows: fix warnings while building catch (#3071)

fixes deprecated warning for 'getenv' on Windows

Change-Id: I5ecdaca451a936e843691c4611910ee338b22e46
This commit is contained in:
ROCm CI Service Account
2022-11-28 20:17:09 +05:30
committed by GitHub
parent 0ce3886fc8
commit d20ab63be1
3 changed files with 41 additions and 17 deletions
+4 -4
View File
@@ -37,7 +37,7 @@ TEST_CASE("Unit_hipExtStreamGetCUMask_verifyDefaultAndCustomMask") {
std::vector<uint32_t> cuMask(maxNum);
hipDeviceProp_t props;
std::stringstream ss;
char* gCUMask{nullptr};
std::string gCUMask;
std::string globalCUMask("");
std::vector<uint32_t> defaultCUMask;
@@ -54,8 +54,8 @@ TEST_CASE("Unit_hipExtStreamGetCUMask_verifyDefaultAndCustomMask") {
props.name << " with " << props.multiProcessorCount << " CUs");
// Get global CU Mask if exists
gCUMask = getenv("ROC_GLOBAL_CU_MASK");
if (gCUMask != nullptr && gCUMask[0] != '\0') {
gCUMask = TestContext::getEnvVar("ROC_GLOBAL_CU_MASK");
if (!gCUMask.empty()) {
globalCUMask.assign(gCUMask);
for_each(globalCUMask.begin(), globalCUMask.end(), [](char & c) {
@@ -155,7 +155,7 @@ TEST_CASE("Unit_hipExtStreamGetCUMask_verifyDefaultAndCustomMask") {
INFO("info: reading back CU mask 0x" << ss.str() <<
" for stream " << stream);
if (!gCUMask) {
if (!gCUMask.empty()) {
for (size_t i = 0; i < customMask.size(); i++) {
if (customMask[i] != cuMask[i]) {
INFO("Error! expected CU mask:" << customMask[i]