Updated visuals to separate alpha channel from mixColor
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-gl-abstraction.h
index 10c3264..1613bb5 100644 (file)
 #include <map>
 #include <cstdio>
 #include <cstring> // for strcmp
+#include <typeinfo>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/gl-abstraction.h>
 #include <dali/integration-api/gl-defines.h>
-#include "test-trace-call-stack.h"
+#include <test-trace-call-stack.h>
+#include <test-compare-types.h>
 
 namespace Dali
 {
@@ -956,10 +958,11 @@ public:
   inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
   {
     const std::string shaderSource = mShaderSources[shader];
-    if( static_cast<int>(shaderSource.length()) < bufsize )
+    const int shaderSourceLength = static_cast<int>(shaderSource.length());
+    if( shaderSourceLength < bufsize )
     {
-      strcpy(source, shaderSource.c_str());
-      *length = shaderSource.length();
+      strncpy( source, shaderSource.c_str(), shaderSourceLength );
+      *length = shaderSourceLength;
     }
     else
     {
@@ -2131,7 +2134,7 @@ private:
       T uniformValue;
       if ( GetUniformValue( program, uniform, uniformValue ) )
       {
-        return value == uniformValue;
+        return CompareType<T>(value, uniformValue, Math::MACHINE_EPSILON_10);
       }
 
       return false;
@@ -2175,6 +2178,9 @@ private:
   ProgramUniformValue<Matrix> mProgramUniformsMat4;
   ProgramUniformValue<Matrix3> mProgramUniformsMat3;
 
+
+
+
   inline const ProgramUniformValue<int>& GetProgramUniformsForType( const int ) const
   {
     return mProgramUniforms1i;