projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update automated tests
[platform/core/uifw/dali-toolkit.git]
/
automated-tests
/
src
/
dali-toolkit
/
dali-toolkit-test-utils
/
toolkit-environment-variable.cpp
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
5d8d143
..
4fc6cf2
100644
(file)
--- 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) 20
15
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
22
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-18,8
+18,7
@@
#include "toolkit-environment-variable.h"
// EXTERNAL INCLUDE
#include "toolkit-environment-variable.h"
// EXTERNAL INCLUDE
-#include <cstddef>
-#include <string>
+#include <map>
namespace Dali
{
namespace Dali
{
@@
-27,36
+26,22
@@
namespace EnvironmentVariable
{
namespace
{
{
namespace
{
-const char* gReturnValue = NULL;
-std::string gEnvironmentVariableName;
-std::string gEnvironmentVariableValue;
+std::map<std::string, std::string> gEnvironmentVariables;
} // namespace
const char* GetEnvironmentVariable(const char* variable)
{
} // namespace
const char* GetEnvironmentVariable(const char* variable)
{
- if(gEnvironmentVariableName == variable)
+ auto value = gEnvironmentVariables.find(variable);
+ if(value != gEnvironmentVariables.end())
{
{
- return gEnvironmentVariableValue.c_str();
- }
- return gReturnValue;
-}
-
-void SetTestingEnvironmentVariable(bool testing)
-{
- if(testing)
- {
- gReturnValue = "1";
- }
- else
- {
- gReturnValue = NULL;
+ return value->second.c_str();
}
}
+ return nullptr;
}
void SetTestEnvironmentVariable(const char* variable, const char* value)
{
}
void SetTestEnvironmentVariable(const char* variable, const char* value)
{
- gEnvironmentVariableName = variable;
- gEnvironmentVariableValue = value;
+ gEnvironmentVariables[variable] = value;
}
} // namespace EnvironmentVariable
}
} // namespace EnvironmentVariable