X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftoolkit-environment-variable.cpp;h=3bd51bc34941d1f2531c9e815384a04a90e7fa17;hb=92ef4e31d9d604e00b069dad753fd6dbfa27e17a;hp=f02bfb4ef0abc9173997ea4e5b5b7218a96e0740;hpb=46fe497b39cfdec35dade509903cde6f4d7f7e89;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp index f02bfb4..3bd51bc 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,34 +18,31 @@ #include "toolkit-environment-variable.h" // EXTERNAL INCLUDE -#include +#include +#include namespace Dali { - namespace EnvironmentVariable { - namespace { -const char * gReturnValue = NULL; -} +std::map gEnvironmentVariables; +} // namespace -const char * GetEnvironmentVariable( const char * variable ) +const char* GetEnvironmentVariable(const char* variable) { - return gReturnValue; + auto value = gEnvironmentVariables.find(variable); + if(value != gEnvironmentVariables.end()) + { + return value->second.c_str(); + } + return nullptr; } -void SetTestingEnvironmentVariable( bool testing) +void SetTestEnvironmentVariable(const char* variable, const char* value) { - if( testing ) - { - gReturnValue = "1"; - } - else - { - gReturnValue = NULL; - } + gEnvironmentVariables[variable] = value; } } // namespace EnvironmentVariable