Support YUV decoding for JPEG
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-environment-variable.cpp
index f02bfb4..5d8d143 100644 (file)
 
 // EXTERNAL INCLUDE
 #include <cstddef>
+#include <string>
 
 namespace Dali
 {
-
 namespace EnvironmentVariable
 {
-
 namespace
 {
-const char * gReturnValue = NULL;
-}
+const char* gReturnValue = NULL;
+std::string gEnvironmentVariableName;
+std::string gEnvironmentVariableValue;
+} // namespace
 
-const char * GetEnvironmentVariable( const char * variable )
+const char* GetEnvironmentVariable(const char* variable)
 {
+  if(gEnvironmentVariableName == variable)
+  {
+    return gEnvironmentVariableValue.c_str();
+  }
   return gReturnValue;
 }
 
-void SetTestingEnvironmentVariable( bool testing)
+void SetTestingEnvironmentVariable(bool testing)
 {
-  if( testing )
+  if(testing)
   {
     gReturnValue = "1";
   }
@@ -48,6 +53,12 @@ void SetTestingEnvironmentVariable( bool testing)
   }
 }
 
+void SetTestEnvironmentVariable(const char* variable, const char* value)
+{
+  gEnvironmentVariableName  = variable;
+  gEnvironmentVariableValue = value;
+}
+
 } // namespace EnvironmentVariable
 
 } // namespace Dali