Updating test harness following format changes 50/243850/3
authorDavid Steele <david.steele@samsung.com>
Thu, 10 Sep 2020 11:31:23 +0000 (12:31 +0100)
committerDavid Steele <david.steele@samsung.com>
Thu, 10 Sep 2020 14:36:07 +0000 (15:36 +0100)
Change-Id: I2e6afda4215e8d8f707331d3952a8c8eaff2b9bd

28 files changed:
automated-tests/.clang-format [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/mesh-builder.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-actor-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-compare-types.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gesture-generator.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gesture-generator.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-context-helper-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-sync-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-intrusive-ptr.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-native-image.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-controller.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-render-controller.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h

diff --git a/automated-tests/.clang-format b/automated-tests/.clang-format
new file mode 100644 (file)
index 0000000..297ddc2
--- /dev/null
@@ -0,0 +1,5 @@
+---
+Language:        Cpp
+DisableFormat: true
+SortIncludes: false
+...
index 87750e2..523bd8c 100644 (file)
@@ -33,93 +33,93 @@ void tet_result(int32_t value)
   // First TET_PASS should set to zero
   // first TET_FAIL should prevent any further TET_PASS from setting back to zero
   // Any TET_FAIL should set to fail or leave as fail
-  if( test_return_value != 1 )
+  if(test_return_value != 1)
     test_return_value = value;
 }
 
 #define END_TEST \
-  return ((test_return_value>0)?1:0)
+  return ((test_return_value > 0) ? 1 : 0)
 
 extern "C"
 {
+  void tet_infoline(const char* str)
+  {
+    fprintf(stderr, "%s\n", str);
+  }
 
-void tet_infoline(const char* str)
-{
-  fprintf(stderr, "%s\n", str);
-}
-
-void tet_printf(const char *format, ...)
-{
-  va_list arg;
-  va_start(arg, format);
-  vfprintf(stderr, format, arg);
-  va_end(arg);
-}
+  void tet_printf(const char* format, ...)
+  {
+    va_list arg;
+    va_start(arg, format);
+    vfprintf(stderr, format, arg);
+    va_end(arg);
+  }
 }
 
-
 bool operator==(TimePeriod a, TimePeriod b)
 {
-  return Equals(a.durationSeconds, b.durationSeconds) && Equals(a.delaySeconds, b.delaySeconds) ;
+  return Equals(a.durationSeconds, b.durationSeconds) && Equals(a.delaySeconds, b.delaySeconds);
 }
 
-std::ostream& operator<<( std::ostream& ostream, TimePeriod value )
+std::ostream& operator<<(std::ostream& ostream, TimePeriod value)
 {
   return ostream << "( Duration:" << value.durationSeconds << " Delay:" << value.delaySeconds << ")";
 }
 
-std::ostream& operator<<( std::ostream& ostream, Radian angle )
+std::ostream& operator<<(std::ostream& ostream, Radian angle)
 {
   ostream << angle.radian;
   return ostream;
 }
 
-std::ostream& operator<<( std::ostream& ostream, Degree angle )
+std::ostream& operator<<(std::ostream& ostream, Degree angle)
 {
   ostream << angle.degree;
   return ostream;
 }
 
-void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location )
+void DALI_TEST_EQUALS(const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location)
 {
-  DALI_TEST_EQUALS< const BaseHandle& >( baseHandle1, baseHandle2, location );
+  DALI_TEST_EQUALS<const BaseHandle&>(baseHandle1, baseHandle2, location);
 }
 
-void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location )
+void DALI_TEST_EQUALS(const size_t value1, const uint32_t value2, const char* location)
 {
-  DALI_TEST_EQUALS< uint32_t >( ( uint32_t )( value1 ), value2, location );
+  DALI_TEST_EQUALS<uint32_t>((uint32_t)(value1), value2, location);
 }
 
-void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* location )
+void DALI_TEST_EQUALS(const uint32_t value1, const size_t value2, const char* location)
 {
-  DALI_TEST_EQUALS< uint32_t >( value1, ( uint32_t )( value2 ), location );
+  DALI_TEST_EQUALS<uint32_t>(value1, (uint32_t)(value2), location);
 }
 
-void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location)
+void DALI_TEST_EQUALS(const Matrix3& matrix1, const Matrix3& matrix2, const char* location)
 {
-  const float* m1 = matrix1.AsFloat();
-  const float* m2 = matrix2.AsFloat();
-  bool equivalent = true;
+  const float* m1         = matrix1.AsFloat();
+  const float* m2         = matrix2.AsFloat();
+  bool         equivalent = true;
 
-  for (int32_t i=0;i<9;++i)
+  for(int32_t i = 0; i < 9; ++i)
   {
-    if( ! (fabsf(m1[i] - m2[i])< GetRangedEpsilon(m1[i], m2[i])) )
+    if(!(fabsf(m1[i] - m2[i]) < GetRangedEpsilon(m1[i], m2[i])))
     {
       equivalent = false;
     }
   }
 
-  if( !equivalent )
+  if(!equivalent)
   {
     // Align each float to 1234.67, i.e. 3.6 will be "   3.60"
-    fprintf( stderr, "%s, checking\n"
-               "%7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f\n"
-               "%7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f\n"
-               "%7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f\n",
-               location,
-               m1[0], m1[3], m1[6],    m2[0], m2[3], m2[6],
-               m1[1], m1[4], m1[7],    m2[1], m2[4], m2[7],
-               m1[2], m1[5], m1[8],    m2[2], m2[5], m2[8] );
+    // clang-format off
+    fprintf(stderr, "%s, checking\n"
+            "%7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f\n",
+            location,
+            m1[0],m1[3],m1[6],m2[0],m2[3],m2[6],
+            m1[1],m1[4],m1[7],m2[1],m2[4],m2[7],
+            m1[2],m1[5],m1[8],m2[2],m2[5],m2[8]);
+    // clang-format on
 
     tet_result(TET_FAIL);
     throw("TET_FAIL");
@@ -130,28 +130,30 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const cha
   }
 }
 
-void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float epsilon, const char* location)
+void DALI_TEST_EQUALS(const Matrix3& matrix1, const Matrix3& matrix2, float epsilon, const char* location)
 {
-  const float* m1 = matrix1.AsFloat();
-  const float* m2 = matrix2.AsFloat();
-  bool equivalent = true;
+  const float* m1         = matrix1.AsFloat();
+  const float* m2         = matrix2.AsFloat();
+  bool         equivalent = true;
 
-  for (int32_t i=0;i<9;++i)
+  for(int32_t i = 0; i < 9; ++i)
   {
-    equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
+    equivalent &= (fabsf(m1[i] - m2[i]) < epsilon);
   }
 
-  if (!equivalent)
+  if(!equivalent)
   {
     // Align each float to 1234.67, i.e. 3.6 will be "   3.60"
-    fprintf( stderr, "%s, checking\n"
-               "%7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f\n"
-               "%7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f\n"
-               "%7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f\n",
-               location,
-               m1[0], m1[3], m1[6],    m2[0], m2[3], m2[6],
-               m1[1], m1[4], m1[7],    m2[1], m2[4], m2[7],
-               m1[2], m1[5], m1[8],    m2[2], m2[5], m2[8] );
+    // clang-format off
+    fprintf(stderr, "%s, checking\n"
+            "%7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f\n",
+            location,
+            m1[0],m1[3],m1[6],m2[0],m2[3],m2[6],
+            m1[1],m1[4],m1[7],m2[1],m2[4],m2[7],
+            m1[2],m1[5],m1[8],m2[2],m2[5],m2[8]);
+    // clang-format on
 
     tet_result(TET_FAIL);
     throw("TET_FAIL");
@@ -162,14 +164,14 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float eps
   }
 }
 
-void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char* location)
+void DALI_TEST_EQUALS(const Matrix& matrix1, const Matrix& matrix2, const char* location)
 {
-  const float* m1 = matrix1.AsFloat();
-  const float* m2 = matrix2.AsFloat();
-  bool identical = true;
+  const float* m1        = matrix1.AsFloat();
+  const float* m2        = matrix2.AsFloat();
+  bool         identical = true;
 
   int32_t i;
-  for (i=0;i<16;++i)
+  for(i = 0; i < 16; ++i)
   {
     if(m1[i] != m2[i])
     {
@@ -178,19 +180,21 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char*
     }
   }
 
-  if (!identical)
+  if(!identical)
   {
     // Align each float to 1234.67, i.e. 3.6 will be "   3.60"
-    fprintf( stderr, "%s, checking\n"
-             "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n"
-             "%7.2f %7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f %7.2f\n"
-             "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n"
-             "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n",
-             location,
-             m1[0], m1[4], m1[8],  m1[12],    m2[0], m2[4], m2[8],  m2[12],
-             m1[1], m1[5], m1[9],  m1[13],    m2[1], m2[5], m2[9],  m2[13],
-             m1[2], m1[6], m1[10], m1[14],    m2[2], m2[6], m2[10], m2[14],
-             m1[3], m1[7], m1[11], m1[15],    m2[3], m2[7], m2[11], m2[15] );
+    // clang-format off
+    fprintf(stderr, "%s, checking\n"
+            "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n",
+            location,
+            m1[0],m1[4],m1[8],m1[12],m2[0],m2[4],m2[8],m2[12],
+            m1[1],m1[5],m1[9],m1[13],m2[1],m2[5],m2[9],m2[13],
+            m1[2],m1[6],m1[10],m1[14],m2[2],m2[6],m2[10],m2[14],
+            m1[3],m1[7],m1[11],m1[15],m2[3],m2[7],m2[11],m2[15]);
+    // clang-format on
 
     tet_result(TET_FAIL);
     throw("TET_FAIL");
@@ -201,30 +205,32 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char*
   }
 }
 
-void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsilon, const char* location)
+void DALI_TEST_EQUALS(const Matrix& matrix1, const Matrix& matrix2, float epsilon, const char* location)
 {
-  const float* m1 = matrix1.AsFloat();
-  const float* m2 = matrix2.AsFloat();
-  bool equivalent = true;
+  const float* m1         = matrix1.AsFloat();
+  const float* m2         = matrix2.AsFloat();
+  bool         equivalent = true;
 
-  for (int32_t i=0;i<16;++i)
+  for(int32_t i = 0; i < 16; ++i)
   {
-    equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
+    equivalent &= (fabsf(m1[i] - m2[i]) < epsilon);
   }
 
-  if (!equivalent)
+  if(!equivalent)
   {
     // Align each float to 1234.67, i.e. 3.6 will be "   3.60"
-    fprintf( stderr, "%s, checking\n"
-             "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n"
-             "%7.2f %7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f %7.2f\n"
-             "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n"
-             "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n",
-             location,
-             m1[0], m1[4], m1[8],  m1[12],    m2[0], m2[4], m2[8],  m2[12],
-             m1[1], m1[5], m1[9],  m1[13],    m2[1], m2[5], m2[9],  m2[13],
-             m1[2], m1[6], m1[10], m1[14],    m2[2], m2[6], m2[10], m2[14],
-             m1[3], m1[7], m1[11], m1[15],    m2[3], m2[7], m2[11], m2[15] );
+    // clang-format off
+    fprintf(stderr, "%s, checking\n"
+            "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f %7.2f == %7.2f %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n"
+            "%7.2f %7.2f %7.2f %7.2f    %7.2f %7.2f %7.2f %7.2f\n",
+            location,
+            m1[0],m1[4],m1[8],m1[12],m2[0],m2[4],m2[8],m2[12],
+            m1[1],m1[5],m1[9],m1[13],m2[1],m2[5],m2[9],m2[13],
+            m1[2],m1[6],m1[10],m1[14],m2[2],m2[6],m2[10],m2[14],
+            m1[3],m1[7],m1[11],m1[15],m2[3],m2[7],m2[11],m2[15]);
+    // clang-format on
 
     tet_result(TET_FAIL);
     throw("TET_FAIL");
@@ -235,30 +241,29 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsil
   }
 }
 
-
 /**
  * Test whether two strings are equal.
  * @param[in] str1 The first string
  * @param[in] str2 The second string
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const std::string &str1, const char* str2, const char* location)
+void DALI_TEST_EQUALS(const std::string& str1, const char* str2, const char* location)
 {
   DALI_TEST_EQUALS(str1.c_str(), str2, location);
 }
 
-void DALI_TEST_EQUALS( Property::Value& str1, const char* str2, const char* location)
+void DALI_TEST_EQUALS(Property::Value& str1, const char* str2, const char* location)
 {
   bool result = false;
 
-  if( str1.GetType() == Property::STRING )
+  if(str1.GetType() == Property::STRING)
   {
     std::string string;
     str1.Get(string);
     result = !string.compare(str2);
   }
 
-  if( result )
+  if(result)
   {
     tet_result(TET_PASS);
   }
@@ -269,16 +274,16 @@ void DALI_TEST_EQUALS( Property::Value& str1, const char* str2, const char* loca
   }
 }
 
-void DALI_TEST_EQUALS( const char* str1, const std::string &str2, const char* location)
+void DALI_TEST_EQUALS(const char* str1, const std::string& str2, const char* location)
 {
   DALI_TEST_EQUALS(str1, str2.c_str(), location);
 }
 
-void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const char* location )
+void DALI_TEST_ASSERT(DaliException& e, std::string conditionSubString, const char* location)
 {
-  if( NULL == strstr( e.condition, conditionSubString.c_str() ) )
+  if(NULL == strstr(e.condition, conditionSubString.c_str()))
   {
-    fprintf(stderr, "Expected substring '%s' : actual exception string '%s' : location %s\n", conditionSubString.c_str(), e.condition, location );
+    fprintf(stderr, "Expected substring '%s' : actual exception string '%s' : location %s\n", conditionSubString.c_str(), e.condition, location);
     tet_result(TET_FAIL);
     throw("TET_FAIL");
   }
@@ -289,12 +294,12 @@ void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const c
 }
 
 // Functor to test whether an Applied signal is emitted
-ConstraintAppliedCheck::ConstraintAppliedCheck( bool& signalReceived )
-: mSignalReceived( signalReceived )
+ConstraintAppliedCheck::ConstraintAppliedCheck(bool& signalReceived)
+: mSignalReceived(signalReceived)
 {
 }
 
-void ConstraintAppliedCheck::operator()( Constraint& constraint )
+void ConstraintAppliedCheck::operator()(Constraint& constraint)
 {
   mSignalReceived = true;
 }
@@ -306,75 +311,74 @@ void ConstraintAppliedCheck::Reset()
 
 void ConstraintAppliedCheck::CheckSignalReceived()
 {
-  if ( !mSignalReceived )
+  if(!mSignalReceived)
   {
-    fprintf(stderr,  "Expected Applied signal was not received\n" );
-    tet_result( TET_FAIL );
+    fprintf(stderr, "Expected Applied signal was not received\n");
+    tet_result(TET_FAIL);
     throw("TET_FAIL");
   }
   else
   {
-    tet_result( TET_PASS );
+    tet_result(TET_PASS);
   }
 }
 
 void ConstraintAppliedCheck::CheckSignalNotReceived()
 {
-  if ( mSignalReceived )
+  if(mSignalReceived)
   {
-    fprintf(stderr,  "Unexpected Applied signal was received\n" );
-    tet_result( TET_FAIL );
+    fprintf(stderr, "Unexpected Applied signal was received\n");
+    tet_result(TET_FAIL);
     throw("TET_FAIL");
   }
   else
   {
-    tet_result( TET_PASS );
+    tet_result(TET_PASS);
   }
 }
 
 namespace Test
 {
-
 struct ObjectDestructionFunctor
 {
   // Create a ObjectDestructionFunctor passing in a Dali::RefObject* to be monitored and a bool variable.
   // Create ObjectRegistry instance and connect to the ObjectDestroyedSignal passing in the above functor for the callback.
   // Get the ObjectPointer (Actor::GetObjectPtr) of the Actor to be checked for destruction and assign it to the Dali::RefObject*
   // Check the bool variable which would be true when object destroyed.
-  ObjectDestructionFunctor( Dali::RefObject* objectPtr, bool& refObjectDestroyed )
-  : refObjectPointerToCheck( objectPtr ),
-    refObjectDestroyedBoolean( refObjectDestroyed )
+  ObjectDestructionFunctor(Dali::RefObject* objectPtr, bool& refObjectDestroyed)
+  : refObjectPointerToCheck(objectPtr),
+    refObjectDestroyedBoolean(refObjectDestroyed)
   {
     refObjectDestroyed = false;
   }
 
-  void operator()( const Dali::RefObject* objectPointer )
+  void operator()(const Dali::RefObject* objectPointer)
   {
-    if ( refObjectPointerToCheck == objectPointer )
+    if(refObjectPointerToCheck == objectPointer)
     {
       refObjectDestroyedBoolean = true;
     }
   }
 
   Dali::RefObject* refObjectPointerToCheck;
-  bool& refObjectDestroyedBoolean;
+  bool&            refObjectDestroyedBoolean;
 };
 
-ObjectDestructionTracker::ObjectDestructionTracker( ObjectRegistry objectRegistry )
-: mObjectRegistry( objectRegistry ),
-  mRefObjectDestroyed( false)
+ObjectDestructionTracker::ObjectDestructionTracker(ObjectRegistry objectRegistry)
+: mObjectRegistry(objectRegistry),
+  mRefObjectDestroyed(false)
 {
 }
 
-void ObjectDestructionTracker::Start( Actor actor )
+void ObjectDestructionTracker::Start(Actor actor)
 {
-  ObjectDestructionFunctor destructionFunctor( actor.GetObjectPtr(), mRefObjectDestroyed );
-  mObjectRegistry.ObjectDestroyedSignal().Connect( this, destructionFunctor );
+  ObjectDestructionFunctor destructionFunctor(actor.GetObjectPtr(), mRefObjectDestroyed);
+  mObjectRegistry.ObjectDestroyedSignal().Connect(this, destructionFunctor);
 }
 
 bool ObjectDestructionTracker::IsDestroyed()
 {
-   return mRefObjectDestroyed;
+  return mRefObjectDestroyed;
 }
 
 } // namespace Test
index 7ba3196..2c1c703 100644 (file)
@@ -21,8 +21,8 @@
 // EXTERNAL INCLUDES
 #include <cstdarg>
 #include <cstdio>
-#include <iostream>
 #include <cstring>
+#include <iostream>
 #include <string>
 
 // INTERNAL INCLUDES
 
 extern "C"
 {
-void tet_infoline(const char*str);
-void tet_printf(const char *format, ...);
+  void tet_infoline(const char* str);
+  void tet_printf(const char* format, ...);
 }
 
-#include "test-application.h"
 #include "test-actor-utils.h"
+#include "test-application.h"
 #include "test-gesture-generator.h"
 
 using namespace Dali;
@@ -48,21 +48,21 @@ using namespace Dali;
  * Inspired by https://stackoverflow.com/questions/1706346/file-macro-manipulation-handling-at-compile-time
  * answer by Chetan Reddy
  */
-constexpr int32_t basenameIndex( const char * const path, const int32_t index = 0, const int32_t slashIndex = -1 )
+constexpr int32_t basenameIndex(const char* const path, const int32_t index = 0, const int32_t slashIndex = -1)
 {
-   return path[ index ]
-       ? ( path[ index ] == '/'
-           ? basenameIndex( path, index + 1, index )
-           : basenameIndex( path, index + 1, slashIndex ) )
-       : ( slashIndex + 1 );
+  return path[index]
+           ? (path[index] == '/'
+                ? basenameIndex(path, index + 1, index)
+                : basenameIndex(path, index + 1, slashIndex))
+           : (slashIndex + 1);
 }
 
-#define __FILELINE__ ( { static const int32_t basenameIdx = basenameIndex( __FILE__ ); \
+#define __FILELINE__ ({ static const int32_t basenameIdx = basenameIndex( __FILE__ ); \
                          static_assert (basenameIdx >= 0, "compile-time basename" );   \
-                         __FILE__ ":" STRINGIZE(__LINE__) + basenameIdx ; } )
+                         __FILE__ ":" STRINGIZE(__LINE__) + basenameIdx ; })
 
 #define TEST_LOCATION __FILELINE__
-#define TEST_INNER_LOCATION(x) ( std::string(x) + " (" + STRINGIZE(__LINE__) + ")" ).c_str()
+#define TEST_INNER_LOCATION(x) (std::string(x) + " (" + STRINGIZE(__LINE__) + ")").c_str()
 
 #define TET_UNDEF 2
 #define TET_FAIL 1
@@ -73,33 +73,32 @@ extern int32_t test_return_value;
 void tet_result(int32_t value);
 
 #define END_TEST \
-  return ((test_return_value>0)?1:0)
+  return ((test_return_value > 0) ? 1 : 0)
 
 void tet_infoline(const char* str);
-void tet_printf(const char *format, ...);
+void tet_printf(const charformat, ...);
 
 /**
  * DALI_TEST_CHECK is a wrapper for tet_result.
  * If the condition evaluates to false, the test is stopped.
  * @param[in] The boolean expression to check
  */
-#define DALI_TEST_CHECK(condition)                                                        \
-if ( (condition) )                                                                        \
-{                                                                                         \
-  tet_result(TET_PASS);                                                                   \
-}                                                                                         \
-else                                                                                      \
-{                                                                                         \
-  fprintf(stderr, "Test failed in %s, condition: %s\n", __FILELINE__, #condition );       \
-  tet_result(TET_FAIL);                                                                   \
-  throw("TET_FAIL");                                                                      \
-}
-
+#define DALI_TEST_CHECK(condition)                                                   \
+  if((condition))                                                                    \
+  {                                                                                  \
+    tet_result(TET_PASS);                                                            \
+  }                                                                                  \
+  else                                                                               \
+  {                                                                                  \
+    fprintf(stderr, "Test failed in %s, condition: %s\n", __FILELINE__, #condition); \
+    tet_result(TET_FAIL);                                                            \
+    throw("TET_FAIL");                                                               \
+  }
 
-bool operator==(TimePeriod a, TimePeriod b);
-std::ostream& operator<<( std::ostream& ostream, TimePeriod value );
-std::ostream& operator<<( std::ostream& ostream, Radian angle );
-std::ostream& operator<<( std::ostream& ostream, Degree angle );
+bool          operator==(TimePeriod a, TimePeriod b);
+std::ostream& operator<<(std::ostream& ostream, TimePeriod value);
+std::ostream& operator<<(std::ostream& ostream, Radian angle);
+std::ostream& operator<<(std::ostream& ostream, Degree angle);
 
 /**
  * Test whether two values are equal.
@@ -110,13 +109,13 @@ std::ostream& operator<<( std::ostream& ostream, Degree angle );
 template<typename Type>
 inline void DALI_TEST_EQUALS(Type value1, Type value2, const char* location)
 {
-  if( !CompareType<Type>(value1, value2, 0.01f) )
+  if(!CompareType<Type>(value1, value2, 0.01f))
   {
     std::ostringstream o;
     o << value1 << " == " << value2 << std::endl;
     fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
     tet_result(TET_FAIL);
-    throw("TET_FAIL");                                                                      \
+    throw("TET_FAIL");
   }
   else
   {
@@ -129,18 +128,18 @@ inline void DALI_TEST_EQUALS(Type value1, Type value2, const char* location)
  * @param[in] value1 The first value
  * @param[in] value2 The second value
  */
-#define DALI_TEST_EQUAL( v1, v2 ) DALI_TEST_EQUALS( v1, v2, __FILELINE__ )
+#define DALI_TEST_EQUAL(v1, v2) DALI_TEST_EQUALS(v1, v2, __FILELINE__)
 
 template<typename Type>
 inline void DALI_TEST_EQUALS(Type value1, Type value2, float epsilon, const char* location)
 {
-  if( !CompareType<Type>(value1, value2, epsilon) )
+  if(!CompareType<Type>(value1, value2, epsilon))
   {
     std::ostringstream o;
     o << value1 << " == " << value2 << std::endl;
     fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
     tet_result(TET_FAIL);
-    throw("TET_FAIL");                                                                      \
+    throw("TET_FAIL");
   }
   else
   {
@@ -151,13 +150,13 @@ inline void DALI_TEST_EQUALS(Type value1, Type value2, float epsilon, const char
 template<typename Type>
 inline void DALI_TEST_NOT_EQUALS(Type value1, Type value2, float epsilon, const char* location)
 {
-  if( CompareType<Type>(value1, value2, epsilon) )
+  if(CompareType<Type>(value1, value2, epsilon))
   {
     std::ostringstream o;
     o << value1 << " !=  " << value2 << std::endl;
     fprintf(stderr, "Test failed in %s, checking %s", location, o.str().c_str());
     tet_result(TET_FAIL);
-    throw("TET_FAIL");                                                                      \
+    throw("TET_FAIL");
   }
   else
   {
@@ -165,7 +164,6 @@ inline void DALI_TEST_NOT_EQUALS(Type value1, Type value2, float epsilon, const
   }
 }
 
-
 /**
  * Test whether two TimePeriods are within a certain distance of each other.
  * @param[in] value1 The first value
@@ -174,19 +172,19 @@ inline void DALI_TEST_NOT_EQUALS(Type value1, Type value2, float epsilon, const
  * @param[in] location The TEST_LOCATION macro should be used here
  */
 template<>
-inline void DALI_TEST_EQUALS<TimePeriod>( TimePeriod value1, TimePeriod value2, float epsilon, const char* location)
+inline void DALI_TEST_EQUALS<TimePeriod>(TimePeriod value1, TimePeriod value2, float epsilon, const char* location)
 {
-  if ((fabs(value1.durationSeconds - value2.durationSeconds) > epsilon))
+  if((fabs(value1.durationSeconds - value2.durationSeconds) > epsilon))
   {
     fprintf(stderr, "Test failed in %s, checking durations %f == %f, epsilon %f\n", location, value1.durationSeconds, value2.durationSeconds, epsilon);
     tet_result(TET_FAIL);
-    throw("TET_FAIL");                                                                      \
+    throw("TET_FAIL");
   }
-  else if ((fabs(value1.delaySeconds - value2.delaySeconds) > epsilon))
+  else if((fabs(value1.delaySeconds - value2.delaySeconds) > epsilon))
   {
     fprintf(stderr, "Test failed in %s, checking delays %f == %f, epsilon %f\n", location, value1.delaySeconds, value2.delaySeconds, epsilon);
     tet_result(TET_FAIL);
-    throw("TET_FAIL");                                                                      \
+    throw("TET_FAIL");
   }
   else
   {
@@ -200,7 +198,7 @@ inline void DALI_TEST_EQUALS<TimePeriod>( TimePeriod value1, TimePeriod value2,
  * @param[in] baseHandle2 The second value
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location );
+void DALI_TEST_EQUALS(const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location);
 
 /**
  * Test whether a size_t value and an uint32_t are equal.
@@ -208,7 +206,7 @@ void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHand
  * @param[in] value2 The second value
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location );
+void DALI_TEST_EQUALS(const size_t value1, const uint32_t value2, const char* location);
 
 /**
  * Test whether an uint32_t and a size_t value and are equal.
@@ -216,7 +214,7 @@ void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* l
  * @param[in] value2 The second value
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* location );
+void DALI_TEST_EQUALS(const uint32_t value1, const size_t value2, const char* location);
 
 /**
  * Test whether two Matrix3 objects are equal.
@@ -224,7 +222,7 @@ void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* l
  * @param[in] matrix2 The second object
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location);
+void DALI_TEST_EQUALS(const Matrix3& matrix1, const Matrix3& matrix2, const char* location);
 
 /** Test whether two Matrix3 objects are equal (fuzzy compare).
  * @param[in] matrix1 The first object
@@ -232,7 +230,7 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const cha
  * @param[in] epsilon The epsilon to use for comparison
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float epsilon, const char* location);
+void DALI_TEST_EQUALS(const Matrix3& matrix1, const Matrix3& matrix2, float epsilon, const char* location);
 
 /**
  * Test whether two Matrix objects are equal.
@@ -240,7 +238,7 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float eps
  * @param[in] matrix2 The second object
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char* location);
+void DALI_TEST_EQUALS(const Matrix& matrix1, const Matrix& matrix2, const char* location);
 
 /**
  * Test whether two Matrix objects are equal (fuzzy-compare).
@@ -248,7 +246,7 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char*
  * @param[in] matrix2 The second object
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsilon, const char* location);
+void DALI_TEST_EQUALS(const Matrix& matrix1, const Matrix& matrix2, float epsilon, const char* location);
 
 /**
  * Test whether two strings are equal.
@@ -257,13 +255,13 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsil
  * @param[in] location The TEST_LOCATION macro should be used here
  */
 template<>
-inline void DALI_TEST_EQUALS<const char*>( const char* str1, const char* str2, const char* location)
+inline void DALI_TEST_EQUALS<const char*>(const char* str1, const char* str2, const char* location)
 {
-  if (strcmp(str1, str2))
+  if(strcmp(str1, str2))
   {
     fprintf(stderr, "Test failed in %s, checking '%s' == '%s'\n", location, str1, str2);
     tet_result(TET_FAIL);
-    throw("TET_FAIL");                                                                      \
+    throw("TET_FAIL");
   }
   else
   {
@@ -278,7 +276,7 @@ inline void DALI_TEST_EQUALS<const char*>( const char* str1, const char* str2, c
  * @param[in] location The TEST_LOCATION macro should be used here
  */
 template<>
-inline void DALI_TEST_EQUALS<const std::string&>( const std::string &str1, const std::string &str2, const char* location)
+inline void DALI_TEST_EQUALS<const std::string&>(const std::string& str1, const std::string& str2, const char* location)
 {
   DALI_TEST_EQUALS(str1.c_str(), str2.c_str(), location);
 }
@@ -289,7 +287,7 @@ inline void DALI_TEST_EQUALS<const std::string&>( const std::string &str1, const
  * @param[in] str2 The second string
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( Property::Value& str1, const char* str2, const char* location);
+void DALI_TEST_EQUALS(Property::Value& str1, const char* str2, const char* location);
 
 /**
  * Test whether two strings are equal.
@@ -297,7 +295,7 @@ void DALI_TEST_EQUALS( Property::Value& str1, const char* str2, const char* loca
  * @param[in] str2 The second string
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const std::string &str1, const char* str2, const char* location);
+void DALI_TEST_EQUALS(const std::string& str1, const char* str2, const char* location);
 
 /**
  * Test whether two strings are equal.
@@ -305,19 +303,18 @@ void DALI_TEST_EQUALS( const std::string &str1, const char* str2, const char* lo
  * @param[in] str2 The second string
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const char* str1, const std::string &str2, const char* location);
+void DALI_TEST_EQUALS(const char* str1, const std::string& str2, const char* location);
 
 /**
  * Test if a property value type is equal to a trivial type.
  */
 template<typename Type>
-inline void DALI_TEST_VALUE_EQUALS( Property::Value&& value1, Type value2, float epsilon, const char* location)
+inline void DALI_TEST_VALUE_EQUALS(Property::Value&& value1, Type value2, float epsilon, const char* location)
 {
   Property::Value value2b(value2);
   DALI_TEST_EQUALS(value1, value2b, epsilon, location);
 }
 
-
 /**
  * Test whether one unsigned integer value is greater than another.
  * Test succeeds if value1 > value2
@@ -325,14 +322,14 @@ inline void DALI_TEST_VALUE_EQUALS( Property::Value&& value1, Type value2, float
  * @param[in] value2 The second value
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-template< typename T >
-void DALI_TEST_GREATER( T value1, T value2, const char* location)
+template<typename T>
+void DALI_TEST_GREATER(T value1, T value2, const char* location)
 {
-  if (!(value1 > value2))
+  if(!(value1 > value2))
   {
-    std::cerr << "Test failed in " << location << ", checking " << value1 <<" > " << value2 << "\n";
+    std::cerr << "Test failed in " << location << ", checking " << value1 << " > " << value2 << "\n";
     tet_result(TET_FAIL);
-    throw("TET_FAIL");                                                                      \
+    throw("TET_FAIL");
   }
   else
   {
@@ -348,15 +345,15 @@ void DALI_TEST_GREATER( T value1, T value2, const char* location)
  *                               assertion which triggered the exception.
  * @param[in] location The TEST_LOCATION macro should be used here.
  */
-void DALI_TEST_ASSERT( DaliException& e, std::string conditionSubString, const char* location );
+void DALI_TEST_ASSERT(DaliException& e, std::string conditionSubString, const char* location);
 
 /**
  * Print the assert
  * @param[in] e The exception that we expect was fired by a runtime assertion failure.
  */
-inline void DALI_TEST_PRINT_ASSERT( DaliException& e )
+inline void DALI_TEST_PRINT_ASSERT(DaliException& e)
 {
-  tet_printf("Assertion %s failed at %s\n", e.condition, e.location );
+  tet_printf("Assertion %s failed at %s\n", e.condition, e.location);
 }
 
 /**
@@ -366,41 +363,42 @@ inline void DALI_TEST_PRINT_ASSERT( DaliException& e )
  * @param expressions code to execute
  * @param assertstring the substring expected in the assert
  */
-#define DALI_TEST_ASSERTION( expressions, assertstring ) \
-try \
-{ \
-  TestApplication::EnableLogging( false ); \
-  expressions; \
-  TestApplication::EnableLogging( true ); \
-  fprintf(stderr, "Test failed in %s, expected assert: '%s' didn't occur\n", __FILELINE__, assertstring ); \
-  tet_result(TET_FAIL); \
-  throw("TET_FAIL"); } \
-catch( Dali::DaliException& e ) \
-{ \
-  DALI_TEST_ASSERT( e, assertstring, TEST_LOCATION ); \
-}
+#define DALI_TEST_ASSERTION(expressions, assertstring)                                                      \
+  try                                                                                                       \
+  {                                                                                                         \
+    TestApplication::EnableLogging(false);                                                                  \
+    expressions;                                                                                            \
+    TestApplication::EnableLogging(true);                                                                   \
+    fprintf(stderr, "Test failed in %s, expected assert: '%s' didn't occur\n", __FILELINE__, assertstring); \
+    tet_result(TET_FAIL);                                                                                   \
+    throw("TET_FAIL");                                                                                      \
+  }                                                                                                         \
+  catch(Dali::DaliException & e)                                                                            \
+  {                                                                                                         \
+    DALI_TEST_ASSERT(e, assertstring, TEST_LOCATION);                                                       \
+  }
 
 // Functor to test whether an Applied signal is emitted
 struct ConstraintAppliedCheck
 {
-  ConstraintAppliedCheck( bool& signalReceived );
-  void operator()( Constraint& constraint );
-  void Reset();
-  void CheckSignalReceived();
-  void CheckSignalNotReceived();
+  ConstraintAppliedCheck(bool& signalReceived);
+  void  operator()(Constraint& constraint);
+  void  Reset();
+  void  CheckSignalReceived();
+  void  CheckSignalNotReceived();
   bool& mSignalReceived; // owned by individual tests
 };
 
 /**
  * A Helper to test default functions
  */
-template <typename T>
+template<typename T>
 struct DefaultFunctionCoverage
 {
   DefaultFunctionCoverage()
   {
-    T a;
-    T *b = new T(a);
+    T  a;
+    Tb = new T(a);
     DALI_TEST_CHECK(b);
     a = *b;
     delete b;
@@ -422,19 +420,18 @@ namespace Test
 class ObjectDestructionTracker : public ConnectionTracker
 {
 public:
-
   /**
    * @brief Call in main part of code
    * @param[in] objectRegistry The object Registry being used
    */
-  ObjectDestructionTracker( ObjectRegistry objectRegistry );
+  ObjectDestructionTracker(ObjectRegistry objectRegistry);
 
   /**
    * @brief Call in sub bock of code where the Actor being checked is still alive.
    *
    * @param[in] actor Actor to be checked for destruction
    */
-  void Start( Actor actor );
+  void Start(Actor actor);
 
   /**
    * @brief Call to check if Actor alive or destroyed.
@@ -445,7 +442,7 @@ public:
 
 private:
   ObjectRegistry mObjectRegistry;
-  bool mRefObjectDestroyed;
+  bool           mRefObjectDestroyed;
 };
 
 } // namespace Test
index 3d7c359..0693c43 100644 (file)
 
 namespace Dali
 {
-
 Shader CreateShader()
 {
-  return Shader::New( "vertexSrc", "fragmentSrc" );
+  return Shader::New("vertexSrc", "fragmentSrc");
 }
 
 TextureSet CreateTextureSet()
@@ -31,7 +30,7 @@ TextureSet CreateTextureSet()
   return TextureSet::New();
 }
 
-TextureSet CreateTextureSet( Texture texture )
+TextureSet CreateTextureSet(Texture texture)
 {
   TextureSet textureSet = TextureSet::New();
   textureSet.SetTexture(0u, texture);
@@ -41,34 +40,36 @@ TextureSet CreateTextureSet( Texture texture )
 VertexBuffer CreateVertexBuffer()
 {
   Property::Map texturedQuadVertexFormat;
-  texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
+  texturedQuadVertexFormat["aPosition"]    = Property::VECTOR2;
   texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
 
-  VertexBuffer vertexData = VertexBuffer::New( texturedQuadVertexFormat );
+  VertexBuffer vertexData = VertexBuffer::New(texturedQuadVertexFormat);
   return vertexData;
 }
 
 Geometry CreateQuadGeometry(void)
 {
-  VertexBuffer vertexData = CreateVertexBuffer();
-  const float halfQuadSize = .5f;
-  struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
+  VertexBuffer vertexData   = CreateVertexBuffer();
+  const float  halfQuadSize = .5f;
+  struct TexturedQuadVertex
+  {
+    Vector2 position;
+    Vector2 textureCoordinates;
+  };
   TexturedQuadVertex texturedQuadVertexData[4] = {
-    { Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f) },
-    { Vector2( halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f) },
-    { Vector2(-halfQuadSize,  halfQuadSize), Vector2(0.f, 1.f) },
-    { Vector2( halfQuadSize,  halfQuadSize), Vector2(1.f, 1.f) } };
+    {Vector2(-halfQuadSize, -halfQuadSize), Vector2(0.f, 0.f)},
+    {Vector2(halfQuadSize, -halfQuadSize), Vector2(1.f, 0.f)},
+    {Vector2(-halfQuadSize, halfQuadSize), Vector2(0.f, 1.f)},
+    {Vector2(halfQuadSize, halfQuadSize), Vector2(1.f, 1.f)}};
   vertexData.SetData(texturedQuadVertexData, 4);
 
-  unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+  unsigned short indexData[6] = {0, 3, 1, 0, 2, 3};
 
   Geometry geometry = Geometry::New();
-  geometry.AddVertexBuffer( vertexData );
-  geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
+  geometry.AddVertexBuffer(vertexData);
+  geometry.SetIndexBuffer(indexData, sizeof(indexData) / sizeof(indexData[0]));
 
   return geometry;
 }
 
-
-
 } // namespace Dali
index e593d38..d5c61b0 100644 (file)
 
 namespace Dali
 {
-
-Shader CreateShader();
-TextureSet CreateTextureSet();
-TextureSet CreateTextureSet( Texture texture );
-Geometry CreateQuadGeometry();
+Shader       CreateShader();
+TextureSet   CreateTextureSet();
+TextureSet   CreateTextureSet(Texture texture);
+Geometry     CreateQuadGeometry();
 VertexBuffer CreateVertexBuffer();
 
-}
+} // namespace Dali
 
 #endif // MESH_BUILDER_H
index 5d45a12..2db4dbc 100644 (file)
 
 namespace Dali
 {
-
 namespace
 {
-
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
-  attribute mediump vec2 aPosition;\n
-  uniform mediump mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
-  \n
-  void main()\n
-  {\n
-    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
-    vertexPosition.xyz *= uSize;\n
-    gl_Position = uMvpMatrix * vertexPosition;\n
-  }\n
-);
+  attribute mediump vec2   aPosition;\n
+    uniform mediump mat4   uMvpMatrix;\n
+      uniform mediump vec3 uSize;\n
+  \n void main()\n {
+        \n
+          mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);
+        \n
+          vertexPosition.xyz *= uSize;
+        \n
+          gl_Position = uMvpMatrix * vertexPosition;
+        \n
+      }\n);
 
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
-  \n
-  void main()\n
-  {\n
-    gl_FragColor = uColor;\n
-  }\n
-);
+  \n void main()\n {
+    \n
+      gl_FragColor = uColor;
+    \n
+  }\n);
 
 } // unnamed namespace
 
 Actor CreateRenderableActor()
 {
-  return CreateRenderableActor( Texture(), VERTEX_SHADER, FRAGMENT_SHADER );
+  return CreateRenderableActor(Texture(), VERTEX_SHADER, FRAGMENT_SHADER);
 }
 
-Actor CreateRenderableActor( Texture texture )
+Actor CreateRenderableActor(Texture texture)
 {
-  return CreateRenderableActor( texture, VERTEX_SHADER, FRAGMENT_SHADER );
+  return CreateRenderableActor(texture, VERTEX_SHADER, FRAGMENT_SHADER);
 }
 
-Actor CreateRenderableActor( Texture texture, const std::string& vertexShader, const std::string& fragmentShader )
+Actor CreateRenderableActor(Texture texture, const std::string& vertexShader, const std::string& fragmentShader)
 {
   // Create the geometry
   Geometry geometry = CreateQuadGeometry();
 
   // Create Shader
-  Shader shader = Shader::New( vertexShader, fragmentShader );
+  Shader shader = Shader::New(vertexShader, fragmentShader);
 
   // Create renderer from geometry and material
-  Renderer renderer = Renderer::New( geometry, shader );
+  Renderer renderer = Renderer::New(geometry, shader);
 
   // Create actor and set renderer
   Actor actor = Actor::New();
-  actor.AddRenderer( renderer );
+  actor.AddRenderer(renderer);
 
   // If we a texture, then create a texture-set and add to renderer
-  if( texture )
+  if(texture)
   {
     TextureSet textureSet = TextureSet::New();
-    textureSet.SetTexture( 0u, texture );
-    renderer.SetTextures( textureSet );
+    textureSet.SetTexture(0u, texture);
+    renderer.SetTextures(textureSet);
 
     // Set actor to the size of the texture if set
-    actor.SetProperty( Actor::Property::SIZE, Vector2( texture.GetWidth(), texture.GetHeight() ) );
+    actor.SetProperty(Actor::Property::SIZE, Vector2(texture.GetWidth(), texture.GetHeight()));
   }
 
   return actor;
index 4a8716e..be085bf 100644 (file)
@@ -23,7 +23,6 @@
 
 namespace Dali
 {
-
 class Actor;
 class Image;
 class Texture;
@@ -39,7 +38,7 @@ Actor CreateRenderableActor();
  * @param[in] texture Texture to set.
  * @return An actor with a renderer.
  */
-Actor CreateRenderableActor( Texture texture );
+Actor CreateRenderableActor(Texture texture);
 
 /**
  * @brief Creates a renderable-actor with a texture and custom shaders.
@@ -48,7 +47,7 @@ Actor CreateRenderableActor( Texture texture );
  * @param[in] fragmentShader The fragment-shader.
  * @return An actor with a renderer.
  */
-Actor CreateRenderableActor( Texture texture, const std::string& vertexShader, const std::string& fragmentShader );
+Actor CreateRenderableActor(Texture texture, const std::string& vertexShader, const std::string& fragmentShader);
 
 } // namespace Dali
 
index b2a3fb9..062276a 100644 (file)
 
 namespace Dali
 {
-
 bool TestApplication::mLoggingEnabled = true;
 
-TestApplication::TestApplication( uint32_t surfaceWidth,
-                                  uint32_t surfaceHeight,
-                                  uint32_t  horizontalDpi,
-                                  uint32_t  verticalDpi,
-                                  bool initialize,
-                                  bool enablePartialUpdate )
-: mCore( NULL ),
-  mSurfaceWidth( surfaceWidth ),
-  mSurfaceHeight( surfaceHeight ),
-  mFrame( 0u ),
-  mDpi{ horizontalDpi, verticalDpi },
+TestApplication::TestApplication(uint32_t surfaceWidth,
+                                 uint32_t surfaceHeight,
+                                 uint32_t horizontalDpi,
+                                 uint32_t verticalDpi,
+                                 bool     initialize,
+                                 bool     enablePartialUpdate)
+: mCore(NULL),
+  mSurfaceWidth(surfaceWidth),
+  mSurfaceHeight(surfaceHeight),
+  mFrame(0u),
+  mDpi{horizontalDpi, verticalDpi},
   mLastVSyncTime(0u),
   mPartialUpdateEnabled(enablePartialUpdate)
 {
-  if( initialize )
+  if(initialize)
   {
     Initialize();
   }
@@ -54,15 +53,15 @@ void TestApplication::CreateCore()
   // We always need the first update!
   mStatus.keepUpdating = Integration::KeepUpdating::STAGE_KEEP_RENDERING;
 
-  mCore = Dali::Integration::Core::New( mRenderController,
-                                        mPlatformAbstraction,
-                                        mGlAbstraction,
-                                        mGlSyncAbstraction,
-                                        mGlContextHelperAbstraction,
-                                        Integration::RenderToFrameBuffer::FALSE,
-                                        Integration::DepthBufferAvailable::TRUE,
-                                        Integration::StencilBufferAvailable::TRUE,
-                                        mPartialUpdateEnabled ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE );
+  mCore = Dali::Integration::Core::New(mRenderController,
+                                       mPlatformAbstraction,
+                                       mGlAbstraction,
+                                       mGlSyncAbstraction,
+                                       mGlContextHelperAbstraction,
+                                       Integration::RenderToFrameBuffer::FALSE,
+                                       Integration::DepthBufferAvailable::TRUE,
+                                       Integration::StencilBufferAvailable::TRUE,
+                                       mPartialUpdateEnabled ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE);
 
   mCore->ContextCreated();
 
@@ -70,15 +69,15 @@ void TestApplication::CreateCore()
   Dali::Integration::Log::InstallLogFunction(logFunction);
 
   Dali::Integration::Trace::LogContextFunction logContextFunction(&TestApplication::LogContext);
-  Dali::Integration::Trace::InstallLogContextFunction( logContextFunction );
+  Dali::Integration::Trace::InstallLogContextFunction(logContextFunction);
 
-  Dali::Integration::Trace::LogContext( true, "Test" );
+  Dali::Integration::Trace::LogContext(true, "Test");
 }
 
 void TestApplication::CreateScene()
 {
-  mScene = Dali::Integration::Scene::New( Size( static_cast<float>( mSurfaceWidth ), static_cast<float>( mSurfaceHeight ) ) );
-  mScene.SetDpi( Vector2( static_cast<float>( mDpi.x ), static_cast<float>( mDpi.y ) ) );
+  mScene = Dali::Integration::Scene::New(Size(static_cast<float>(mSurfaceWidth), static_cast<float>(mSurfaceHeight)));
+  mScene.SetDpi(Vector2(static_cast<float>(mDpi.x), static_cast<float>(mDpi.y)));
 }
 
 void TestApplication::InitializeCore()
@@ -93,9 +92,9 @@ TestApplication::~TestApplication()
   delete mCore;
 }
 
-void TestApplication::LogContext( bool start, const char* tag )
+void TestApplication::LogContext(bool start, const char* tag)
 {
-  if( start )
+  if(start)
   {
     fprintf(stderr, "INFO: Trace Start: %s\n", tag);
   }
@@ -107,7 +106,7 @@ void TestApplication::LogContext( bool start, const char* tag )
 
 void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
 {
-  if( mLoggingEnabled )
+  if(mLoggingEnabled)
   {
     switch(level)
     {
@@ -168,37 +167,37 @@ void TestApplication::SendNotification()
   mCore->ProcessEvents();
 }
 
-void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location )
+void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* location)
 {
-  if( GetUpdateStatus() == 0 &&
-      mRenderStatus.NeedsUpdate() == false &&
-      ! GetRenderController().WasCalled(TestRenderController::RequestUpdateFunc) )
+  if(GetUpdateStatus() == 0 &&
+     mRenderStatus.NeedsUpdate() == false &&
+     !GetRenderController().WasCalled(TestRenderController::RequestUpdateFunc))
   {
-    fprintf(stderr, "WARNING - Update not required :%s\n", location==NULL?"NULL":location);
+    fprintf(stderr, "WARNING - Update not required :%s\n", location == NULL ? "NULL" : location);
   }
 
-  uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
-  float elapsedSeconds = static_cast<float>( intervalMilliseconds ) * 0.001f;
+  uint32_t nextVSyncTime  = mLastVSyncTime + intervalMilliseconds;
+  float    elapsedSeconds = static_cast<float>(intervalMilliseconds) * 0.001f;
 
-  mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false );
+  mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false);
 
   GetRenderController().Initialize();
 
   mLastVSyncTime = nextVSyncTime;
 }
 
-bool TestApplication::Render( uint32_t intervalMilliseconds, const char* location )
+bool TestApplication::Render(uint32_t intervalMilliseconds, const char* location)
 {
-  DoUpdate( intervalMilliseconds, location );
+  DoUpdate(intervalMilliseconds, location);
 
   // Reset the status
-  mRenderStatus.SetNeedsUpdate( false );
-  mRenderStatus.SetNeedsPostRender( false );
+  mRenderStatus.SetNeedsUpdate(false);
+  mRenderStatus.SetNeedsPostRender(false);
 
-  mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
-  mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ );
-  mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ );
-  mCore->PostRender( false /*do not skip rendering*/ );
+  mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
+  mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
+  mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
+  mCore->PostRender(false /*do not skip rendering*/);
 
   mFrame++;
 
@@ -209,7 +208,7 @@ bool TestApplication::PreRenderWithPartialUpdate(uint32_t intervalMilliseconds,
 {
   DoUpdate(intervalMilliseconds, location);
 
-  mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
+  mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
   mCore->PreRender(mScene, damagedRects);
 
   return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
@@ -231,9 +230,9 @@ uint32_t TestApplication::GetUpdateStatus()
   return mStatus.KeepUpdating();
 }
 
-bool TestApplication::UpdateOnly( uint32_t intervalMilliseconds  )
+bool TestApplication::UpdateOnly(uint32_t intervalMilliseconds)
 {
-  DoUpdate( intervalMilliseconds );
+  DoUpdate(intervalMilliseconds);
   return mStatus.KeepUpdating();
 }
 
@@ -247,13 +246,13 @@ bool TestApplication::GetRenderNeedsPostRender()
   return mRenderStatus.NeedsPostRender();
 }
 
-bool TestApplication::RenderOnly( )
+bool TestApplication::RenderOnly()
 {
   // Update Time values
-  mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
-  mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ );
-  mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ );
-  mCore->PostRender( false /*do not skip rendering*/ );
+  mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/);
+  mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/);
+  mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/);
+  mCore->PostRender(false /*do not skip rendering*/);
 
   mFrame++;
 
@@ -267,11 +266,11 @@ void TestApplication::ResetContext()
   mCore->ContextCreated();
 }
 
-uint32_t TestApplication::Wait( uint32_t durationToWait )
+uint32_t TestApplication::Wait(uint32_t durationToWait)
 {
   int time = 0;
 
-  for(uint32_t i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
+  for(uint32_t i = 0; i <= (durationToWait / RENDER_FRAME_INTERVAL); i++)
   {
     SendNotification();
     Render(RENDER_FRAME_INTERVAL);
@@ -280,4 +279,4 @@ uint32_t TestApplication::Wait( uint32_t durationToWait )
   return time;
 }
 
-} // Namespace dali
+} // namespace Dali
index e224c6b..7362505 100644 (file)
  */
 
 // INTERNAL INCLUDES
+#include <dali/integration-api/resource-policies.h>
+#include <dali/integration-api/scene.h>
+#include <dali/integration-api/trace.h>
+#include <dali/public-api/common/dali-common.h>
 #include <test-platform-abstraction.h>
-#include "test-gl-sync-abstraction.h"
+
 #include "test-gl-abstraction.h"
 #include "test-gl-context-helper-abstraction.h"
+#include "test-gl-sync-abstraction.h"
 #include "test-render-controller.h"
-#include <dali/public-api/common/dali-common.h>
-#include <dali/integration-api/resource-policies.h>
-#include <dali/integration-api/trace.h>
-#include <dali/integration-api/scene.h>
 
 namespace Dali
 {
-
 class DALI_CORE_API TestApplication : public ConnectionTracker
 {
 public:
-
   // Default values derived from H2 device.
-  static const uint32_t DEFAULT_SURFACE_WIDTH = 480;
+  static const uint32_t DEFAULT_SURFACE_WIDTH  = 480;
   static const uint32_t DEFAULT_SURFACE_HEIGHT = 800;
 
   static constexpr uint32_t DEFAULT_HORIZONTAL_DPI = 220;
@@ -47,39 +46,39 @@ public:
 
   static const uint32_t RENDER_FRAME_INTERVAL = 16;
 
-  TestApplication( uint32_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
-                   uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
-                   uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI,
-                   uint32_t verticalDpi   = DEFAULT_VERTICAL_DPI,
-                   bool initialize = true,
-                   bool enablePartialUpdate = false );
+  TestApplication(uint32_t surfaceWidth        = DEFAULT_SURFACE_WIDTH,
+                  uint32_t surfaceHeight       = DEFAULT_SURFACE_HEIGHT,
+                  uint32_t horizontalDpi       = DEFAULT_HORIZONTAL_DPI,
+                  uint32_t verticalDpi         = DEFAULT_VERTICAL_DPI,
+                  bool     initialize          = true,
+                  bool     enablePartialUpdate = false);
 
   void Initialize();
   void CreateCore();
   void CreateScene();
   void InitializeCore();
   ~TestApplication() override;
-  static void LogMessage( Dali::Integration::Log::DebugPriority level, std::string& message );
-  static void LogContext( bool start, const char* tag );
-  Dali::Integration::Core& GetCore();
-  TestPlatformAbstraction& GetPlatform();
-  TestRenderController& GetRenderController();
-  TestGlAbstraction& GetGlAbstraction();
-  TestGlSyncAbstraction& GetGlSyncAbstraction();
+  static void                     LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message);
+  static void                     LogContext(bool start, const char* tag);
+  Dali::Integration::Core&        GetCore();
+  TestPlatformAbstraction&        GetPlatform();
+  TestRenderController&           GetRenderController();
+  TestGlAbstraction&              GetGlAbstraction();
+  TestGlSyncAbstraction&          GetGlSyncAbstraction();
   TestGlContextHelperAbstraction& GetGlContextHelperAbstraction();
-  void ProcessEvent(const Integration::Event& event);
-  void SendNotification();
-  bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
-  bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
-  bool RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
-  uint32_t GetUpdateStatus();
-  bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
-  bool RenderOnly( );
-  void ResetContext();
-  bool GetRenderNeedsUpdate();
-  bool GetRenderNeedsPostRender();
-  uint32_t Wait( uint32_t durationToWait );
-  static void EnableLogging( bool enabled )
+  void                            ProcessEvent(const Integration::Event& event);
+  void                            SendNotification();
+  bool                            Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL);
+  bool                            PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
+  bool                            RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
+  uint32_t                        GetUpdateStatus();
+  bool                            UpdateOnly(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL);
+  bool                            RenderOnly();
+  void                            ResetContext();
+  bool                            GetRenderNeedsUpdate();
+  bool                            GetRenderNeedsPostRender();
+  uint32_t                        Wait(uint32_t durationToWait);
+  static void                     EnableLogging(bool enabled)
   {
     mLoggingEnabled = enabled;
   }
@@ -90,31 +89,35 @@ public:
   }
 
 private:
-  void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL );
+  void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL);
 
 protected:
-  TestPlatformAbstraction   mPlatformAbstraction;
-  TestRenderController      mRenderController;
-  TestGlAbstraction         mGlAbstraction;
-  TestGlSyncAbstraction     mGlSyncAbstraction;
+  TestPlatformAbstraction        mPlatformAbstraction;
+  TestRenderController           mRenderController;
+  TestGlAbstraction              mGlAbstraction;
+  TestGlSyncAbstraction          mGlSyncAbstraction;
   TestGlContextHelperAbstraction mGlContextHelperAbstraction;
 
   Integration::UpdateStatus mStatus;
   Integration::RenderStatus mRenderStatus;
 
-  Integration::Core* mCore;
+  Integration::Core*       mCore;
   Dali::Integration::Scene mScene;
 
   uint32_t mSurfaceWidth;
   uint32_t mSurfaceHeight;
   uint32_t mFrame;
 
-  struct { uint32_t x; uint32_t y; } mDpi;
-  uint32_t mLastVSyncTime;
-  bool mPartialUpdateEnabled;
+  struct
+  {
+    uint32_t x;
+    uint32_t y;
+  } mDpi;
+  uint32_t    mLastVSyncTime;
+  bool        mPartialUpdateEnabled;
   static bool mLoggingEnabled;
 };
 
-} // Dali
+} // namespace Dali
 
 #endif // DALI_TEST_APPLICATION_H
index 5870028..d917107 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_COMPARE_TYPES_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -20,8 +20,7 @@
 #include <dali/public-api/dali-core.h>
 using namespace Dali;
 
-
-template <typename Type>
+template<typename Type>
 inline bool CompareType(Type value1, Type value2, float epsilon)
 {
   return value1 == value2;
@@ -34,7 +33,7 @@ inline bool CompareType(Type value1, Type value2, float epsilon)
  * @param[in] epsilon difference threshold
  * @returns true if difference is smaller than epsilon threshold, false otherwise
  */
-template <>
+template<>
 inline bool CompareType<float>(float value1, float value2, float epsilon)
 {
   return fabsf(value1 - value2) < epsilon;
@@ -47,10 +46,10 @@ inline bool CompareType<float>(float value1, float value2, float epsilon)
  * @param[in] epsilon difference threshold
  * @returns true if difference is smaller than epsilon threshold, false otherwise
  */
-template <>
+template<>
 inline bool CompareType<Vector2>(Vector2 vector1, Vector2 vector2, float epsilon)
 {
-  return fabsf(vector1.x - vector2.x)<epsilon && fabsf(vector1.y - vector2.y)<epsilon;
+  return fabsf(vector1.x - vector2.x) < epsilon && fabsf(vector1.y - vector2.y) < epsilon;
 }
 
 /**
@@ -60,15 +59,14 @@ inline bool CompareType<Vector2>(Vector2 vector1, Vector2 vector2, float epsilon
  * @param[in] epsilon difference threshold
  * @returns true if difference is smaller than epsilon threshold, false otherwise
  */
-template <>
+template<>
 inline bool CompareType<Vector3>(Vector3 vector1, Vector3 vector2, float epsilon)
 {
-  return fabsf(vector1.x - vector2.x)<epsilon &&
-         fabsf(vector1.y - vector2.y)<epsilon &&
-         fabsf(vector1.z - vector2.z)<epsilon;
+  return fabsf(vector1.x - vector2.x) < epsilon &&
+         fabsf(vector1.y - vector2.y) < epsilon &&
+         fabsf(vector1.z - vector2.z) < epsilon;
 }
 
-
 /**
  * A helper for fuzzy-comparing Vector4 objects
  * @param[in] vector1 the first object
@@ -76,35 +74,35 @@ inline bool CompareType<Vector3>(Vector3 vector1, Vector3 vector2, float epsilon
  * @param[in] epsilon difference threshold
  * @returns true if difference is smaller than epsilon threshold, false otherwise
  */
-template <>
+template<>
 inline bool CompareType<Vector4>(Vector4 vector1, Vector4 vector2, float epsilon)
 {
-  return fabsf(vector1.x - vector2.x)<epsilon &&
-         fabsf(vector1.y - vector2.y)<epsilon &&
-         fabsf(vector1.z - vector2.z)<epsilon &&
-         fabsf(vector1.w - vector2.w)<epsilon;
+  return fabsf(vector1.x - vector2.x) < epsilon &&
+         fabsf(vector1.y - vector2.y) < epsilon &&
+         fabsf(vector1.z - vector2.z) < epsilon &&
+         fabsf(vector1.w - vector2.w) < epsilon;
 }
 
-template <>
+template<>
 inline bool CompareType<Quaternion>(Quaternion q1, Quaternion q2, float epsilon)
 {
   Quaternion q2N = -q2; // These quaternions represent the same rotation
   return CompareType<Vector4>(q1.mVector, q2.mVector, epsilon) || CompareType<Vector4>(q1.mVector, q2N.mVector, epsilon);
 }
 
-template <>
+template<>
 inline bool CompareType<Radian>(Radian q1, Radian q2, float epsilon)
 {
   return CompareType<float>(q1.radian, q2.radian, epsilon);
 }
 
-template <>
+template<>
 inline bool CompareType<Degree>(Degree q1, Degree q2, float epsilon)
 {
   return CompareType<float>(q1.degree, q2.degree, epsilon);
 }
 
-template <>
+template<>
 inline bool CompareType<Extents>(Extents extents1, Extents extents2, float epsilon)
 {
   return (extents1.start == extents2.start) &&
@@ -113,11 +111,11 @@ inline bool CompareType<Extents>(Extents extents1, Extents extents2, float epsil
          (extents1.bottom == extents2.bottom);
 }
 
-template <>
+template<>
 inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2, float epsilon)
 {
   Property::Type type = q1.GetType();
-  if( type != q2.GetType() )
+  if(type != q2.GetType())
   {
     return false;
   }
@@ -130,7 +128,7 @@ inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2,
       bool a, b;
       q1.Get(a);
       q2.Get(b);
-      result =  a == b;
+      result = a == b;
       break;
     }
     case Property::INTEGER:
@@ -138,7 +136,7 @@ inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2,
       int a, b;
       q1.Get(a);
       q2.Get(b);
-      result =  a == b;
+      result = a == b;
       break;
     }
     case Property::FLOAT:
@@ -146,7 +144,7 @@ inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2,
       float a, b;
       q1.Get(a);
       q2.Get(b);
-      result =  CompareType<float>(a, b, epsilon);
+      result = CompareType<float>(a, b, epsilon);
       break;
     }
     case Property::VECTOR2:
@@ -196,7 +194,7 @@ inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2,
     case Property::MAP:
     {
       //TODO: Implement this?
-      DALI_ASSERT_ALWAYS( 0 && "Not implemented");
+      DALI_ASSERT_ALWAYS(0 && "Not implemented");
       result = false;
       break;
     }
@@ -205,7 +203,7 @@ inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2,
       Extents a, b;
       q1.Get(a);
       q2.Get(b);
-      result = CompareType<Extents>( a, b, epsilon );
+      result = CompareType<Extents>(a, b, epsilon);
       break;
     }
     case Property::NONE:
@@ -218,6 +216,4 @@ inline bool CompareType<Property::Value>(Property::Value q1, Property::Value q2,
   return result;
 }
 
-
-
 #endif
index c0b55ce..4b465a7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
 
 namespace
 {
-const uint32_t RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
+const uint32_t RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
 
-Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition, uint32_t time )
+Integration::TouchEvent GenerateSingleTouch(PointState::Type state, const Vector2& screenPosition, uint32_t time)
 {
   Integration::TouchEvent touchEvent;
-  Integration::Point point;
-  point.SetState( state );
+  Integration::Point      point;
+  point.SetState(state);
   point.SetDeviceId(4);
-  point.SetScreenPosition( screenPosition );
-  point.SetDeviceClass( Device::Class::TOUCH );
-  point.SetDeviceSubclass( Device::Subclass::NONE );
-  touchEvent.points.push_back( point );
+  point.SetScreenPosition(screenPosition);
+  point.SetDeviceClass(Device::Class::TOUCH);
+  point.SetDeviceSubclass(Device::Subclass::NONE);
+  touchEvent.points.push_back(point);
   touchEvent.time = time;
   return touchEvent;
 }
 
-Integration::TouchEvent GenerateDoubleTouch( PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time )
+Integration::TouchEvent GenerateDoubleTouch(PointState::Type stateA, const Vector2& screenPositionA, PointState::Type stateB, const Vector2& screenPositionB, uint32_t time)
 {
   Integration::TouchEvent touchEvent;
-  Integration::Point point;
-  point.SetState( stateA );
+  Integration::Point      point;
+  point.SetState(stateA);
   point.SetDeviceId(4);
-  point.SetScreenPosition( screenPositionA );
-  point.SetDeviceClass( Device::Class::TOUCH );
-  point.SetDeviceSubclass( Device::Subclass::NONE );
-  touchEvent.points.push_back( point );
-  point.SetScreenPosition( screenPositionB );
-  point.SetState( stateB);
+  point.SetScreenPosition(screenPositionA);
+  point.SetDeviceClass(Device::Class::TOUCH);
+  point.SetDeviceSubclass(Device::Subclass::NONE);
+  touchEvent.points.push_back(point);
+  point.SetScreenPosition(screenPositionB);
+  point.SetState(stateB);
   point.SetDeviceId(7);
-  touchEvent.points.push_back( point );
+  touchEvent.points.push_back(point);
   touchEvent.time = time;
   return touchEvent;
 }
@@ -64,133 +64,133 @@ uint32_t TestGetFrameInterval()
   return RENDER_FRAME_INTERVAL;
 }
 
-void TestStartLongPress( TestApplication& application, float x, float y, uint32_t time )
+void TestStartLongPress(TestApplication& application, float x, float y, uint32_t time)
 {
-  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( x, y ), time ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(x, y), time));
 }
 
-void TestTriggerLongPress( TestApplication& application )
+void TestTriggerLongPress(TestApplication& application)
 {
   application.GetPlatform().TriggerTimer();
 }
 
-void TestGenerateLongPress( TestApplication& application, float x, float y, uint32_t time )
+void TestGenerateLongPress(TestApplication& application, float x, float y, uint32_t time)
 {
-  TestStartLongPress( application, x, y, time );
-  TestTriggerLongPress( application );
+  TestStartLongPress(application, x, y, time);
+  TestTriggerLongPress(application);
 }
 
-void TestEndLongPress( TestApplication& application, float x, float y, uint32_t time )
+void TestEndLongPress(TestApplication& application, float x, float y, uint32_t time)
 {
-  application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( x, y ), time ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(x, y), time));
 }
 
-void TestGeneratePinch( TestApplication& application)
+void TestGeneratePinch(TestApplication& application)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 150 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 28.0f ), PointState::MOTION, Vector2( 20.0f, 82.0f ), 160 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 37.0f ), PointState::MOTION, Vector2( 20.0f, 74.0f ), 170 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 46.0f ), PointState::MOTION, Vector2( 20.0f, 66.0f ), 180 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 55.0f ), PointState::MOTION, Vector2( 20.0f, 58.0f ), 190 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::UP, Vector2( 20.0f, 55.0f ), PointState::UP, Vector2( 20.0f, 58.0f ), 200 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), PointState::DOWN, Vector2(20.0f, 90.0f), 150));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 28.0f), PointState::MOTION, Vector2(20.0f, 82.0f), 160));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 37.0f), PointState::MOTION, Vector2(20.0f, 74.0f), 170));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 46.0f), PointState::MOTION, Vector2(20.0f, 66.0f), 180));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 55.0f), PointState::MOTION, Vector2(20.0f, 58.0f), 190));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::UP, Vector2(20.0f, 55.0f), PointState::UP, Vector2(20.0f, 58.0f), 200));
 }
 
-void TestStartPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestStartPinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, a1, PointState::DOWN, b1, time ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 50 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 150 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, a1, PointState::DOWN, b1, time));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 50));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 100));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 150));
 }
 
-void TestContinuePinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestContinuePinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time + 50 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time +150 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time + 50));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 100));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 150));
 }
 
-void TestEndPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestEndPinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::UP, a2, PointState::UP, b2, time +50 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::UP, a2, PointState::UP, b2, time + 50));
 }
 
-void TestGenerateMiniPan( TestApplication& application)
+void TestGenerateMiniPan(TestApplication& application)
 {
-  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), 250 ) );
-  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 20.0f, 40.0f ), 251 ) );
-  application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( 20.0f, 40.0f ), 255 ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), 250));
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, Vector2(20.0f, 40.0f), 251));
+  application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(20.0f, 40.0f), 255));
 }
 
-void TestStartPan( TestApplication& application, Vector2 start, Vector2 end, uint32_t& time )
+void TestStartPan(TestApplication& application, Vector2 start, Vector2 end, uint32_t& time)
 {
-  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, start, time ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, start, time));
 
   time += RENDER_FRAME_INTERVAL;
 
-  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, end, time ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, end, time));
 
   time += RENDER_FRAME_INTERVAL;
 
-  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, end, time ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, end, time));
 
   time += RENDER_FRAME_INTERVAL;
 }
 
-void TestMovePan( TestApplication& application, Vector2 pos, uint32_t time )
+void TestMovePan(TestApplication& application, Vector2 pos, uint32_t time)
 {
-  application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, pos, time ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::MOTION, pos, time));
 }
 
-void TestEndPan( TestApplication& application, Vector2 pos, uint32_t time )
+void TestEndPan(TestApplication& application, Vector2 pos, uint32_t time)
 {
-  application.ProcessEvent( GenerateSingleTouch( PointState::UP, pos, time ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::UP, pos, time));
 }
 
-void TestGenerateTap( TestApplication& application, float x, float y, uint32_t time_down )
+void TestGenerateTap(TestApplication& application, float x, float y, uint32_t time_down)
 {
-  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( x, y ), time_down ) );
-  application.ProcessEvent( GenerateSingleTouch( PointState::UP, Vector2( x, y ), time_down + 20 ) );
+  application.ProcessEvent(GenerateSingleTouch(PointState::DOWN, Vector2(x, y), time_down));
+  application.ProcessEvent(GenerateSingleTouch(PointState::UP, Vector2(x, y), time_down + 20));
 }
 
-void TestGenerateTwoPointTap( TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down )
+void TestGenerateTwoPointTap(TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( x1, y1 ), PointState::DOWN, Vector2( x2, y2 ), time_down ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::UP, Vector2( x1, y1 ), PointState::UP, Vector2( x2, y2 ), time_down + 20 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, Vector2(x1, y1), PointState::DOWN, Vector2(x2, y2), time_down));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::UP, Vector2(x1, y1), PointState::UP, Vector2(x2, y2), time_down + 20));
 }
 
-void TestGenerateRotation( TestApplication& application )
+void TestGenerateRotation(TestApplication& application)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, Vector2( 20.0f, 20.0f ), PointState::DOWN, Vector2( 20.0f, 90.0f ), 150 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 25.0f, 95.0f ), 160 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 30.0f, 100.0f ), 170 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 35.0f, 105.0f ), 180 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, Vector2( 20.0f, 20.0f ), PointState::MOTION, Vector2( 40.0f, 110.0f ), 190 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::UP, Vector2( 20.0f, 20.0f ), PointState::UP, Vector2( 45.0f, 115.0f ), 200 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, Vector2(20.0f, 20.0f), PointState::DOWN, Vector2(20.0f, 90.0f), 150));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 20.0f), PointState::MOTION, Vector2(25.0f, 95.0f), 160));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 20.0f), PointState::MOTION, Vector2(30.0f, 100.0f), 170));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 20.0f), PointState::MOTION, Vector2(35.0f, 105.0f), 180));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, Vector2(20.0f, 20.0f), PointState::MOTION, Vector2(40.0f, 110.0f), 190));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::UP, Vector2(20.0f, 20.0f), PointState::UP, Vector2(45.0f, 115.0f), 200));
 }
 
-void TestStartRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestStartRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::DOWN, a1, PointState::DOWN, b1, time ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 50 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 150 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::DOWN, a1, PointState::DOWN, b1, time));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 50));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 100));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 150));
 }
 
-void TestContinueRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestContinueRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time + 50 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time + 100 ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a2, PointState::MOTION, b2, time +150 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time + 50));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 100));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a2, PointState::MOTION, b2, time + 150));
 }
 
-void TestEndRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time )
+void TestEndRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time)
 {
-  application.ProcessEvent( GenerateDoubleTouch( PointState::MOTION, a1, PointState::MOTION, b1, time ) );
-  application.ProcessEvent( GenerateDoubleTouch( PointState::UP, a2, PointState::UP, b2, time +50 ) );
+  application.ProcessEvent(GenerateDoubleTouch(PointState::MOTION, a1, PointState::MOTION, b1, time));
+  application.ProcessEvent(GenerateDoubleTouch(PointState::UP, a2, PointState::UP, b2, time + 50));
 }
 
 } // namespace Dali
index 18051cf..e6e367d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_GESTURE_GENERATOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -34,94 +34,94 @@ uint32_t TestGetFrameInterval();
 /**
  * Produces the initial touch of a long press
  */
-void TestStartLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+void TestStartLongPress(TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450);
 
 /**
  * Triggers the timer to begin a long press gesture
  */
-void TestTriggerLongPress( TestApplication& application );
+void TestTriggerLongPress(TestApplication& application);
 
 /**
  * Produces the initial press and triggers the timer to begin a long press gesture
  */
-void TestGenerateLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+void TestGenerateLongPress(TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450);
 
 /**
  * End a long press by lifting the touch
  */
-void TestEndLongPress( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450 );
+void TestEndLongPress(TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time = 450);
 
 /**
  * Produces a vertical pinch gesture between (20,20) and (20,90)
  */
-void TestGeneratePinch( TestApplication& application );
+void TestGeneratePinch(TestApplication& application);
 
 /**
  * Produces the gesture started event of a pinch, using 4 touches, 50ms apart, starting with 1, ending at 2
  */
-void TestStartPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestStartPinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
 
 /**
  * Produces a gesture continuing event of a pinch, using 4 touches, 50ms apart, starting with 1, ending at 2
  */
-void TestContinuePinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestContinuePinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
 
 /**
  * Produces a gesture finished event of a pinch, using 2 touches, 50ms apart
  */
-void TestEndPinch( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestEndPinch(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
 
 /**
  * Produces a pan gesture from (20,20) to (20,40)
  */
-void TestGenerateMiniPan( TestApplication& application );
+void TestGenerateMiniPan(TestApplication& application);
 
 /**
  * Produces the start event of a pan gesture, assuming minimum distance moved between start and end is greater than 15
  * in either direction or 11 in both (x&y). Time will be incremented using the standard frame interval per touch movement
  */
-void TestStartPan( TestApplication& application, Vector2 start, Vector2 end, uint32_t& time );
+void TestStartPan(TestApplication& application, Vector2 start, Vector2 end, uint32_t& time);
 
 /**
  * Continues a pan event by creating a single touch at pos.
  * N.B This does not increment the time
  */
-void TestMovePan( TestApplication& application, Vector2 pos, uint32_t time = 400);
+void TestMovePan(TestApplication& application, Vector2 pos, uint32_t time = 400);
 
 /**
  * End a pan gesture at position pos
  */
-void TestEndPan( TestApplication& application, Vector2 pos, uint32_t time = 500);
+void TestEndPan(TestApplication& application, Vector2 pos, uint32_t time = 500);
 
 /**
  * Produces a single point tap gesture with a 20ms interval
  */
-void TestGenerateTap( TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time_down = 100 );
+void TestGenerateTap(TestApplication& application, float x = 20.0f, float y = 20.0f, uint32_t time_down = 100);
 
 /**
  * Produce a tap gesture with two touch points and a 20ms interval
  */
-void TestGenerateTwoPointTap( TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down );
+void TestGenerateTwoPointTap(TestApplication& application, float x1, float y1, float x2, float y2, uint32_t time_down);
 
 /**
  * Produces a rotation gesture.
  */
-void TestGenerateRotation( TestApplication& application );
+void TestGenerateRotation(TestApplication& application);
 
 /**
  * Produces the gesture started event of a rotation, using 4 touches, 50ms apart, starting with 1, ending at 2
  */
-void TestStartRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestStartRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
 
 /**
  * Produces a gesture continuing event of a rotation, using 4 touches, 50ms apart, starting with 1, ending at 2
  */
-void TestContinueRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestContinueRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
 
 /**
  * Produces a gesture finished event of a rotation, using 2 touches, 50ms apart
  */
-void TestEndRotation( TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time );
+void TestEndRotation(TestApplication& application, Vector2 a1, Vector2 b1, Vector2 a2, Vector2 b2, uint32_t time);
 
 } // namespace Dali
 
index 98a2fa5..a694eeb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
 
 namespace Dali
 {
-
 TestGlAbstraction::TestGlAbstraction()
 {
   Initialize();
 }
 
-TestGlAbstraction::~TestGlAbstraction() {}
+TestGlAbstraction::~TestGlAbstraction()
+{
+}
 
 void TestGlAbstraction::Initialize()
 {
-  mCurrentProgram = 0;
-  mCompileStatus = GL_TRUE;
-  mLinkStatus = GL_TRUE;
-  mNumberOfActiveUniforms = 0;
-  mGetAttribLocationResult = 0;
-  mGetErrorResult = 0;
-  mGetStringResult = NULL;
-  mIsBufferResult = 0;
-  mIsEnabledResult = 0;
-  mIsFramebufferResult = 0;
-  mIsProgramResult = 0;
-  mIsRenderbufferResult = 0;
-  mIsShaderResult = 0;
-  mIsTextureResult = 0;
-  mActiveTextureUnit = 0;
-  mCheckFramebufferStatusResult = 0;
-  mFramebufferStatus = 0;
-  mFramebufferDepthAttached = 0;
-  mFramebufferStencilAttached = 0;
+  mCurrentProgram                  = 0;
+  mCompileStatus                   = GL_TRUE;
+  mLinkStatus                      = GL_TRUE;
+  mNumberOfActiveUniforms          = 0;
+  mGetAttribLocationResult         = 0;
+  mGetErrorResult                  = 0;
+  mGetStringResult                 = NULL;
+  mIsBufferResult                  = 0;
+  mIsEnabledResult                 = 0;
+  mIsFramebufferResult             = 0;
+  mIsProgramResult                 = 0;
+  mIsRenderbufferResult            = 0;
+  mIsShaderResult                  = 0;
+  mIsTextureResult                 = 0;
+  mActiveTextureUnit               = 0;
+  mCheckFramebufferStatusResult    = 0;
+  mFramebufferStatus               = 0;
+  mFramebufferDepthAttached        = 0;
+  mFramebufferStencilAttached      = 0;
   mFramebufferColorAttachmentCount = 0;
-  mFrameBufferColorStatus = 0;
-  mNumBinaryFormats = 0;
-  mBinaryFormats = 0;
-  mProgramBinaryLength = 0;
+  mFrameBufferColorStatus          = 0;
+  mNumBinaryFormats                = 0;
+  mBinaryFormats                   = 0;
+  mProgramBinaryLength             = 0;
 
   mVertexAttribArrayChanged = false;
-  mGetProgramBinaryCalled = false;
+  mGetProgramBinaryCalled   = false;
 
   mLastShaderCompiled = 0;
-  mLastClearBitMask = 0;
-  mLastClearColor = Color::TRANSPARENT;
-  mClearCount = 0;
+  mLastClearBitMask   = 0;
+  mLastClearColor     = Color::TRANSPARENT;
+  mClearCount         = 0;
 
   mLastBlendEquationRgb   = 0;
   mLastBlendEquationAlpha = 0;
@@ -68,12 +69,12 @@ void TestGlAbstraction::Initialize()
   mLastBlendFuncDstRgb    = 0;
   mLastBlendFuncSrcAlpha  = 0;
   mLastBlendFuncDstAlpha  = 0;
-  mLastAutoTextureIdUsed = 0;
-  mNumGeneratedTextures = 0;
-  mLastShaderIdUsed = 0;
-  mLastProgramIdUsed = 0;
-  mLastUniformIdUsed = 0;
-  mLastDepthMask = false;
+  mLastAutoTextureIdUsed  = 0;
+  mNumGeneratedTextures   = 0;
+  mLastShaderIdUsed       = 0;
+  mLastProgramIdUsed      = 0;
+  mLastUniformIdUsed      = 0;
+  mLastDepthMask          = false;
 
   mUniforms.clear();
   mProgramUniforms1i.clear();
@@ -92,7 +93,7 @@ void TestGlAbstraction::Initialize()
   mTexParamaterTrace.Reset();
   mDrawTrace.Reset();
 
-  for( unsigned int i=0; i<MAX_ATTRIBUTE_CACHE_SIZE; ++i )
+  for(unsigned int i = 0; i < MAX_ATTRIBUTE_CACHE_SIZE; ++i)
   {
     mVertexAttribArrayState[i] = false;
   }
@@ -111,18 +112,18 @@ bool TestGlAbstraction::IsSurfacelessContextSupported() const
   return true;
 }
 
-bool TestGlAbstraction::TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
+bool TestGlAbstraction::TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const
 {
-  return ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
+  return ((imageGlFormat == GL_RGB) && (textureGlFormat == GL_RGBA));
 }
 
-} // Namespace dali
+} // namespace Dali
 
 bool BlendEnabled(const Dali::TraceCallStack& callStack)
 {
   std::stringstream out;
   out << GL_BLEND;
-  bool blendEnabled = callStack.FindMethodAndParams( "Enable", out.str() );
+  bool blendEnabled = callStack.FindMethodAndParams("Enable", out.str());
   return blendEnabled;
 }
 
@@ -130,7 +131,6 @@ bool BlendDisabled(const Dali::TraceCallStack& callStack)
 {
   std::stringstream out;
   out << GL_BLEND;
-  bool blendEnabled = callStack.FindMethodAndParams( "Disable", out.str() );
+  bool blendEnabled = callStack.FindMethodAndParams("Disable", out.str());
   return blendEnabled;
 }
-
index 6fc7049..99dca10 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <sstream>
-#include <string>
-#include <cstring>
-#include <map>
 #include <cstdio>
+#include <cstring>
 #include <cstring> // for strcmp
+#include <map>
+#include <sstream>
+#include <string>
 #include <typeinfo>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/dali-core.h>
 #include <dali/devel-api/rendering/frame-buffer-devel.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 <dali/public-api/dali-core.h>
 #include <test-compare-types.h>
+#include <test-trace-call-stack.h>
 
 namespace Dali
 {
-
 static const unsigned int MAX_ATTRIBUTE_CACHE_SIZE = 64;
-static const char *mStdAttribs[MAX_ATTRIBUTE_CACHE_SIZE] =
-{
+static const char*        mStdAttribs[MAX_ATTRIBUTE_CACHE_SIZE] =
+  {
     "aPosition",    // ATTRIB_POSITION
     "aNormal",      // ATTRIB_NORMAL
     "aTexCoord",    // ATTRIB_TEXCOORD
@@ -50,7 +49,7 @@ static const char *mStdAttribs[MAX_ATTRIBUTE_CACHE_SIZE] =
     "aBoneIndices"  // ATTRIB_BONE_INDICES
 };
 
-class DALI_CORE_API TestGlAbstraction: public Dali::Integration::GlAbstraction
+class DALI_CORE_API TestGlAbstraction : public Dali::Integration::GlAbstraction
 {
 public:
   TestGlAbstraction();
@@ -62,11 +61,11 @@ public:
 
   bool IsSurfacelessContextSupported() const override;
 
-  bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const override;
+  bool TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const override;
 
   /* OpenGL ES 2.0 */
 
-  inline void ActiveTexture( GLenum textureUnit ) override
+  inline void ActiveTexture(GLenum textureUnit) override
   {
     mActiveTextureUnit = textureUnit - GL_TEXTURE0;
   }
@@ -76,32 +75,32 @@ public:
     return mActiveTextureUnit + GL_TEXTURE0;
   }
 
-  inline void AttachShader( GLuint program, GLuint shader ) override
+  inline void AttachShader(GLuint program, GLuint shader) override
   {
     std::stringstream out;
     out << program << ", " << shader;
 
     TraceCallStack::NamedParams namedParams;
     namedParams["program"] = ToString(program);
-    namedParams["shader"] = ToString(shader);
+    namedParams["shader"]  = ToString(shader);
     mShaderTrace.PushCall("AttachShader", out.str(), namedParams);
   }
 
-  inline void BindAttribLocation( GLuint program, GLuint index, const char* name ) override
+  inline void BindAttribLocation(GLuint program, GLuint index, const char* name) override
   {
   }
 
-  inline void BindBuffer( GLenum target, GLuint buffer ) override
+  inline void BindBuffer(GLenum target, GLuint buffer) override
   {
   }
 
-  inline void BindFramebuffer( GLenum target, GLuint framebuffer ) override
+  inline void BindFramebuffer(GLenum target, GLuint framebuffer) override
   {
     //Add 010 bit;
     mFramebufferStatus |= 2;
   }
 
-  inline void BindRenderbuffer( GLenum target, GLuint renderbuffer ) override
+  inline void BindRenderbuffer(GLenum target, GLuint renderbuffer) override
   {
   }
 
@@ -119,9 +118,9 @@ public:
    * @param[in] activeTextureUnit The specific active texture unit.
    * @return A vector containing the IDs that were bound.
    */
-  inline const std::vector<GLuint>& GetBoundTextures( GLuint activeTextureUnit ) const
+  inline const std::vector<GLuint>& GetBoundTextures(GLuint activeTextureUnit) const
   {
-    return mActiveTextures[ activeTextureUnit - GL_TEXTURE0 ].mBoundTextures;
+    return mActiveTextures[activeTextureUnit - GL_TEXTURE0].mBoundTextures;
   }
 
   /**
@@ -131,22 +130,22 @@ public:
   {
     mBoundTextures.clear();
 
-    for( unsigned int i=0; i<MIN_TEXTURE_UNIT_LIMIT; ++i )
+    for(unsigned int i = 0; i < MIN_TEXTURE_UNIT_LIMIT; ++i)
     {
-      mActiveTextures[ i ].mBoundTextures.clear();
+      mActiveTextures[i].mBoundTextures.clear();
     }
   }
 
-  inline void BindTexture( GLenum target, GLuint texture ) override
+  inline void BindTexture(GLenum target, GLuint texture) override
   {
     // Record the bound textures for future checks
-    if( texture )
+    if(texture)
     {
-      mBoundTextures.push_back( texture );
+      mBoundTextures.push_back(texture);
 
-      if( mActiveTextureUnit < MIN_TEXTURE_UNIT_LIMIT )
+      if(mActiveTextureUnit < MIN_TEXTURE_UNIT_LIMIT)
       {
-        mActiveTextures[ mActiveTextureUnit ].mBoundTextures.push_back( texture );
+        mActiveTextures[mActiveTextureUnit].mBoundTextures.push_back(texture);
       }
     }
 
@@ -154,7 +153,7 @@ public:
     out << target << ", " << texture;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["target"] = ToString(target);
+    namedParams["target"]  = ToString(target);
     namedParams["texture"] = ToString(texture);
 
     mTextureTrace.PushCall("BindTexture", out.str(), namedParams);
@@ -173,13 +172,13 @@ public:
     return mLastBlendColor;
   }
 
-  inline void BlendEquation( GLenum mode ) override
+  inline void BlendEquation(GLenum mode) override
   {
     mLastBlendEquationRgb   = mode;
     mLastBlendEquationAlpha = mode;
   }
 
-  inline void BlendEquationSeparate( GLenum modeRgb, GLenum modeAlpha ) override
+  inline void BlendEquationSeparate(GLenum modeRgb, GLenum modeAlpha) override
   {
     mLastBlendEquationRgb   = modeRgb;
     mLastBlendEquationAlpha = modeAlpha;
@@ -197,16 +196,16 @@ public:
 
   inline void BlendFunc(GLenum sfactor, GLenum dfactor) override
   {
-    mLastBlendFuncSrcRgb = sfactor;
-    mLastBlendFuncDstRgb = dfactor;
+    mLastBlendFuncSrcRgb   = sfactor;
+    mLastBlendFuncDstRgb   = dfactor;
     mLastBlendFuncSrcAlpha = sfactor;
     mLastBlendFuncDstAlpha = dfactor;
   }
 
   inline void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) override
   {
-    mLastBlendFuncSrcRgb = srcRGB;
-    mLastBlendFuncDstRgb = dstRGB;
+    mLastBlendFuncSrcRgb   = srcRGB;
+    mLastBlendFuncDstRgb   = dstRGB;
     mLastBlendFuncSrcAlpha = srcAlpha;
     mLastBlendFuncDstAlpha = dstAlpha;
   }
@@ -233,19 +232,19 @@ public:
 
   inline void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage) override
   {
-     mBufferDataCalls.push_back(size);
+    mBufferDataCalls.push_back(size);
   }
 
   inline void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data) override
   {
-     mBufferSubDataCalls.push_back(size);
+    mBufferSubDataCalls.push_back(size);
   }
 
   inline GLenum CheckFramebufferStatus(GLenum target) override
   {
     //If it has the three last bits set to 1 - 111, then the three minimum functions to create a
     //Framebuffer texture have been called
-    if( mFramebufferStatus == 7 )
+    if(mFramebufferStatus == 7)
     {
       return GL_FRAMEBUFFER_COMPLETE;
     }
@@ -297,16 +296,16 @@ public:
     out << s;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["s"] = ToString( s );
+    namedParams["s"] = ToString(s);
 
-    mStencilFunctionTrace.PushCall( "ClearStencil", out.str(), namedParams );
+    mStencilFunctionTrace.PushCall("ClearStencil", out.str(), namedParams);
   }
 
   inline void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) override
   {
-    mColorMaskParams.red = red;
+    mColorMaskParams.red   = red;
     mColorMaskParams.green = green;
-    mColorMaskParams.blue = blue;
+    mColorMaskParams.blue  = blue;
     mColorMaskParams.alpha = alpha;
   }
 
@@ -323,16 +322,16 @@ public:
   inline void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) override
   {
     std::stringstream out;
-    out << target<<", "<<level<<", "<<width << ", " << height;
+    out << target << ", " << level << ", " << width << ", " << height;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["target"] = ToString(target);
-    namedParams["level"] = ToString(level);
+    namedParams["target"]         = ToString(target);
+    namedParams["level"]          = ToString(level);
     namedParams["internalformat"] = ToString(internalformat);
-    namedParams["width"] = ToString(width);
-    namedParams["height"] = ToString(height);
-    namedParams["border"] = ToString(border);
-    namedParams["size"] = ToString(imageSize);
+    namedParams["width"]          = ToString(width);
+    namedParams["height"]         = ToString(height);
+    namedParams["border"]         = ToString(border);
+    namedParams["size"]           = ToString(imageSize);
 
     mTextureTrace.PushCall("CompressedTexImage2D", out.str(), namedParams);
   }
@@ -340,15 +339,15 @@ public:
   inline void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) override
   {
     std::stringstream out;
-    out << target << ", "<<level <<", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
+    out << target << ", " << level << ", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["target"] = ToString(target);
-    namedParams["level"] = ToString(level);
+    namedParams["target"]  = ToString(target);
+    namedParams["level"]   = ToString(level);
     namedParams["xoffset"] = ToString(xoffset);
     namedParams["yoffset"] = ToString(yoffset);
-    namedParams["width"] = ToString(width);
-    namedParams["height"] = ToString(height);
+    namedParams["width"]   = ToString(width);
+    namedParams["height"]  = ToString(height);
     mTextureTrace.PushCall("CompressedTexSubImage2D", out.str(), namedParams);
   }
 
@@ -433,11 +432,11 @@ public:
 
     TraceCallStack::NamedParams namedParams;
 
-    for(GLsizei i=0; i<n; i++)
+    for(GLsizei i = 0; i < n; i++)
     {
       out << textures[i] << ", ";
       std::stringstream paramName;
-      paramName<<"texture["<<i<<"]";
+      paramName << "texture[" << i << "]";
       namedParams[paramName.str()] = ToString(textures[i]);
       mDeletedTextureIds.push_back(textures[i]);
       mNumGeneratedTextures--;
@@ -452,11 +451,11 @@ public:
     return mDeletedTextureIds.size() == 0;
   }
 
-  inline bool CheckTextureDeleted( GLuint textureId )
+  inline bool CheckTextureDeleted(GLuint textureId)
   {
     bool found = false;
 
-    for(std::vector<GLuint>::iterator iter=mDeletedTextureIds.begin(); iter != mDeletedTextureIds.end(); ++iter)
+    for(std::vector<GLuint>::iterator iter = mDeletedTextureIds.begin(); iter != mDeletedTextureIds.end(); ++iter)
     {
       if(*iter == textureId)
       {
@@ -503,7 +502,7 @@ public:
     out << program << ", " << shader;
     TraceCallStack::NamedParams namedParams;
     namedParams["program"] = ToString(program);
-    namedParams["shader"] = ToString(shader);
+    namedParams["shader"]  = ToString(shader);
     mShaderTrace.PushCall("DetachShader", out.str(), namedParams);
   }
 
@@ -518,7 +517,7 @@ public:
 
   inline void DisableVertexAttribArray(GLuint index) override
   {
-    SetVertexAttribArray( index, false );
+    SetVertexAttribArray(index, false);
   }
 
   inline void DrawArrays(GLenum mode, GLint first, GLsizei count) override
@@ -526,7 +525,7 @@ public:
     std::stringstream out;
     out << mode << ", " << first << ", " << count;
     TraceCallStack::NamedParams namedParams;
-    namedParams["mode"] = ToString(mode);
+    namedParams["mode"]  = ToString(mode);
     namedParams["first"] = ToString(first);
     namedParams["count"] = ToString(count);
     mDrawTrace.PushCall("DrawArrays", out.str(), namedParams);
@@ -538,9 +537,9 @@ public:
     out << mode << ", " << count << ", " << type << ", indices";
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["mode"] = ToString(mode);
+    namedParams["mode"]  = ToString(mode);
     namedParams["count"] = ToString(count);
-    namedParams["type"] = ToString(type);
+    namedParams["type"]  = ToString(type);
     // Skip void pointers - are they of any use?
     mDrawTrace.PushCall("DrawElements", out.str(), namedParams);
   }
@@ -556,7 +555,7 @@ public:
 
   inline void EnableVertexAttribArray(GLuint index) override
   {
-    SetVertexAttribArray( index, true);
+    SetVertexAttribArray(index, true);
   }
 
   inline void Finish(void) override
@@ -569,11 +568,11 @@ public:
 
   inline void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) override
   {
-    if (attachment == GL_DEPTH_ATTACHMENT)
+    if(attachment == GL_DEPTH_ATTACHMENT)
     {
       mFramebufferDepthAttached = true;
     }
-    else if (attachment == GL_STENCIL_ATTACHMENT)
+    else if(attachment == GL_STENCIL_ATTACHMENT)
     {
       mFramebufferStencilAttached = true;
     }
@@ -585,10 +584,10 @@ public:
     mFramebufferStatus |= 4;
 
     //We check 4 attachment colors
-    if ((attachment >= GL_COLOR_ATTACHMENT0) && (attachment < GL_COLOR_ATTACHMENT0 + Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS))
+    if((attachment >= GL_COLOR_ATTACHMENT0) && (attachment < GL_COLOR_ATTACHMENT0 + Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS))
     {
       uint8_t mask = 1 << (attachment - GL_COLOR_ATTACHMENT0);
-      if ((mFrameBufferColorStatus & mask) == 0)
+      if((mFrameBufferColorStatus & mask) == 0)
       {
         mFrameBufferColorStatus |= mask;
         ++mFramebufferColorAttachmentCount;
@@ -609,7 +608,7 @@ public:
   inline void GenerateMipmap(GLenum target) override
   {
     std::stringstream out;
-    out<<target;
+    out << target;
     TraceCallStack::NamedParams namedParams;
     namedParams["target"] = ToString(target);
 
@@ -618,7 +617,7 @@ public:
 
   inline void GenFramebuffers(GLsizei n, GLuint* framebuffers) override
   {
-    for( int i = 0; i < n; i++ )
+    for(int i = 0; i < n; i++)
     {
       framebuffers[i] = i + 1;
     }
@@ -629,7 +628,7 @@ public:
 
   inline void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override
   {
-    for( int i = 0; i < n; i++ )
+    for(int i = 0; i < n; i++)
     {
       renderbuffers[i] = i + 1;
     }
@@ -639,7 +638,7 @@ public:
    * This method can be used by test cases, to manipulate the texture IDs generated by GenTextures.
    * @param[in] ids A vector containing the next IDs to be generated
    */
-  inline void SetNextTextureIds( const std::vector<GLuint>& ids )
+  inline void SetNextTextureIds(const std::vector<GLuint>& ids)
   {
     mNextTextureIds = ids;
   }
@@ -651,16 +650,16 @@ public:
 
   inline void GenTextures(GLsizei count, GLuint* textures) override
   {
-    for( int i=0; i<count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      if( !mNextTextureIds.empty() )
+      if(!mNextTextureIds.empty())
       {
-        *(textures+i) = mNextTextureIds[0];
-        mNextTextureIds.erase( mNextTextureIds.begin() );
+        *(textures + i) = mNextTextureIds[0];
+        mNextTextureIds.erase(mNextTextureIds.begin());
       }
       else
       {
-        *(textures+i) = ++mLastAutoTextureIdUsed;
+        *(textures + i) = ++mLastAutoTextureIdUsed;
       }
       mNumGeneratedTextures++;
     }
@@ -669,15 +668,15 @@ public:
     namedParams["count"] = ToString(count);
 
     std::stringstream out;
-    for(int i=0; i<count; i++)
+    for(int i = 0; i < count; i++)
     {
       out << textures[i];
-      if(i<count-1)
+      if(i < count - 1)
       {
         out << ", ";
       }
       std::ostringstream oss;
-      oss<<"indices["<<i<<"]";
+      oss << "indices[" << i << "]";
       namedParams[oss.str()] = ToString(textures[i]);
     }
 
@@ -704,18 +703,18 @@ public:
     {
       case 0:
         *length = snprintf(name, bufsize, "sTexture");
-        *type = GL_SAMPLER_2D;
-        *size = 1;
+        *type   = GL_SAMPLER_2D;
+        *size   = 1;
         break;
       case 1:
         *length = snprintf(name, bufsize, "sEffect");
-        *type = GL_SAMPLER_2D;
-        *size = 1;
+        *type   = GL_SAMPLER_2D;
+        *size   = 1;
         break;
       case 2:
         *length = snprintf(name, bufsize, "sGloss");
-        *type = GL_SAMPLER_2D;
-        *size = 1;
+        *type   = GL_SAMPLER_2D;
+        *size   = 1;
         break;
       default:
         break;
@@ -726,13 +725,13 @@ public:
   {
   }
 
-  inline int  GetAttribLocation(GLuint program, const char* name) override
+  inline int GetAttribLocation(GLuint program, const char* name) override
   {
     std::string attribName(name);
 
-    for( unsigned int i = 0; i < ATTRIB_TYPE_LAST; ++i )
+    for(unsigned int i = 0; i < ATTRIB_TYPE_LAST; ++i)
     {
-      if( mStdAttribs[i] == attribName )
+      if(mStdAttribs[i] == attribName)
       {
         return i;
       }
@@ -765,7 +764,7 @@ public:
 
   inline void GetIntegerv(GLenum pname, GLint* params) override
   {
-    switch( pname )
+    switch(pname)
     {
       case GL_MAX_TEXTURE_SIZE:
         *params = 2048;
@@ -784,7 +783,7 @@ public:
 
   inline void GetProgramiv(GLuint program, GLenum pname, GLint* params) override
   {
-    switch( pname )
+    switch(pname)
     {
       case GL_LINK_STATUS:
         *params = mLinkStatus;
@@ -811,7 +810,8 @@ public:
 
   inline void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override
   {
-    switch( pname ) {
+    switch(pname)
+    {
       case GL_COMPILE_STATUS:
         *params = mCompileStatus;
         break;
@@ -850,16 +850,16 @@ public:
   inline GLint GetUniformLocation(GLuint program, const char* name) override
   {
     ProgramUniformMap::iterator it = mUniforms.find(program);
-    if( it == mUniforms.end() )
+    if(it == mUniforms.end())
     {
       // Not a valid program ID
       mGetErrorResult = GL_INVALID_OPERATION;
       return -1;
     }
 
-    UniformIDMap& uniformIDs = it->second;
-    UniformIDMap::iterator it2 = uniformIDs.find( name );
-    if( it2 == uniformIDs.end() )
+    UniformIDMap&          uniformIDs = it->second;
+    UniformIDMap::iterator it2        = uniformIDs.find(name);
+    if(it2 == uniformIDs.end())
     {
       // Uniform not found, so add it...
       uniformIDs[name] = ++mLastUniformIdUsed;
@@ -933,7 +933,7 @@ public:
     namedParams["program"] = ToString(program);
     mShaderTrace.PushCall("LinkProgram", out.str(), namedParams);
 
-    mNumberOfActiveUniforms=3;
+    mNumberOfActiveUniforms = 3;
     GetUniformLocation(program, "sTexture");
     GetUniformLocation(program, "sEffect");
     GetUniformLocation(program, "sGloss");
@@ -965,19 +965,19 @@ public:
 
   inline void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) override
   {
-    mScissorParams.x = x;
-    mScissorParams.y = y;
-    mScissorParams.width = width;
+    mScissorParams.x      = x;
+    mScissorParams.y      = y;
+    mScissorParams.width  = width;
     mScissorParams.height = height;
 
     std::stringstream out;
     out << x << ", " << y << ", " << width << ", " << height;
     TraceCallStack::NamedParams namedParams;
-    namedParams["x"] = ToString( x );
-    namedParams["y"] = ToString( y );
-    namedParams["width"] = ToString( width );
-    namedParams["height"] = ToString( height );
-    mScissorTrace.PushCall( "Scissor", out.str(), namedParams );
+    namedParams["x"]      = ToString(x);
+    namedParams["y"]      = ToString(y);
+    namedParams["width"]  = ToString(width);
+    namedParams["height"] = ToString(height);
+    mScissorTrace.PushCall("Scissor", out.str(), namedParams);
   }
 
   inline void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) override
@@ -992,21 +992,21 @@ public:
       stringBuilder += string[i];
     }
     mShaderSources[shader] = stringBuilder;
-    mLastShaderCompiled = shader;
+    mLastShaderCompiled    = shader;
   }
 
   inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) override
   {
-    const std::string shaderSource = mShaderSources[shader];
-    const int shaderSourceLength = static_cast<int>(shaderSource.length());
-    if( shaderSourceLength < bufsize )
+    const std::string shaderSource       = mShaderSources[shader];
+    const int         shaderSourceLength = static_cast<int>(shaderSource.length());
+    if(shaderSourceLength < bufsize)
     {
-      strncpy( source, shaderSource.c_str(), shaderSourceLength );
+      strncpy(source, shaderSource.c_str(), shaderSourceLength);
       *length = shaderSourceLength;
     }
     else
     {
-      *length = bufsize -1;
+      *length = bufsize - 1;
       strncpy(source, shaderSource.c_str(), *length);
       source[*length] = 0x0;
     }
@@ -1023,11 +1023,11 @@ public:
     out << func << ", " << ref << ", " << mask;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["func"] = ToString( func );
-    namedParams["ref"] = ToString( ref );
-    namedParams["mask"] = ToString( mask );
+    namedParams["func"] = ToString(func);
+    namedParams["ref"]  = ToString(ref);
+    namedParams["mask"] = ToString(mask);
 
-    mStencilFunctionTrace.PushCall( "StencilFunc", out.str(), namedParams );
+    mStencilFunctionTrace.PushCall("StencilFunc", out.str(), namedParams);
   }
 
   inline void StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) override
@@ -1036,12 +1036,12 @@ public:
     out << face << ", " << func << ", " << ref << ", " << mask;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["face"] = ToString( face );
-    namedParams["func"] = ToString( func );
-    namedParams["ref"] = ToString( ref );
-    namedParams["mask"] = ToString( mask );
+    namedParams["face"] = ToString(face);
+    namedParams["func"] = ToString(func);
+    namedParams["ref"]  = ToString(ref);
+    namedParams["mask"] = ToString(mask);
 
-    mStencilFunctionTrace.PushCall( "StencilFuncSeparate", out.str(), namedParams );
+    mStencilFunctionTrace.PushCall("StencilFuncSeparate", out.str(), namedParams);
   }
 
   inline void StencilMask(GLuint mask) override
@@ -1050,9 +1050,9 @@ public:
     out << mask;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["mask"] = ToString( mask );
+    namedParams["mask"] = ToString(mask);
 
-    mStencilFunctionTrace.PushCall( "StencilMask", out.str(), namedParams );
+    mStencilFunctionTrace.PushCall("StencilMask", out.str(), namedParams);
   }
 
   inline void StencilMaskSeparate(GLenum face, GLuint mask) override
@@ -1061,10 +1061,10 @@ public:
     out << face << ", " << mask;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["face"] = ToString( face );
-    namedParams["mask"] = ToString( mask );
+    namedParams["face"] = ToString(face);
+    namedParams["mask"] = ToString(mask);
 
-    mStencilFunctionTrace.PushCall( "StencilMaskSeparate", out.str(), namedParams );
+    mStencilFunctionTrace.PushCall("StencilMaskSeparate", out.str(), namedParams);
   }
 
   inline void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) override
@@ -1073,11 +1073,11 @@ public:
     out << fail << ", " << zfail << ", " << zpass;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["fail"] = ToString( fail );
-    namedParams["zfail"] = ToString( zfail );
-    namedParams["zpass"] = ToString( zpass );
+    namedParams["fail"]  = ToString(fail);
+    namedParams["zfail"] = ToString(zfail);
+    namedParams["zpass"] = ToString(zpass);
 
-    mStencilFunctionTrace.PushCall( "StencilOp", out.str(), namedParams );
+    mStencilFunctionTrace.PushCall("StencilOp", out.str(), namedParams);
   }
 
   inline void StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) override
@@ -1086,28 +1086,28 @@ public:
     out << face << ", " << fail << ", " << zfail << "," << zpass;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["face"] = ToString( face );
-    namedParams["fail"] = ToString( fail );
-    namedParams["zfail"] = ToString( zfail );
-    namedParams["zpass"] = ToString( zpass );
+    namedParams["face"]  = ToString(face);
+    namedParams["fail"]  = ToString(fail);
+    namedParams["zfail"] = ToString(zfail);
+    namedParams["zpass"] = ToString(zpass);
 
-    mStencilFunctionTrace.PushCall( "StencilOpSeparate", out.str(), namedParams );
+    mStencilFunctionTrace.PushCall("StencilOpSeparate", out.str(), namedParams);
   }
 
   inline void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) override
   {
     std::stringstream out;
-    out << target<<", "<<level<<", "<<width << ", " << height;
+    out << target << ", " << level << ", " << width << ", " << height;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["target"] = ToString(target);
-    namedParams["level"] = ToString(level);
+    namedParams["target"]         = ToString(target);
+    namedParams["level"]          = ToString(level);
     namedParams["internalformat"] = ToString(internalformat);
-    namedParams["width"] = ToString(width);
-    namedParams["height"] = ToString(height);
-    namedParams["border"] = ToString(border);
-    namedParams["format"] = ToString(format);
-    namedParams["type"] = ToString(type);
+    namedParams["width"]          = ToString(width);
+    namedParams["height"]         = ToString(height);
+    namedParams["border"]         = ToString(border);
+    namedParams["format"]         = ToString(format);
+    namedParams["type"]           = ToString(type);
 
     mTextureTrace.PushCall("TexImage2D", out.str(), namedParams);
   }
@@ -1119,8 +1119,8 @@ public:
 
     TraceCallStack::NamedParams namedParams;
     namedParams["target"] = ToString(target);
-    namedParams["pname"] = ToString(pname);
-    namedParams["param"] = ToString(param);
+    namedParams["pname"]  = ToString(pname);
+    namedParams["param"]  = ToString(param);
 
     mTexParamaterTrace.PushCall("TexParameterf", out.str(), namedParams);
   }
@@ -1131,8 +1131,8 @@ public:
     out << target << ", " << pname << ", " << params[0];
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["target"] = ToString(target);
-    namedParams["pname"] = ToString(pname);
+    namedParams["target"]    = ToString(target);
+    namedParams["pname"]     = ToString(pname);
     namedParams["params[0]"] = ToString(params[0]);
 
     mTexParamaterTrace.PushCall("TexParameterfv", out.str(), namedParams);
@@ -1144,8 +1144,8 @@ public:
     out << target << ", " << pname << ", " << param;
     TraceCallStack::NamedParams namedParams;
     namedParams["target"] = ToString(target);
-    namedParams["pname"] = ToString(pname);
-    namedParams["param"] = ToString(param);
+    namedParams["pname"]  = ToString(pname);
+    namedParams["param"]  = ToString(param);
     mTexParamaterTrace.PushCall("TexParameteri", out.str(), namedParams);
   }
 
@@ -1154,8 +1154,8 @@ public:
     std::stringstream out;
     out << target << ", " << pname << ", " << params[0];
     TraceCallStack::NamedParams namedParams;
-    namedParams["target"] = ToString(target);
-    namedParams["pname"] = ToString(pname);
+    namedParams["target"]    = ToString(target);
+    namedParams["pname"]     = ToString(pname);
     namedParams["params[0]"] = ToString(params[0]);
     mTexParamaterTrace.PushCall("TexParameteriv", out.str(), namedParams);
   }
@@ -1163,24 +1163,24 @@ public:
   inline void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) override
   {
     std::stringstream out;
-    out << target << ", "<<level <<", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
+    out << target << ", " << level << ", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
 
     TraceCallStack::NamedParams namedParams;
-    namedParams["target"] = ToString(target);
-    namedParams["level"] = ToString(level);
+    namedParams["target"]  = ToString(target);
+    namedParams["level"]   = ToString(level);
     namedParams["xoffset"] = ToString(xoffset);
     namedParams["yoffset"] = ToString(yoffset);
-    namedParams["width"] = ToString(width);
-    namedParams["height"] = ToString(height);
+    namedParams["width"]   = ToString(width);
+    namedParams["height"]  = ToString(height);
     mTextureTrace.PushCall("TexSubImage2D", out.str(), namedParams);
   }
 
-  inline void Uniform1f(GLint location, GLfloat value ) override
+  inline void Uniform1f(GLint location, GLfloat value) override
   {
-    std::string params = ToString( value );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(value);
+    AddUniformCallToTraceStack(location, params);
 
-    if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, value ) )
+    if(!mProgramUniforms1f.SetUniformValue(mCurrentProgram, location, value))
     {
       mGetErrorResult = GL_INVALID_OPERATION;
     }
@@ -1189,16 +1189,16 @@ public:
   inline void Uniform1fv(GLint location, GLsizei count, const GLfloat* v) override
   {
     std::string params;
-    for( int i = 0; i < count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      params = params + ToString( v[i] ) + ",";
+      params = params + ToString(v[i]) + ",";
     }
 
-    AddUniformCallToTraceStack( location, params );
+    AddUniformCallToTraceStack(location, params);
 
-    for( int i = 0; i < count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, v[i] ) )
+      if(!mProgramUniforms1f.SetUniformValue(mCurrentProgram, location, v[i]))
       {
         mGetErrorResult = GL_INVALID_OPERATION;
         break;
@@ -1208,11 +1208,11 @@ public:
 
   inline void Uniform1i(GLint location, GLint x) override
   {
-    std::string params = ToString( x );
+    std::string params = ToString(x);
 
-    AddUniformCallToTraceStack( location,  params );
+    AddUniformCallToTraceStack(location, params);
 
-    if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram, location, x ) )
+    if(!mProgramUniforms1i.SetUniformValue(mCurrentProgram, location, x))
     {
       mGetErrorResult = GL_INVALID_OPERATION;
     }
@@ -1220,14 +1220,14 @@ public:
 
   inline void Uniform1iv(GLint location, GLsizei count, const GLint* v) override
   {
-    std::string params = ToString( v );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(v);
+    AddUniformCallToTraceStack(location, params);
 
-    for( int i = 0; i < count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram,
-                                                 location,
-                                                 v[i] ) )
+      if(!mProgramUniforms1i.SetUniformValue(mCurrentProgram,
+                                             location,
+                                             v[i]))
       {
         mGetErrorResult = GL_INVALID_OPERATION;
         break;
@@ -1237,12 +1237,12 @@ public:
 
   inline void Uniform2f(GLint location, GLfloat x, GLfloat y) override
   {
-    std::string params = ToString( x ) + "," + ToString( y );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(x) + "," + ToString(y);
+    AddUniformCallToTraceStack(location, params);
 
-    if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
-                                               location,
-                                               Vector2( x, y ) ) )
+    if(!mProgramUniforms2f.SetUniformValue(mCurrentProgram,
+                                           location,
+                                           Vector2(x, y)))
     {
       mGetErrorResult = GL_INVALID_OPERATION;
     }
@@ -1250,14 +1250,14 @@ public:
 
   inline void Uniform2fv(GLint location, GLsizei count, const GLfloat* v) override
   {
-    std::string params = ToString( v );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(v);
+    AddUniformCallToTraceStack(location, params);
 
-    for( int i = 0; i < count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
-                                                 location,
-                                                 Vector2( v[2*i], v[2*i+1] ) ) )
+      if(!mProgramUniforms2f.SetUniformValue(mCurrentProgram,
+                                             location,
+                                             Vector2(v[2 * i], v[2 * i + 1])))
       {
         mGetErrorResult = GL_INVALID_OPERATION;
         break;
@@ -1267,24 +1267,24 @@ public:
 
   inline void Uniform2i(GLint location, GLint x, GLint y) override
   {
-    std::string params = ToString( x ) + "," + ToString( y );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(x) + "," + ToString(y);
+    AddUniformCallToTraceStack(location, params);
   }
 
   inline void Uniform2iv(GLint location, GLsizei count, const GLint* v) override
   {
-    std::string params = ToString( v );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(v);
+    AddUniformCallToTraceStack(location, params);
   }
 
   inline void Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) override
   {
-    std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(x) + "," + ToString(y) + "," + ToString(z);
+    AddUniformCallToTraceStack(location, params);
 
-    if( ! mProgramUniforms3f.SetUniformValue( mCurrentProgram,
-                                               location,
-                                               Vector3( x, y, z ) ) )
+    if(!mProgramUniforms3f.SetUniformValue(mCurrentProgram,
+                                           location,
+                                           Vector3(x, y, z)))
     {
       mGetErrorResult = GL_INVALID_OPERATION;
     }
@@ -1292,15 +1292,15 @@ public:
 
   inline void Uniform3fv(GLint location, GLsizei count, const GLfloat* v) override
   {
-    std::string params = ToString( v );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(v);
+    AddUniformCallToTraceStack(location, params);
 
-    for( int i = 0; i < count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      if( ! mProgramUniforms3f.SetUniformValue(
-          mCurrentProgram,
-          location,
-          Vector3( v[3*i], v[3*i+1], v[3*i+2] ) ) )
+      if(!mProgramUniforms3f.SetUniformValue(
+           mCurrentProgram,
+           location,
+           Vector3(v[3 * i], v[3 * i + 1], v[3 * i + 2])))
       {
         mGetErrorResult = GL_INVALID_OPERATION;
         break;
@@ -1310,24 +1310,24 @@ public:
 
   inline void Uniform3i(GLint location, GLint x, GLint y, GLint z) override
   {
-    std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(x) + "," + ToString(y) + "," + ToString(z);
+    AddUniformCallToTraceStack(location, params);
   }
 
   inline void Uniform3iv(GLint location, GLsizei count, const GLint* v) override
   {
-    std::string params = ToString( v );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(v);
+    AddUniformCallToTraceStack(location, params);
   }
 
   inline void Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) override
   {
-    std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z ) + "," + ToString( w );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(x) + "," + ToString(y) + "," + ToString(z) + "," + ToString(w);
+    AddUniformCallToTraceStack(location, params);
 
-    if( ! mProgramUniforms4f.SetUniformValue( mCurrentProgram,
-                                              location,
-                                              Vector4( x, y, z, w ) ) )
+    if(!mProgramUniforms4f.SetUniformValue(mCurrentProgram,
+                                           location,
+                                           Vector4(x, y, z, w)))
     {
       mGetErrorResult = GL_INVALID_OPERATION;
     }
@@ -1335,15 +1335,15 @@ public:
 
   inline void Uniform4fv(GLint location, GLsizei count, const GLfloat* v) override
   {
-    std::string params = ToString( v );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(v);
+    AddUniformCallToTraceStack(location, params);
 
-    for( int i = 0; i < count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      if( ! mProgramUniforms4f.SetUniformValue(
-          mCurrentProgram,
-          location,
-          Vector4( v[4*i], v[4*i+1], v[4*i+2], v[4*i+3] ) ) )
+      if(!mProgramUniforms4f.SetUniformValue(
+           mCurrentProgram,
+           location,
+           Vector4(v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3])))
       {
         mGetErrorResult = GL_INVALID_OPERATION;
         break;
@@ -1353,33 +1353,33 @@ public:
 
   inline void Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) override
   {
-    std::string params = ToString( x ) + "," + ToString( y ) + "," + ToString( z ) + "," + ToString( w );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(x) + "," + ToString(y) + "," + ToString(z) + "," + ToString(w);
+    AddUniformCallToTraceStack(location, params);
   }
 
   inline void Uniform4iv(GLint location, GLsizei count, const GLint* v) override
   {
-    std::string params = ToString( v );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(v);
+    AddUniformCallToTraceStack(location, params);
   }
 
   inline void UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
   {
-    std::string params = ToString( value );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(value);
+    AddUniformCallToTraceStack(location, params);
   }
 
   inline void UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
   {
-    std::string params = ToString( value );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(value);
+    AddUniformCallToTraceStack(location, params);
 
-    for( int i = 0; i < count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      if( ! mProgramUniformsMat3.SetUniformValue(
-            mCurrentProgram,
-            location,
-            Matrix3( value[0], value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8] ) ) )
+      if(!mProgramUniformsMat3.SetUniformValue(
+           mCurrentProgram,
+           location,
+           Matrix3(value[0], value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8])))
       {
         mGetErrorResult = GL_INVALID_OPERATION;
         break;
@@ -1389,15 +1389,15 @@ public:
 
   inline void UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
   {
-    std::string params = ToString( value );
-    AddUniformCallToTraceStack( location, params );
+    std::string params = ToString(value);
+    AddUniformCallToTraceStack(location, params);
 
-    for( int i = 0; i < count; ++i )
+    for(int i = 0; i < count; ++i)
     {
-      if( ! mProgramUniformsMat4.SetUniformValue(
-          mCurrentProgram,
-          location,
-          Matrix( value ) ) )
+      if(!mProgramUniformsMat4.SetUniformValue(
+           mCurrentProgram,
+           location,
+           Matrix(value)))
       {
         mGetErrorResult = GL_INVALID_OPERATION;
         break;
@@ -1453,7 +1453,7 @@ public:
   inline void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) override
   {
     std::string commaString(", ");
-    std::string params( std::to_string(x) + commaString + std::to_string(y) + commaString + std::to_string(width) + commaString + std::to_string(height) );
+    std::string params(std::to_string(x) + commaString + std::to_string(y) + commaString + std::to_string(width) + commaString + std::to_string(height));
 
     mViewportTrace.PushCall("Viewport", params);
   }
@@ -1652,7 +1652,7 @@ public:
   {
   }
 
-  inline GLint GetFragDataLocation(GLuint program, const GLchar *name) override
+  inline GLint GetFragDataLocation(GLuint program, const GLcharname) override
   {
     return -1;
   }
@@ -1890,157 +1890,307 @@ public:
   }
 
 private:
-
-  inline void AddUniformCallToTraceStack( GLint location, std::string& value )
-    {
-    std::string name = "<not found>";
-    bool matched = false;
+  inline void AddUniformCallToTraceStack(GLint location, std::string& value)
+  {
+    std::string name    = "<not found>";
+    bool        matched = false;
 
     UniformIDMap& map = mUniforms[mCurrentProgram];
-    for (UniformIDMap::iterator it=map.begin(); it!=map.end(); ++it)
+    for(UniformIDMap::iterator it = map.begin(); it != map.end(); ++it)
     {
-      if( it->second == location )
+      if(it->second == location)
       {
-        name = it->first;
+        name    = it->first;
         matched = true;
         break;
       }
     }
 
-    if ( matched )
+    if(matched)
     {
-      mSetUniformTrace.PushCall( name, value );
+      mSetUniformTrace.PushCall(name, value);
     }
   }
 
-
 public: // TEST FUNCTIONS
-  inline void SetCompileStatus( GLuint value ) { mCompileStatus = value; }
-  inline void SetLinkStatus( GLuint value ) { mLinkStatus = value; }
-  inline void SetGetAttribLocationResult(  int result) { mGetAttribLocationResult = result; }
-  inline void SetGetErrorResult(  GLenum result) { mGetErrorResult = result; }
-  inline void SetGetStringResult(  GLubyte* result) { mGetStringResult = result; }
-  inline void SetIsBufferResult(  GLboolean result) { mIsBufferResult = result; }
-  inline void SetIsEnabledResult(  GLboolean result) { mIsEnabledResult = result; }
-  inline void SetIsFramebufferResult(  GLboolean result) { mIsFramebufferResult = result; }
-  inline void SetIsProgramResult(  GLboolean result) { mIsProgramResult = result; }
-  inline void SetIsRenderbufferResult(  GLboolean result) { mIsRenderbufferResult = result; }
-  inline void SetIsShaderResult(  GLboolean result) { mIsShaderResult = result; }
-  inline void SetIsTextureResult(  GLboolean result) { mIsTextureResult = result; }
-  inline void SetCheckFramebufferStatusResult(  GLenum result) { mCheckFramebufferStatusResult = result; }
-  inline void SetNumBinaryFormats( GLint numFormats ) { mNumBinaryFormats = numFormats; }
-  inline void SetBinaryFormats( GLint binaryFormats ) { mBinaryFormats = binaryFormats; }
-  inline void SetProgramBinaryLength( GLint length ) { mProgramBinaryLength = length; }
+  inline void SetCompileStatus(GLuint value)
+  {
+    mCompileStatus = value;
+  }
+  inline void SetLinkStatus(GLuint value)
+  {
+    mLinkStatus = value;
+  }
+  inline void SetGetAttribLocationResult(int result)
+  {
+    mGetAttribLocationResult = result;
+  }
+  inline void SetGetErrorResult(GLenum result)
+  {
+    mGetErrorResult = result;
+  }
+  inline void SetGetStringResult(GLubyte* result)
+  {
+    mGetStringResult = result;
+  }
+  inline void SetIsBufferResult(GLboolean result)
+  {
+    mIsBufferResult = result;
+  }
+  inline void SetIsEnabledResult(GLboolean result)
+  {
+    mIsEnabledResult = result;
+  }
+  inline void SetIsFramebufferResult(GLboolean result)
+  {
+    mIsFramebufferResult = result;
+  }
+  inline void SetIsProgramResult(GLboolean result)
+  {
+    mIsProgramResult = result;
+  }
+  inline void SetIsRenderbufferResult(GLboolean result)
+  {
+    mIsRenderbufferResult = result;
+  }
+  inline void SetIsShaderResult(GLboolean result)
+  {
+    mIsShaderResult = result;
+  }
+  inline void SetIsTextureResult(GLboolean result)
+  {
+    mIsTextureResult = result;
+  }
+  inline void SetCheckFramebufferStatusResult(GLenum result)
+  {
+    mCheckFramebufferStatusResult = result;
+  }
+  inline void SetNumBinaryFormats(GLint numFormats)
+  {
+    mNumBinaryFormats = numFormats;
+  }
+  inline void SetBinaryFormats(GLint binaryFormats)
+  {
+    mBinaryFormats = binaryFormats;
+  }
+  inline void SetProgramBinaryLength(GLint length)
+  {
+    mProgramBinaryLength = length;
+  }
 
   inline bool GetVertexAttribArrayState(GLuint index)
   {
-    if( index >= MAX_ATTRIBUTE_CACHE_SIZE )
+    if(index >= MAX_ATTRIBUTE_CACHE_SIZE)
     {
       // out of range
       return false;
     }
-    return mVertexAttribArrayState[ index ];
+    return mVertexAttribArrayState[index];
+  }
+  inline void ClearVertexAttribArrayChanged()
+  {
+    mVertexAttribArrayChanged = false;
+  }
+  inline bool GetVertexAttribArrayChanged()
+  {
+    return mVertexAttribArrayChanged;
   }
-  inline void ClearVertexAttribArrayChanged() {  mVertexAttribArrayChanged = false; }
-  inline bool GetVertexAttribArrayChanged()  { return mVertexAttribArrayChanged; }
 
   //Methods for CullFace verification
-  inline void EnableCullFaceCallTrace(bool enable) { mCullFaceTrace.Enable(enable); }
-  inline void ResetCullFaceCallStack() { mCullFaceTrace.Reset(); }
-  inline TraceCallStack& GetCullFaceTrace() { return mCullFaceTrace; }
+  inline void EnableCullFaceCallTrace(bool enable)
+  {
+    mCullFaceTrace.Enable(enable);
+  }
+  inline void ResetCullFaceCallStack()
+  {
+    mCullFaceTrace.Reset();
+  }
+  inline TraceCallStack& GetCullFaceTrace()
+  {
+    return mCullFaceTrace;
+  }
 
   //Methods for Enable/Disable call verification
-  inline void EnableEnableDisableCallTrace(bool enable) { mEnableDisableTrace.Enable(enable); }
-  inline void ResetEnableDisableCallStack() { mEnableDisableTrace.Reset(); }
-  inline TraceCallStack& GetEnableDisableTrace() { return mEnableDisableTrace; }
+  inline void EnableEnableDisableCallTrace(bool enable)
+  {
+    mEnableDisableTrace.Enable(enable);
+  }
+  inline void ResetEnableDisableCallStack()
+  {
+    mEnableDisableTrace.Reset();
+  }
+  inline TraceCallStack& GetEnableDisableTrace()
+  {
+    return mEnableDisableTrace;
+  }
 
   //Methods for Shader verification
-  inline void EnableShaderCallTrace(bool enable) { mShaderTrace.Enable(enable); }
-  inline void ResetShaderCallStack() { mShaderTrace.Reset(); }
-  inline TraceCallStack& GetShaderTrace() { return mShaderTrace; }
+  inline void EnableShaderCallTrace(bool enable)
+  {
+    mShaderTrace.Enable(enable);
+  }
+  inline void ResetShaderCallStack()
+  {
+    mShaderTrace.Reset();
+  }
+  inline TraceCallStack& GetShaderTrace()
+  {
+    return mShaderTrace;
+  }
 
   //Methods for Texture verification
-  inline void EnableTextureCallTrace(bool enable) { mTextureTrace.Enable(enable); }
-  inline void ResetTextureCallStack() { mTextureTrace.Reset(); }
-  inline TraceCallStack& GetTextureTrace() { return mTextureTrace; }
+  inline void EnableTextureCallTrace(bool enable)
+  {
+    mTextureTrace.Enable(enable);
+  }
+  inline void ResetTextureCallStack()
+  {
+    mTextureTrace.Reset();
+  }
+  inline TraceCallStack& GetTextureTrace()
+  {
+    return mTextureTrace;
+  }
 
   //Methods for Texture verification
-  inline void EnableTexParameterCallTrace(bool enable) { mTexParamaterTrace.Enable(enable); }
-  inline void ResetTexParameterCallStack() { mTexParamaterTrace.Reset(); }
-  inline TraceCallStack& GetTexParameterTrace() { return mTexParamaterTrace; }
+  inline void EnableTexParameterCallTrace(bool enable)
+  {
+    mTexParamaterTrace.Enable(enable);
+  }
+  inline void ResetTexParameterCallStack()
+  {
+    mTexParamaterTrace.Reset();
+  }
+  inline TraceCallStack& GetTexParameterTrace()
+  {
+    return mTexParamaterTrace;
+  }
 
   //Methods for Draw verification
-  inline void EnableDrawCallTrace(bool enable) { mDrawTrace.Enable(enable); }
-  inline void ResetDrawCallStack() { mDrawTrace.Reset(); }
-  inline TraceCallStack& GetDrawTrace() { return mDrawTrace; }
+  inline void EnableDrawCallTrace(bool enable)
+  {
+    mDrawTrace.Enable(enable);
+  }
+  inline void ResetDrawCallStack()
+  {
+    mDrawTrace.Reset();
+  }
+  inline TraceCallStack& GetDrawTrace()
+  {
+    return mDrawTrace;
+  }
 
   //Methods for Depth function verification
-  inline void EnableDepthFunctionCallTrace(bool enable) { mDepthFunctionTrace.Enable(enable); }
-  inline void ResetDepthFunctionCallStack() { mDepthFunctionTrace.Reset(); }
-  inline TraceCallStack& GetDepthFunctionTrace() { return mDepthFunctionTrace; }
+  inline void EnableDepthFunctionCallTrace(bool enable)
+  {
+    mDepthFunctionTrace.Enable(enable);
+  }
+  inline void ResetDepthFunctionCallStack()
+  {
+    mDepthFunctionTrace.Reset();
+  }
+  inline TraceCallStack& GetDepthFunctionTrace()
+  {
+    return mDepthFunctionTrace;
+  }
 
   //Methods for Stencil function verification
-  inline void EnableStencilFunctionCallTrace(bool enable) { mStencilFunctionTrace.Enable(enable); }
-  inline void ResetStencilFunctionCallStack() { mStencilFunctionTrace.Reset(); }
-  inline TraceCallStack& GetStencilFunctionTrace() { return mStencilFunctionTrace; }
+  inline void EnableStencilFunctionCallTrace(bool enable)
+  {
+    mStencilFunctionTrace.Enable(enable);
+  }
+  inline void ResetStencilFunctionCallStack()
+  {
+    mStencilFunctionTrace.Reset();
+  }
+  inline TraceCallStack& GetStencilFunctionTrace()
+  {
+    return mStencilFunctionTrace;
+  }
 
   //Methods for Scissor verification
-  inline void EnableScissorCallTrace(bool enable) { mScissorTrace.Enable(enable); }
-  inline void ResetScissorCallStack() { mScissorTrace.Reset(); }
-  inline TraceCallStack& GetScissorTrace() { return mScissorTrace; }
+  inline void EnableScissorCallTrace(bool enable)
+  {
+    mScissorTrace.Enable(enable);
+  }
+  inline void ResetScissorCallStack()
+  {
+    mScissorTrace.Reset();
+  }
+  inline TraceCallStack& GetScissorTrace()
+  {
+    return mScissorTrace;
+  }
 
   //Methods for Uniform function verification
-  inline void EnableSetUniformCallTrace(bool enable) { mSetUniformTrace.Enable(enable); }
-  inline void ResetSetUniformCallStack() { mSetUniformTrace.Reset(); }
-  inline TraceCallStack& GetSetUniformTrace() { return mSetUniformTrace; }
+  inline void EnableSetUniformCallTrace(bool enable)
+  {
+    mSetUniformTrace.Enable(enable);
+  }
+  inline void ResetSetUniformCallStack()
+  {
+    mSetUniformTrace.Reset();
+  }
+  inline TraceCallStack& GetSetUniformTrace()
+  {
+    return mSetUniformTrace;
+  }
 
   //Methods for Viewport verification
-  inline void EnableViewportCallTrace(bool enable) { mViewportTrace.Enable(enable); }
-  inline void ResetViewportCallStack() { mViewportTrace.Reset(); }
-  inline TraceCallStack& GetViewportTrace() { return mViewportTrace; }
+  inline void EnableViewportCallTrace(bool enable)
+  {
+    mViewportTrace.Enable(enable);
+  }
+  inline void ResetViewportCallStack()
+  {
+    mViewportTrace.Reset();
+  }
+  inline TraceCallStack& GetViewportTrace()
+  {
+    return mViewportTrace;
+  }
 
-  template <typename T>
-  inline bool GetUniformValue( const char* name, T& value ) const
+  template<typename T>
+  inline bool GetUniformValue(const char* name, T& value) const
   {
-    for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
-          program_it != mUniforms.end();
-          ++program_it )
+    for(ProgramUniformMap::const_iterator program_it = mUniforms.begin();
+        program_it != mUniforms.end();
+        ++program_it)
     {
-      const UniformIDMap &uniformIDs = program_it->second;
+      const UniformIDMapuniformIDs = program_it->second;
 
-      UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
-      if( uniform_it != uniformIDs.end() )
+      UniformIDMap::const_iterator uniform_it = uniformIDs.find(name);
+      if(uniform_it != uniformIDs.end())
       {
         // found one matching uniform name, lets check the value...
         GLuint programId = program_it->first;
-        GLint uniformId = uniform_it->second;
+        GLint  uniformId = uniform_it->second;
 
-        const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
-        return mProgramUniforms.GetUniformValue( programId, uniformId, value );
+        const ProgramUniformValue<T>& mProgramUniforms = GetProgramUniformsForType(value);
+        return mProgramUniforms.GetUniformValue(programId, uniformId, value);
       }
     }
     return false;
   }
 
-
-  template <typename T>
-  inline bool CheckUniformValue( const char* name, const T& value ) const
+  template<typename T>
+  inline bool CheckUniformValue(const char* name, const T& value) const
   {
-    for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
-          program_it != mUniforms.end();
-          ++program_it )
+    for(ProgramUniformMap::const_iterator program_it = mUniforms.begin();
+        program_it != mUniforms.end();
+        ++program_it)
     {
-      const UniformIDMap &uniformIDs = program_it->second;
+      const UniformIDMapuniformIDs = program_it->second;
 
-      UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
-      if( uniform_it != uniformIDs.end() )
+      UniformIDMap::const_iterator uniform_it = uniformIDs.find(name);
+      if(uniform_it != uniformIDs.end())
       {
         // found one matching uniform name, lets check the value...
         GLuint programId = program_it->first;
-        GLint uniformId = uniform_it->second;
+        GLint  uniformId = uniform_it->second;
 
-        const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
-        if( mProgramUniforms.CheckUniformValue( programId, uniformId, value ) )
+        const ProgramUniformValue<T>& mProgramUniforms = GetProgramUniformsForType(value);
+        if(mProgramUniforms.CheckUniformValue(programId, uniformId, value))
         {
           // the value matches
           return true;
@@ -2048,50 +2198,50 @@ public: // TEST FUNCTIONS
       }
     }
 
-    fprintf(stderr, "Not found, printing possible values:\n" );
-    for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
-          program_it != mUniforms.end();
-          ++program_it )
+    fprintf(stderr, "Not found, printing possible values:\n");
+    for(ProgramUniformMap::const_iterator program_it = mUniforms.begin();
+        program_it != mUniforms.end();
+        ++program_it)
     {
-      const UniformIDMap &uniformIDs = program_it->second;
+      const UniformIDMapuniformIDs = program_it->second;
 
-      UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
-      if( uniform_it != uniformIDs.end() )
+      UniformIDMap::const_iterator uniform_it = uniformIDs.find(name);
+      if(uniform_it != uniformIDs.end())
       {
         // found one matching uniform name, lets check the value...
         GLuint programId = program_it->first;
-        GLint uniformId = uniform_it->second;
+        GLint  uniformId = uniform_it->second;
 
-        const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
-        T origValue;
-        if ( mProgramUniforms.GetUniformValue(programId, uniformId, origValue) )
+        const ProgramUniformValue<T>& mProgramUniforms = GetProgramUniformsForType(value);
+        T                             origValue;
+        if(mProgramUniforms.GetUniformValue(programId, uniformId, origValue))
         {
           std::stringstream out;
           out << uniform_it->first << ": " << origValue;
-          fprintf(stderr, "%s\n", out.str().c_str() );
+          fprintf(stderr, "%s\n", out.str().c_str());
         }
       }
     }
     return false;
   }
 
-  template <typename T>
-  inline bool GetUniformValue( GLuint programId, GLuint uniformId, T& outValue) const
+  template<typename T>
+  inline bool GetUniformValue(GLuint programId, GLuint uniformId, T& outValue) const
   {
-    const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( outValue );
-    return mProgramUniforms.GetUniformValue( programId, uniformId, outValue );
+    const ProgramUniformValue<T>& mProgramUniforms = GetProgramUniformsForType(outValue);
+    return mProgramUniforms.GetUniformValue(programId, uniformId, outValue);
   }
 
-  inline bool GetUniformIds( const char* name, GLuint& programId, GLuint& uniformId ) const
+  inline bool GetUniformIds(const char* name, GLuint& programId, GLuint& uniformId) const
   {
-    for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
-          program_it != mUniforms.end();
-          ++program_it )
+    for(ProgramUniformMap::const_iterator program_it = mUniforms.begin();
+        program_it != mUniforms.end();
+        ++program_it)
     {
-      const UniformIDMap &uniformIDs = program_it->second;
+      const UniformIDMapuniformIDs = program_it->second;
 
-      UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
-      if( uniform_it != uniformIDs.end() )
+      UniformIDMap::const_iterator uniform_it = uniformIDs.find(name);
+      if(uniform_it != uniformIDs.end())
       {
         programId = program_it->first;
         uniformId = uniform_it->second;
@@ -2130,16 +2280,25 @@ public: // TEST FUNCTIONS
 
   struct ScissorParams
   {
-    GLint x;
-    GLint y;
+    GLint   x;
+    GLint   y;
     GLsizei width;
     GLsizei height;
 
-    ScissorParams() : x( 0 ), y( 0 ), width( 0 ), height( 0 ) { }
+    ScissorParams()
+    : x(0),
+      y(0),
+      width(0),
+      height(0)
+    {
+    }
   };
 
   // Methods to check scissor tests
-  inline const ScissorParams& GetScissorParams() const { return mScissorParams; }
+  inline const ScissorParams& GetScissorParams() const
+  {
+    return mScissorParams;
+  }
 
   struct ColorMaskParams
   {
@@ -2148,59 +2307,86 @@ public: // TEST FUNCTIONS
     GLboolean blue;
     GLboolean alpha;
 
-    ColorMaskParams() : red( true ), green( true ), blue( true ), alpha( true ) { }
+    ColorMaskParams()
+    : red(true),
+      green(true),
+      blue(true),
+      alpha(true)
+    {
+    }
   };
 
-  inline bool GetProgramBinaryCalled() const { return mGetProgramBinaryCalled; }
+  inline bool GetProgramBinaryCalled() const
+  {
+    return mGetProgramBinaryCalled;
+  }
 
-  inline unsigned int GetClearCountCalled() const { return mClearCount; }
+  inline unsigned int GetClearCountCalled() const
+  {
+    return mClearCount;
+  }
 
-  inline const ColorMaskParams& GetColorMaskParams() const { return mColorMaskParams; }
+  inline const ColorMaskParams& GetColorMaskParams() const
+  {
+    return mColorMaskParams;
+  }
 
-  typedef std::vector<size_t> BufferDataCalls;
-  inline const BufferDataCalls& GetBufferDataCalls() const { return mBufferDataCalls; }
-  inline void ResetBufferDataCalls() { mBufferDataCalls.clear(); }
+  typedef std::vector<size_t>   BufferDataCalls;
+  inline const BufferDataCalls& GetBufferDataCalls() const
+  {
+    return mBufferDataCalls;
+  }
+  inline void ResetBufferDataCalls()
+  {
+    mBufferDataCalls.clear();
+  }
 
-  typedef std::vector<size_t> BufferSubDataCalls;
-  inline const BufferSubDataCalls& GetBufferSubDataCalls() const { return mBufferSubDataCalls; }
-  inline void ResetBufferSubDataCalls() { mBufferSubDataCalls.clear(); }
+  typedef std::vector<size_t>      BufferSubDataCalls;
+  inline const BufferSubDataCalls& GetBufferSubDataCalls() const
+  {
+    return mBufferSubDataCalls;
+  }
+  inline void ResetBufferSubDataCalls()
+  {
+    mBufferSubDataCalls.clear();
+  }
 
 private:
-  GLuint     mCurrentProgram;
-  GLuint     mCompileStatus;
-  BufferDataCalls mBufferDataCalls;
-  BufferSubDataCalls mBufferSubDataCalls;
-  GLuint     mLinkStatus;
-  GLint      mNumberOfActiveUniforms;
-  GLint      mGetAttribLocationResult;
-  GLenum     mGetErrorResult;
-  GLubyte*   mGetStringResult;
-  GLboolean  mIsBufferResult;
-  GLboolean  mIsEnabledResult;
-  GLboolean  mIsFramebufferResult;
-  GLboolean  mIsProgramResult;
-  GLboolean  mIsRenderbufferResult;
-  GLboolean  mIsShaderResult;
-  GLboolean  mIsTextureResult;
-  GLenum     mActiveTextureUnit;
-  GLenum     mCheckFramebufferStatusResult;
-  GLint      mFramebufferStatus;
-  GLenum     mFramebufferDepthAttached;
-  GLenum     mFramebufferStencilAttached;
-  GLuint     mFramebufferColorAttachmentCount;
-  GLuint     mFrameBufferColorStatus;
-  GLint      mNumBinaryFormats;
-  GLint      mBinaryFormats;
-  GLint      mProgramBinaryLength;
-  bool       mVertexAttribArrayState[MAX_ATTRIBUTE_CACHE_SIZE];
-  bool       mVertexAttribArrayChanged;                            // whether the vertex attrib array has been changed
-  bool       mGetProgramBinaryCalled;
-  typedef std::map< GLuint, std::string> ShaderSourceMap;
-  ShaderSourceMap mShaderSources;
-  GLuint     mLastShaderCompiled;
-  GLbitfield mLastClearBitMask;
-  Vector4 mLastClearColor;
-  unsigned int mClearCount;
+  GLuint                                mCurrentProgram;
+  GLuint                                mCompileStatus;
+  BufferDataCalls                       mBufferDataCalls;
+  BufferSubDataCalls                    mBufferSubDataCalls;
+  GLuint                                mLinkStatus;
+  GLint                                 mNumberOfActiveUniforms;
+  GLint                                 mGetAttribLocationResult;
+  GLenum                                mGetErrorResult;
+  GLubyte*                              mGetStringResult;
+  GLboolean                             mIsBufferResult;
+  GLboolean                             mIsEnabledResult;
+  GLboolean                             mIsFramebufferResult;
+  GLboolean                             mIsProgramResult;
+  GLboolean                             mIsRenderbufferResult;
+  GLboolean                             mIsShaderResult;
+  GLboolean                             mIsTextureResult;
+  GLenum                                mActiveTextureUnit;
+  GLenum                                mCheckFramebufferStatusResult;
+  GLint                                 mFramebufferStatus;
+  GLenum                                mFramebufferDepthAttached;
+  GLenum                                mFramebufferStencilAttached;
+  GLuint                                mFramebufferColorAttachmentCount;
+  GLuint                                mFrameBufferColorStatus;
+  GLint                                 mNumBinaryFormats;
+  GLint                                 mBinaryFormats;
+  GLint                                 mProgramBinaryLength;
+  bool                                  mVertexAttribArrayState[MAX_ATTRIBUTE_CACHE_SIZE];
+  bool                                  mVertexAttribArrayChanged; // whether the vertex attrib array has been changed
+  bool                                  mGetProgramBinaryCalled;
+  typedef std::map<GLuint, std::string> ShaderSourceMap;
+  ShaderSourceMap                       mShaderSources;
+  GLuint                                mLastShaderCompiled;
+  GLbitfield                            mLastClearBitMask;
+  Vector4                               mLastClearColor;
+  unsigned int                          mClearCount;
 
   Vector4 mLastBlendColor;
   GLenum  mLastBlendEquationRgb;
@@ -2213,8 +2399,8 @@ private:
   GLboolean mLastDepthMask;
 
   // Data for manipulating the IDs returned by GenTextures
-  GLuint mLastAutoTextureIdUsed;
-  GLuint mNumGeneratedTextures;
+  GLuint              mLastAutoTextureIdUsed;
+  GLuint              mNumGeneratedTextures;
   std::vector<GLuint> mNextTextureIds;
   std::vector<GLuint> mDeletedTextureIds;
   std::vector<GLuint> mBoundTextures;
@@ -2224,7 +2410,7 @@ private:
     std::vector<GLuint> mBoundTextures;
   };
 
-  ActiveTextureType mActiveTextures[ MIN_TEXTURE_UNIT_LIMIT ];
+  ActiveTextureType mActiveTextures[MIN_TEXTURE_UNIT_LIMIT];
 
   TraceCallStack mCullFaceTrace;
   TraceCallStack mEnableDisableTrace;
@@ -2239,46 +2425,46 @@ private:
   TraceCallStack mViewportTrace;
 
   // Shaders & Uniforms
-  GLuint mLastShaderIdUsed;
-  GLuint mLastProgramIdUsed;
-  GLuint mLastUniformIdUsed;
-  typedef std::map< std::string, GLint > UniformIDMap;
-  typedef std::map< GLuint, UniformIDMap > ProgramUniformMap;
-  ProgramUniformMap mUniforms;
+  GLuint                                 mLastShaderIdUsed;
+  GLuint                                 mLastProgramIdUsed;
+  GLuint                                 mLastUniformIdUsed;
+  typedef std::map<std::string, GLint>   UniformIDMap;
+  typedef std::map<GLuint, UniformIDMap> ProgramUniformMap;
+  ProgramUniformMap                      mUniforms;
 
-  template <typename T>
-  struct ProgramUniformValue : public std::map< GLuint, std::map< GLint, T > >
+  template<typename T>
+  struct ProgramUniformValue : public std::map<GLuint, std::map<GLint, T> >
   {
   public:
-    typedef std::map< GLint, T > UniformValueMap;
-    typedef std::map< GLuint, UniformValueMap > Map;
+    typedef std::map<GLint, T>                UniformValueMap;
+    typedef std::map<GLuint, UniformValueMap> Map;
 
-    bool SetUniformValue( GLuint program, GLuint uniform, const T& value )
+    bool SetUniformValue(GLuint program, GLuint uniform, const T& value)
     {
-      if( program == 0 )
+      if(program == 0)
       {
         return false;
       }
 
-      typename Map::iterator it = Map::find( program );
-      if( it == Map::end() )
+      typename Map::iterator it = Map::find(program);
+      if(it == Map::end())
       {
         // if its the first uniform for this program add it
-        std::pair< typename Map::iterator, bool > result =
-            Map::insert( typename Map::value_type( program, UniformValueMap() ) );
+        std::pair<typename Map::iterator, bool> result =
+          Map::insert(typename Map::value_type(program, UniformValueMap()));
         it = result.first;
       }
 
       UniformValueMap& uniforms = it->second;
-      uniforms[uniform] = value;
+      uniforms[uniform]         = value;
 
       return true;
     }
 
-    bool CheckUniformValue( GLuint program, GLuint uniform, const T& value ) const
+    bool CheckUniformValue(GLuint program, GLuint uniform, const T& value) const
     {
       T uniformValue;
-      if ( GetUniformValue( program, uniform, uniformValue ) )
+      if(GetUniformValue(program, uniform, uniformValue))
       {
         return CompareType<T>(value, uniformValue, Math::MACHINE_EPSILON_10);
       }
@@ -2286,24 +2472,24 @@ private:
       return false;
     }
 
-    bool GetUniformValue( GLuint program, GLuint uniform, T& value ) const
+    bool GetUniformValue(GLuint program, GLuint uniform, T& value) const
     {
-      if( program == 0 )
+      if(program == 0)
       {
         return false;
       }
 
-      typename Map::const_iterator it = Map::find( program );
-      if( it == Map::end() )
+      typename Map::const_iterator it = Map::find(program);
+      if(it == Map::end())
       {
         // Uniform values always initialised as 0
         value = GetZero();
         return true;
       }
 
-      const UniformValueMap& uniforms = it->second;
-      typename UniformValueMap::const_iterator it2 = uniforms.find( uniform );
-      if( it2 == uniforms.end() )
+      const UniformValueMap&                   uniforms = it->second;
+      typename UniformValueMap::const_iterator it2      = uniforms.find(uniform);
+      if(it2 == uniforms.end())
       {
         // Uniform values always initialised as 0
         value = GetZero();
@@ -2316,97 +2502,97 @@ private:
 
     T GetZero() const;
   };
-  ProgramUniformValue<int> mProgramUniforms1i;
-  ProgramUniformValue<float> mProgramUniforms1f;
+  ProgramUniformValue<int>     mProgramUniforms1i;
+  ProgramUniformValue<float>   mProgramUniforms1f;
   ProgramUniformValue<Vector2> mProgramUniforms2f;
   ProgramUniformValue<Vector3> mProgramUniforms3f;
   ProgramUniformValue<Vector4> mProgramUniforms4f;
-  ProgramUniformValue<Matrix> mProgramUniformsMat4;
+  ProgramUniformValue<Matrix>  mProgramUniformsMat4;
   ProgramUniformValue<Matrix3> mProgramUniformsMat3;
 
-  inline const ProgramUniformValue<int>& GetProgramUniformsForType( const int ) const
+  inline const ProgramUniformValue<int>& GetProgramUniformsForType(const int) const
   {
     return mProgramUniforms1i;
   }
-  inline const ProgramUniformValue<float>& GetProgramUniformsForType( const float ) const
+  inline const ProgramUniformValue<float>& GetProgramUniformsForType(const float) const
   {
     return mProgramUniforms1f;
   }
-  inline const ProgramUniformValue<Vector2>& GetProgramUniformsForType( const Vector2& ) const
+  inline const ProgramUniformValue<Vector2>& GetProgramUniformsForType(const Vector2&) const
   {
     return mProgramUniforms2f;
   }
-  inline const ProgramUniformValue<Vector3>& GetProgramUniformsForType( const Vector3& ) const
+  inline const ProgramUniformValue<Vector3>& GetProgramUniformsForType(const Vector3&) const
   {
     return mProgramUniforms3f;
   }
-  inline const ProgramUniformValue<Vector4>& GetProgramUniformsForType( const Vector4& ) const
+  inline const ProgramUniformValue<Vector4>& GetProgramUniformsForType(const Vector4&) const
   {
     return mProgramUniforms4f;
   }
-  inline const ProgramUniformValue<Matrix>& GetProgramUniformsForType( const Matrix& ) const
+  inline const ProgramUniformValue<Matrix>& GetProgramUniformsForType(const Matrix&) const
   {
     return mProgramUniformsMat4;
   }
-  inline const ProgramUniformValue<Matrix3>& GetProgramUniformsForType( const Matrix3& ) const
+  inline const ProgramUniformValue<Matrix3>& GetProgramUniformsForType(const Matrix3&) const
   {
     return mProgramUniformsMat3;
   }
   inline void SetVertexAttribArray(GLuint index, bool state)
   {
-    if( index >= MAX_ATTRIBUTE_CACHE_SIZE )
+    if(index >= MAX_ATTRIBUTE_CACHE_SIZE)
     {
       // out of range
       return;
     }
-    mVertexAttribArrayState[ index ] = state;
-    mVertexAttribArrayChanged = true;
+    mVertexAttribArrayState[index] = state;
+    mVertexAttribArrayChanged      = true;
   }
 
-  ScissorParams mScissorParams;
+  ScissorParams   mScissorParams;
   ColorMaskParams mColorMaskParams;
 };
 
-template <>
+template<>
 inline int TestGlAbstraction::ProgramUniformValue<int>::GetZero() const
 {
   return 0;
 }
 
-template <>
+template<>
 inline float TestGlAbstraction::ProgramUniformValue<float>::GetZero() const
 {
   return 0.0f;
 }
 
-template <>
+template<>
 inline Vector2 TestGlAbstraction::ProgramUniformValue<Vector2>::GetZero() const
 {
   return Vector2::ZERO;
 }
 
-template <>
+template<>
 inline Vector3 TestGlAbstraction::ProgramUniformValue<Vector3>::GetZero() const
 {
   return Vector3::ZERO;
 }
 
-template <>
+template<>
 inline Vector4 TestGlAbstraction::ProgramUniformValue<Vector4>::GetZero() const
 {
   return Vector4::ZERO;
 }
 
-template <>
+template<>
 inline Matrix TestGlAbstraction::ProgramUniformValue<Matrix>::GetZero() const
 {
   return Matrix();
 }
 
-template <>
+template<>
 inline Matrix3 TestGlAbstraction::ProgramUniformValue<Matrix3>::GetZero() const
 {
-  return Matrix3( Matrix() );
+  return Matrix3(Matrix());
 }
 
 } // namespace Dali
@@ -2414,5 +2600,4 @@ inline Matrix3 TestGlAbstraction::ProgramUniformValue<Matrix3>::GetZero() const
 bool BlendEnabled(const Dali::TraceCallStack& callStack);
 bool BlendDisabled(const Dali::TraceCallStack& callStack);
 
-
 #endif // TEST_GL_ABSTRACTION_H
index 8ef26dc..1a5a54c 100644 (file)
 
 namespace Dali
 {
-
 /**
  * Class to emulate the GL context helper
  */
-class DALI_CORE_API TestGlContextHelperAbstraction: public Integration::GlContextHelperAbstraction
+class DALI_CORE_API TestGlContextHelperAbstraction : public Integration::GlContextHelperAbstraction
 {
 public:
   /**
    * Constructor
    */
-  TestGlContextHelperAbstraction() {};
+  TestGlContextHelperAbstraction(){};
 
   /**
    * Destructor
    */
-  ~TestGlContextHelperAbstraction() override {};
+  ~TestGlContextHelperAbstraction() override{};
 
   /**
    * @brief Switch to the surfaceless GL context
    */
-  void MakeSurfacelessContextCurrent() override {};
+  void MakeSurfacelessContextCurrent() override{};
 
   /**
    * @brief Clear the GL context
    */
-  void MakeContextNull() override {};
+  void MakeContextNull() override{};
 
   /**
    * @brief Wait until all GL rendering calls for the current GL context are executed
    */
-  void WaitClient() override {};
+  void WaitClient() override{};
 
 private:
-
-  TestGlContextHelperAbstraction( const TestGlContextHelperAbstraction& ); ///< Undefined
-  TestGlContextHelperAbstraction& operator=( const TestGlContextHelperAbstraction& ); ///< Undefined
+  TestGlContextHelperAbstraction(const TestGlContextHelperAbstraction&);            ///< Undefined
+  TestGlContextHelperAbstraction& operator=(const TestGlContextHelperAbstraction&); ///< Undefined
 };
 
-} // Dali
+} // namespace Dali
 
 #endif // TEST_GL_CONTEXT_HELPER_ABSTRACTION_H
index 858e930..f404f32 100644 (file)
@@ -19,7 +19,6 @@
 
 namespace Dali
 {
-
 TestSyncObject::TestSyncObject(TraceCallStack& trace)
 : synced(false),
   mTrace(trace)
@@ -36,8 +35,6 @@ bool TestSyncObject::IsSynced()
   return synced;
 }
 
-
-
 TestGlSyncAbstraction::TestGlSyncAbstraction()
 {
   Initialize();
@@ -48,7 +45,7 @@ TestGlSyncAbstraction::TestGlSyncAbstraction()
  */
 TestGlSyncAbstraction::~TestGlSyncAbstraction()
 {
-  for( SyncIter iter=mSyncObjects.begin(), end=mSyncObjects.end(); iter != end; ++iter )
+  for(SyncIter iter = mSyncObjects.begin(), end = mSyncObjects.end(); iter != end; ++iter)
   {
     delete *iter;
   }
@@ -66,12 +63,12 @@ void TestGlSyncAbstraction::Initialize()
  * Create a sync object
  * @return the sync object
  */
-Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::CreateSyncObject( )
+Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::CreateSyncObject()
 {
   mTrace.PushCall("CreateSyncObject", ""); // Trace the method
 
   TestSyncObject* syncObject = new TestSyncObject(mTrace);
-  mSyncObjects.push_back( syncObject );
+  mSyncObjects.push_back(syncObject);
   return syncObject;
 }
 
@@ -79,15 +76,15 @@ Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::CreateSyncObj
  * Destroy a sync object
  * @param[in] syncObject The object to destroy
  */
-void TestGlSyncAbstraction::DestroySyncObject( Integration::GlSyncAbstraction::SyncObject* syncObject )
+void TestGlSyncAbstraction::DestroySyncObject(Integration::GlSyncAbstraction::SyncObject* syncObject)
 {
   std::stringstream out;
   out << syncObject;
   mTrace.PushCall("DestroySyncObject", out.str()); // Trace the method
 
-  for( SyncIter iter=mSyncObjects.begin(), end=mSyncObjects.end(); iter != end; ++iter )
+  for(SyncIter iter = mSyncObjects.begin(), end = mSyncObjects.end(); iter != end; ++iter)
   {
-    if( *iter == syncObject )
+    if(*iter == syncObject)
     {
       delete *iter;
       mSyncObjects.erase(iter);
@@ -96,10 +93,9 @@ void TestGlSyncAbstraction::DestroySyncObject( Integration::GlSyncAbstraction::S
   }
 }
 
-
-Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::GetLastSyncObject( )
+Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::GetLastSyncObject()
 {
-  if( !mSyncObjects.empty() )
+  if(!mSyncObjects.empty())
   {
     return mSyncObjects.back();
   }
@@ -111,31 +107,39 @@ Integration::GlSyncAbstraction::SyncObject* TestGlSyncAbstraction::GetLastSyncOb
  * @param[in]
  * @param[in] sync The sync value to set
  */
-void TestGlSyncAbstraction::SetObjectSynced( Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync )
+void TestGlSyncAbstraction::SetObjectSynced(Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync)
 {
   TestSyncObject* testSyncObject = static_cast<TestSyncObject*>(syncObject);
-  testSyncObject->synced = sync;
+  testSyncObject->synced         = sync;
 }
 
 /**
  * Turn trace on
  */
-void TestGlSyncAbstraction::EnableTrace(bool enable) { mTrace.Enable(enable); }
+void TestGlSyncAbstraction::EnableTrace(bool enable)
+{
+  mTrace.Enable(enable);
+}
 
 /**
  * Reset the trace callstack
  */
-void TestGlSyncAbstraction::ResetTrace() { mTrace.Reset(); }
+void TestGlSyncAbstraction::ResetTrace()
+{
+  mTrace.Reset();
+}
 
 /**
  * Get the trace object (allows test case to find methods on it)
  */
-TraceCallStack& TestGlSyncAbstraction::GetTrace() { return mTrace; }
+TraceCallStack& TestGlSyncAbstraction::GetTrace()
+{
+  return mTrace;
+}
 
 int32_t TestGlSyncAbstraction::GetNumberOfSyncObjects()
 {
-  return static_cast<int32_t>( mSyncObjects.size() );
+  return static_cast<int32_t>(mSyncObjects.size());
 }
 
-
-} // Dali
+} // namespace Dali
index 6524a06..6a01143 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_GL_SYNC_ABSTRACTION_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  */
 
 // EXTERNAL INCLUDES
+#include <map>
 #include <sstream>
 #include <string>
-#include <map>
 
 // INTERNAL INCLUDES
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/gl-sync-abstraction.h>
+
 #include "test-trace-call-stack.h"
 
 namespace Dali
 {
-
 class DALI_CORE_API TestSyncObject : public Integration::GlSyncAbstraction::SyncObject
 {
 public:
   TestSyncObject(TraceCallStack& trace);
   ~TestSyncObject() override;
-  bool IsSynced() override;
-  bool synced;
+  bool            IsSynced() override;
+  bool            synced;
   TraceCallStack& mTrace;
 };
 
 /**
  * Class to emulate the GL sync functions with tracing
  */
-class DALI_CORE_API TestGlSyncAbstraction: public Integration::GlSyncAbstraction
+class DALI_CORE_API TestGlSyncAbstraction : public Integration::GlSyncAbstraction
 {
 public:
   /**
@@ -66,24 +66,23 @@ public:
    * Create a sync object
    * @return the sync object
    */
-  Integration::GlSyncAbstraction::SyncObject* CreateSyncObject( ) override;
+  Integration::GlSyncAbstraction::SyncObject* CreateSyncObject() override;
 
   /**
    * Destroy a sync object
    * @param[in] syncObject The object to destroy
    */
-  void DestroySyncObject( Integration::GlSyncAbstraction::SyncObject* syncObject ) override;
-
+  void DestroySyncObject(Integration::GlSyncAbstraction::SyncObject* syncObject) override;
 
 public: // TEST FUNCTIONS
-  Integration::GlSyncAbstraction::SyncObject* GetLastSyncObject( );
+  Integration::GlSyncAbstraction::SyncObject* GetLastSyncObject();
 
   /**
    * Test method to trigger the object sync behaviour.
    * @param[in]
    * @param[in] sync The sync value to set
    */
-  void SetObjectSynced( Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync );
+  void SetObjectSynced(Integration::GlSyncAbstraction::SyncObject* syncObject, bool sync);
 
   /**
    * Turn trace on
@@ -108,16 +107,15 @@ public: // TEST FUNCTIONS
   int32_t GetNumberOfSyncObjects();
 
 private:
+  TestGlSyncAbstraction(const TestGlSyncAbstraction&);            ///< Undefined
+  TestGlSyncAbstraction& operator=(const TestGlSyncAbstraction&); ///< Undefined
 
-  TestGlSyncAbstraction( const TestGlSyncAbstraction& ); ///< Undefined
-  TestGlSyncAbstraction& operator=( const TestGlSyncAbstraction& ); ///< Undefined
-
-  typedef std::vector<TestSyncObject*>   SyncContainer;
-  typedef SyncContainer::iterator SyncIter;
-  SyncContainer mSyncObjects;  ///< The sync objects
-  TraceCallStack mTrace; ///< the trace call stack for testing
+  typedef std::vector<TestSyncObject*> SyncContainer;
+  typedef SyncContainer::iterator      SyncIter;
+  SyncContainer                        mSyncObjects; ///< The sync objects
+  TraceCallStack                       mTrace;       ///< the trace call stack for testing
 };
 
-} // Dali
+} // namespace Dali
 
 #endif // TEST_GL_SYNC_ABSTRACTION_H
index b42b9f9..0b814e7 100644 (file)
  */
 
 #include "test-harness.h"
+
+#include <fcntl.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <testcase.h>
 #include <unistd.h>
-#include <vector>
-#include <map>
+
 #include <cstring>
-#include <testcase.h>
-#include <fcntl.h>
+#include <map>
+#include <vector>
 
 namespace TestHarness
 {
-
 typedef std::map<int32_t, TestCase> RunningTestCases;
 
 const char* basename(const char* path)
 {
-  const char* ptr=path;
-  const char* slash=NULL;
-  for( ; *ptr != '\0' ; ++ptr )
+  const char* ptr   = path;
+  const char* slash = NULL;
+  for(; *ptr != '\0'; ++ptr)
   {
-    if(*ptr == '/') slash=ptr;
+    if(*ptr == '/') slash = ptr;
   }
   if(slash != NULL) ++slash;
   return slash;
@@ -56,14 +57,14 @@ void SuppressLogOutput()
   open("/dev/null", O_RDWR); // Redirect file descriptor number 2 (i.e. stderr) to /dev/null
 }
 
-int32_t RunTestCase( struct ::testcase_s& testCase )
+int32_t RunTestCase(struct ::testcase_s& testCase)
 {
   int32_t result = EXIT_STATUS_TESTCASE_FAILED;
 
-// dont want to catch exception as we want to be able to get
-// gdb stack trace from the first error
-// by default tests should all always pass with no exceptions
-  if( testCase.startup )
+  // dont want to catch exception as we want to be able to get
+  // gdb stack trace from the first error
+  // by default tests should all always pass with no exceptions
+  if(testCase.startup)
   {
     testCase.startup();
   }
@@ -71,11 +72,11 @@ int32_t RunTestCase( struct ::testcase_s& testCase )
   {
     result = testCase.function();
   }
-  catch( const char* )
+  catch(const char*)
   {
     // just catch test fail exception, return is already set to EXIT_STATUS_TESTCASE_FAILED
   }
-  if( testCase.cleanup )
+  if(testCase.cleanup)
   {
     testCase.cleanup();
   }
@@ -83,36 +84,35 @@ int32_t RunTestCase( struct ::testcase_s& testCase )
   return result;
 }
 
-
-int32_t RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
+int32_t RunTestCaseInChildProcess(struct ::testcase_s& testCase, bool suppressOutput)
 {
   int32_t testResult = EXIT_STATUS_TESTCASE_FAILED;
 
   int32_t pid = fork();
-  if( pid == 0 ) // Child process
+  if(pid == 0) // Child process
   {
-    if( suppressOutput )
+    if(suppressOutput)
     {
       SuppressLogOutput();
     }
     else
     {
       printf("\n");
-      for(int32_t i=0; i<80; ++i) printf("#");
+      for(int32_t i = 0; i < 80; ++i) printf("#");
       printf("\nTC: %s\n", testCase.name);
       fflush(stdout);
     }
 
-    int32_t status = RunTestCase( testCase );
+    int32_t status = RunTestCase(testCase);
 
-    if( ! suppressOutput )
+    if(!suppressOutput)
     {
       fflush(stdout);
       fflush(stderr);
       fclose(stdout);
       fclose(stderr);
     }
-    exit( status );
+    exit(status);
   }
   else if(pid == -1)
   {
@@ -121,31 +121,31 @@ int32_t RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressO
   }
   else // Parent process
   {
-    int32_t status = 0;
+    int32_t status   = 0;
     int32_t childPid = waitpid(pid, &status, 0);
-    if( childPid == -1 )
+    if(childPid == -1)
     {
       perror("waitpid");
       exit(EXIT_STATUS_WAITPID_FAILED);
     }
-    if( WIFEXITED(status) )
+    if(WIFEXITED(status))
     {
-      if( childPid > 0 )
+      if(childPid > 0)
       {
         testResult = WEXITSTATUS(status);
-        if( testResult )
+        if(testResult)
         {
           printf("Test case %s failed: %d\n", testCase.name, testResult);
         }
       }
     }
-    else if(WIFSIGNALED(status) )
+    else if(WIFSIGNALED(status))
     {
       int32_t signal = WTERMSIG(status);
-      testResult = EXIT_STATUS_TESTCASE_ABORTED;
-      if( signal == SIGABRT )
+      testResult     = EXIT_STATUS_TESTCASE_ABORTED;
+      if(signal == SIGABRT)
       {
-        printf("Test case %s failed: test case asserted\n", testCase.name );
+        printf("Test case %s failed: test case asserted\n", testCase.name);
       }
       else
       {
@@ -162,43 +162,43 @@ int32_t RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressO
   return testResult;
 }
 
-void OutputStatistics( const char* processName, int32_t numPasses, int32_t numFailures )
+void OutputStatistics(const char* processName, int32_t numPasses, int32_t numFailures)
 {
-  FILE* fp=fopen("summary.xml", "a");
-  if( fp != NULL )
+  FILE* fp = fopen("summary.xml", "a");
+  if(fp != NULL)
   {
-    fprintf( fp,
-             "  <suite name=\"%s\">\n"
-             "    <total_case>%d</total_case>\n"
-             "    <pass_case>%d</pass_case>\n"
-             "    <pass_rate>%5.2f</pass_rate>\n"
-             "    <fail_case>%d</fail_case>\n"
-             "    <fail_rate>%5.2f</fail_rate>\n"
-             "    <block_case>0</block_case>\n"
-             "    <block_rate>0.00</block_rate>\n"
-             "    <na_case>0</na_case>\n"
-             "    <na_rate>0.00</na_rate>\n"
-             "  </suite>\n",
-             basename(processName),
-             numPasses+numFailures,
-             numPasses,
-             (float)numPasses/(numPasses+numFailures),
-             numFailures,
-             (float)numFailures/(numPasses+numFailures) );
+    fprintf(fp,
+            "  <suite name=\"%s\">\n"
+            "    <total_case>%d</total_case>\n"
+            "    <pass_case>%d</pass_case>\n"
+            "    <pass_rate>%5.2f</pass_rate>\n"
+            "    <fail_case>%d</fail_case>\n"
+            "    <fail_rate>%5.2f</fail_rate>\n"
+            "    <block_case>0</block_case>\n"
+            "    <block_rate>0.00</block_rate>\n"
+            "    <na_case>0</na_case>\n"
+            "    <na_rate>0.00</na_rate>\n"
+            "  </suite>\n",
+            basename(processName),
+            numPasses + numFailures,
+            numPasses,
+            (float)numPasses / (numPasses + numFailures),
+            numFailures,
+            (float)numFailures / (numPasses + numFailures));
     fclose(fp);
   }
 }
 
-int32_t RunAll( const char* processName, ::testcase tc_array[] )
+int32_t RunAll(const char* processName, ::testcase tc_array[])
 {
   int32_t numFailures = 0;
-  int32_t numPasses = 0;
+  int32_t numPasses   = 0;
 
   // Run test cases in child process( to kill output/handle signals ), but run serially.
-  for( uint32_t i=0; tc_array[i].name; i++)
+  for(uint32_t i = 0; tc_array[i].name; i++)
   {
-    int32_t result = RunTestCaseInChildProcess( tc_array[i], false );
-    if( result == 0 )
+    int32_t result = RunTestCaseInChildProcess(tc_array[i], false);
+    if(result == 0)
     {
       numPasses++;
     }
@@ -208,36 +208,36 @@ int32_t RunAll( const char* processName, ::testcase tc_array[] )
     }
   }
 
-  OutputStatistics( processName, numPasses, numFailures);
+  OutputStatistics(processName, numPasses, numFailures);
 
   return numFailures;
 }
 
 // Constantly runs up to MAX_NUM_CHILDREN processes
-int32_t RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRunFailed)
+int32_t RunAllInParallel(const char* processName, ::testcase tc_array[], bool reRunFailed)
 {
   int32_t numFailures = 0;
-  int32_t numPasses = 0;
+  int32_t numPasses   = 0;
 
-  RunningTestCases children;
+  RunningTestCases     children;
   std::vector<int32_t> failedTestCases;
 
   // Fork up to MAX_NUM_CHILDREN processes, then
   // wait. As soon as a proc completes, fork the next.
 
-  int32_t nextTestCase = 0;
+  int32_t nextTestCase       = 0;
   int32_t numRunningChildren = 0;
 
-  while( tc_array[nextTestCase].name || numRunningChildren > 0)
+  while(tc_array[nextTestCase].name || numRunningChildren > 0)
   {
     // Create more children (up to the max number or til the end of the array)
-    while( numRunningChildren < MAX_NUM_CHILDREN && tc_array[nextTestCase].name )
+    while(numRunningChildren < MAX_NUM_CHILDREN && tc_array[nextTestCase].name)
     {
       int32_t pid = fork();
-      if( pid == 0 ) // Child process
+      if(pid == 0) // Child process
       {
         SuppressLogOutput();
-        exit( RunTestCase( tc_array[nextTestCase] ) );
+        exit(RunTestCase(tc_array[nextTestCase]));
       }
       else if(pid == -1)
       {
@@ -255,20 +255,20 @@ int32_t RunAllInParallel(  const char* processName, ::testcase tc_array[], bool
 
     // Wait for the next child to finish
 
-    int32_t status=0;
+    int32_t status   = 0;
     int32_t childPid = waitpid(-1, &status, 0);
-    if( childPid == -1 )
+    if(childPid == -1)
     {
       perror("waitpid");
       exit(EXIT_STATUS_WAITPID_FAILED);
     }
 
-    if( WIFEXITED(status) )
+    if(WIFEXITED(status))
     {
-      if( childPid > 0 )
+      if(childPid > 0)
       {
         int32_t testResult = WEXITSTATUS(status);
-        if( testResult )
+        if(testResult)
         {
           printf("Test case %s failed: %d\n", children[childPid].testCaseName, testResult);
           failedTestCases.push_back(children[childPid].testCase);
@@ -282,14 +282,14 @@ int32_t RunAllInParallel(  const char* processName, ::testcase tc_array[], bool
       }
     }
 
-    else if( WIFSIGNALED(status) || WIFSTOPPED(status))
+    else if(WIFSIGNALED(status) || WIFSTOPPED(status))
     {
-      status = WIFSIGNALED(status)?WTERMSIG(status):WSTOPSIG(status);
+      status = WIFSIGNALED(status) ? WTERMSIG(status) : WSTOPSIG(status);
 
-      if( childPid > 0 )
+      if(childPid > 0)
       {
         RunningTestCases::iterator iter = children.find(childPid);
-        if( iter != children.end() )
+        if(iter != children.end())
         {
           printf("Test case %s exited with signal %s\n", iter->second.testCaseName, strsignal(status));
           failedTestCases.push_back(iter->second.testCase);
@@ -305,38 +305,36 @@ int32_t RunAllInParallel(  const char* processName, ::testcase tc_array[], bool
     }
   }
 
-  OutputStatistics( processName, numPasses, numFailures );
+  OutputStatistics(processName, numPasses, numFailures);
 
-  if( reRunFailed )
+  if(reRunFailed)
   {
-    for( uint32_t i=0; i<failedTestCases.size(); i++)
+    for(uint32_t i = 0; i < failedTestCases.size(); i++)
     {
-      char* testCaseStrapline;
-      int32_t numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name );
+      char*   testCaseStrapline;
+      int32_t numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name);
       printf("\n%s\n", testCaseStrapline);
-      for(int32_t j=0; j<numChars; j++)
+      for(int32_t j = 0; j < numChars; j++)
       {
         printf("=");
       }
       printf("\n");
-      RunTestCaseInChildProcess( tc_array[failedTestCases[i] ], false );
+      RunTestCaseInChildProcess(tc_array[failedTestCases[i]], false);
     }
   }
 
   return numFailures;
 }
 
-
-
 int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
 {
   int32_t result = EXIT_STATUS_TESTCASE_NOT_FOUND;
 
-  for( int32_t i = 0; tc_array[i].name; i++ )
+  for(int32_t i = 0; tc_array[i].name; i++)
   {
-    if( !strcmp(testCaseName, tc_array[i].name) )
+    if(!strcmp(testCaseName, tc_array[i].name))
     {
-      return RunTestCase( tc_array[i] );
+      return RunTestCase(tc_array[i]);
     }
   }
 
@@ -346,12 +344,16 @@ int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
 
 void Usage(const char* program)
 {
-  printf("Usage: \n"
-         "   %s <testcase name>\t\t Execute a test case\n"
-         "   %s \t\t Execute all test cases in parallel\n"
-         "   %s -r\t\t Execute all test cases in parallel, rerunning failed test cases\n"
-         "   %s -s\t\t Execute all test cases serially\n",
-         program, program, program, program);
+  printf(
+    "Usage: \n"
+    "   %s <testcase name>\t\t Execute a test case\n"
+    "   %s \t\t Execute all test cases in parallel\n"
+    "   %s -r\t\t Execute all test cases in parallel, rerunning failed test cases\n"
+    "   %s -s\t\t Execute all test cases serially\n",
+    program,
+    program,
+    program,
+    program);
 }
 
-} // namespace
+} // namespace TestHarness
index e40492c..c4b5e03 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_HARNESS_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
 
 #include <stdio.h>
 #include <testcase.h>
+
 #include <cstdint>
 
 namespace TestHarness
 {
-
 enum ExitStatus
 {
-  EXIT_STATUS_TESTCASE_SUCCEEDED,   // 0
-  EXIT_STATUS_TESTCASE_FAILED,      // 1
-  EXIT_STATUS_TESTCASE_ABORTED,     // 2
-  EXIT_STATUS_FORK_FAILED,          // 3
-  EXIT_STATUS_WAITPID_FAILED,       // 4
-  EXIT_STATUS_BAD_ARGUMENT,         // 5
-  EXIT_STATUS_TESTCASE_NOT_FOUND    // 6
+  EXIT_STATUS_TESTCASE_SUCCEEDED, // 0
+  EXIT_STATUS_TESTCASE_FAILED,    // 1
+  EXIT_STATUS_TESTCASE_ABORTED,   // 2
+  EXIT_STATUS_FORK_FAILED,        // 3
+  EXIT_STATUS_WAITPID_FAILED,     // 4
+  EXIT_STATUS_BAD_ARGUMENT,       // 5
+  EXIT_STATUS_TESTCASE_NOT_FOUND  // 6
 };
 
 const int32_t MAX_NUM_CHILDREN(16);
 
 struct TestCase
 {
-  int32_t testCase;
+  int32_t     testCase;
   const char* testCaseName;
 
   TestCase()
@@ -60,10 +60,9 @@ struct TestCase
   }
   TestCase& operator=(const TestCase& rhs)
   {
-    testCase = rhs.testCase;
+    testCase     = rhs.testCase;
     testCaseName = rhs.testCaseName;
     return *this;
-
   }
 };
 
@@ -71,7 +70,7 @@ struct TestCase
  * Run a test case
  * @param[in] testCase The Testkit-lite test case to run
  */
-int32_t RunTestCase( struct testcase_s& testCase );
+int32_t RunTestCase(struct testcase_s& testCase);
 
 /**
  * Run all test cases in parallel
@@ -88,7 +87,7 @@ int32_t RunAllInParallel(const char* processName, testcase tc_array[], bool reRu
  * @param[in] tc_array The array of auto-generated testkit-lite test cases
  * @return 0 on success
  */
-int32_t RunAll( const char* processName, testcase tc_array[] );
+int32_t RunAll(const char* processName, testcase tc_array[]);
 
 /**
  * Find the named test case in the given array, and run it
index 5fb17da..1336745 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_INTRUSIVE_PTR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  */
 
 // INTERNAL INCLUDES
-#include <iostream>
-#include <stdlib.h>
-#include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
+#include <dali/public-api/dali-core.h>
+#include <stdlib.h>
+
+#include <iostream>
 
 namespace Dali
 {
-
-template <typename T>
+template<typename T>
 struct UtcCoverageIntrusivePtr
 {
   typedef IntrusivePtr<T> (*Creator)();
 
-  void Check( Creator creator)
+  void Check(Creator creator)
   {
     IntrusivePtr<T> a = creator();
     IntrusivePtr<T> b = creator();
 
-    DALI_TEST_CHECK( a.Get() );
+    DALI_TEST_CHECK(a.Get());
 
     a.Reset();
 
@@ -48,13 +48,9 @@ struct UtcCoverageIntrusivePtr
     DALI_TEST_CHECK(a);
 
     a.Reset();
-
   };
-
 };
 
-} // Dali
+} // namespace Dali
 
 #endif // TEST_INTRUSIVE_PTR_H
-
-
index 5fdc5c3..76c9e5e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  *
  */
 
-
 #include "test-application.h"
-#include "test-native-image.h"
 
+#include "test-native-image.h"
 
 namespace Dali
 {
-
 TestNativeImagePointer TestNativeImage::New(uint32_t width, uint32_t height)
 {
   return new TestNativeImage(width, height);
 }
 
 TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
-: mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
+: mWidth(width),
+  mHeight(height),
+  mExtensionCreateCalls(0),
+  mExtensionDestroyCalls(0),
+  mTargetTextureCalls(0),
+  createResult(true)
 {
 }
 
@@ -37,4 +40,4 @@ TestNativeImage::~TestNativeImage()
 {
 }
 
-} // namespace dali
+} // namespace Dali
index 89d5095..f7d4f78 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_NATIVE_IMAGE_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/images/native-image-interface.h>
+
 #include <dali/integration-api/gl-defines.h>
 
 namespace Dali
@@ -32,22 +33,63 @@ class DALI_CORE_API TestNativeImage : public Dali::NativeImageInterface
 public:
   static TestNativeImagePointer New(uint32_t width, uint32_t height);
 
-  inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
-  inline virtual bool CreateResource() { ++mExtensionCreateCalls; return createResult;};
-  inline virtual void DestroyResource() { ++mExtensionDestroyCalls; };
-  inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return mTargetTextureError;};
-  inline virtual void PrepareTexture() {};
-  inline virtual uint32_t GetWidth() const {return mWidth;};
-  inline virtual uint32_t GetHeight() const {return mHeight;};
-  inline virtual bool RequiresBlending() const {return true;};
-  inline virtual int GetTextureTarget() const {return GL_TEXTURE_EXTERNAL_OES;};
-  inline virtual const char* GetCustomFragmentPrefix() const {return "#extension GL_OES_EGL_image_external:require\n";};
-  inline const char* GetCustomSamplerTypename() const override { return "samplerExternalOES"; };
+  inline void SetGlExtensionCreateResult(bool result)
+  {
+    createResult = result;
+  }
+  inline virtual bool CreateResource()
+  {
+    ++mExtensionCreateCalls;
+    return createResult;
+  };
+  inline virtual void DestroyResource()
+  {
+    ++mExtensionDestroyCalls;
+  };
+  inline virtual GLenum TargetTexture()
+  {
+    ++mTargetTextureCalls;
+    return mTargetTextureError;
+  };
+  inline virtual void     PrepareTexture(){};
+  inline virtual uint32_t GetWidth() const
+  {
+    return mWidth;
+  };
+  inline virtual uint32_t GetHeight() const
+  {
+    return mHeight;
+  };
+  inline virtual bool RequiresBlending() const
+  {
+    return true;
+  };
+  inline virtual int GetTextureTarget() const
+  {
+    return GL_TEXTURE_EXTERNAL_OES;
+  };
+  inline virtual const char* GetCustomFragmentPrefix() const
+  {
+    return "#extension GL_OES_EGL_image_external:require\n";
+  };
+  inline const char* GetCustomSamplerTypename() const override
+  {
+    return "samplerExternalOES";
+  };
 
-  inline Any GetNativeImageHandle() const override { return nullptr; };
-  inline bool SourceChanged() const override { return false; };
+  inline Any GetNativeImageHandle() const override
+  {
+    return nullptr;
+  };
+  inline bool SourceChanged() const override
+  {
+    return false;
+  };
 
-  inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return nullptr;}
+  inline virtual Dali::NativeImageInterface::Extension* GetExtension()
+  {
+    return nullptr;
+  }
 
 private:
   TestNativeImage(uint32_t width, uint32_t height);
@@ -55,16 +97,15 @@ private:
 
   uint32_t mWidth;
   uint32_t mHeight;
+
 public:
-  int32_t mExtensionCreateCalls;
-  int32_t mExtensionDestroyCalls;
-  int32_t mTargetTextureCalls;
-  uint32_t mTargetTextureError=0u;
-  bool createResult;
+  int32_t  mExtensionCreateCalls;
+  int32_t  mExtensionDestroyCalls;
+  int32_t  mTargetTextureCalls;
+  uint32_t mTargetTextureError = 0u;
+  bool     createResult;
 };
 
-
-
-} // Dali
+} // namespace Dali
 
 #endif // TEST_NATIVE_IMAGE_H
index 3962870..41ad1e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  */
 
 #include "test-platform-abstraction.h"
-#include "dali-test-suite-utils.h"
+
 #include <dali/integration-api/bitmap.h>
 
+#include "dali-test-suite-utils.h"
+
 namespace Dali
 {
-
 TestPlatformAbstraction::TestPlatformAbstraction()
 : mTrace(),
-  mIsLoadingResult( false ),
+  mIsLoadingResult(false),
   mClosestSize(),
   mLoadFileResult(),
-  mSaveFileResult( false ),
+  mSaveFileResult(false),
   mSynchronouslyLoadedResource(),
   mTimerId(0),
   mCallbackFunction(nullptr)
@@ -39,44 +40,44 @@ TestPlatformAbstraction::~TestPlatformAbstraction()
 {
 }
 
-ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
-                                                              ImageDimensions size,
-                                                              FittingMode::Type fittingMode,
-                                                              SamplingMode::Type samplingMode,
-                                                              bool orientationCorrection )
+ImageDimensions TestPlatformAbstraction::GetClosestImageSize(const std::string& filename,
+                                                             ImageDimensions    size,
+                                                             FittingMode::Type  fittingMode,
+                                                             SamplingMode::Type samplingMode,
+                                                             bool               orientationCorrection)
 {
-  ImageDimensions closestSize = ImageDimensions( mClosestSize );
+  ImageDimensions closestSize = ImageDimensions(mClosestSize);
   mTrace.PushCall("GetClosestImageSize", "");
   return closestSize;
 }
 
-ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
-                                                   ImageDimensions size,
-                                                   FittingMode::Type fittingMode,
-                                                   SamplingMode::Type samplingMode,
-                                                   bool orientationCorrection )
+ImageDimensions TestPlatformAbstraction::GetClosestImageSize(Integration::ResourcePointer resourceBuffer,
+                                                             ImageDimensions              size,
+                                                             FittingMode::Type            fittingMode,
+                                                             SamplingMode::Type           samplingMode,
+                                                             bool                         orientationCorrection)
 {
-  ImageDimensions closestSize = ImageDimensions( mClosestSize );
+  ImageDimensions closestSize = ImageDimensions(mClosestSize);
   mTrace.PushCall("GetClosestImageSize", "");
   return closestSize;
 }
 
-Integration::ResourcePointer TestPlatformAbstraction::LoadImageSynchronously( const Integration::BitmapResourceType& resourceType, const std::string& resourcePath )
+Integration::ResourcePointer TestPlatformAbstraction::LoadImageSynchronously(const Integration::BitmapResourceType& resourceType, const std::string& resourcePath)
 {
   mTrace.PushCall("LoadResourceSynchronously", "");
   return mSynchronouslyLoadedResource;
 }
 
-Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer( const Integration::BitmapResourceType& resourceType, uint8_t * buffer, size_t size )
+Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer(const Integration::BitmapResourceType& resourceType, uint8_t* buffer, size_t size)
 {
   mTrace.PushCall("DecodeBuffer", "");
   return mDecodedBitmap;
 }
 
-bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
+bool TestPlatformAbstraction::LoadShaderBinaryFile(const std::string& filename, Dali::Vector<unsigned char>& buffer) const
 {
   mTrace.PushCall("LoadShaderBinaryFile", "");
-  if( mLoadFileResult.loadResult )
+  if(mLoadFileResult.loadResult)
   {
     buffer = mLoadFileResult.buffer;
   }
@@ -89,7 +90,7 @@ void TestPlatformAbstraction::Initialize()
 {
   mTrace.Reset();
   mTrace.Enable(true);
-  mIsLoadingResult=false;
+  mIsLoadingResult = false;
   mSynchronouslyLoadedResource.Reset();
   mDecodedBitmap.Reset();
 }
@@ -98,9 +99,12 @@ bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
 {
   switch(func)
   {
-    case LoadResourceSynchronouslyFunc:       return mTrace.FindMethod("LoadResourceSynchronously");
-    case LoadShaderBinaryFileFunc:            return mTrace.FindMethod("LoadShaderBinaryFile");
-    case SaveShaderBinaryFileFunc:            return mTrace.FindMethod("SaveShaderBinaryFile");
+    case LoadResourceSynchronouslyFunc:
+      return mTrace.FindMethod("LoadResourceSynchronously");
+    case LoadShaderBinaryFileFunc:
+      return mTrace.FindMethod("LoadShaderBinaryFile");
+    case SaveShaderBinaryFileFunc:
+      return mTrace.FindMethod("SaveShaderBinaryFile");
   }
   return false;
 }
@@ -116,36 +120,36 @@ void TestPlatformAbstraction::ClearReadyResources()
   mDecodedBitmap.Reset();
 }
 
-void TestPlatformAbstraction::SetClosestImageSize( const Vector2& size )
+void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
 {
-  mClosestSize = ImageDimensions( static_cast<uint32_t>( size.x ), static_cast<uint32_t>( size.y ) );
+  mClosestSize = ImageDimensions(static_cast<uint32_t>(size.x), static_cast<uint32_t>(size.y));
 }
 
-void TestPlatformAbstraction::SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer )
+void TestPlatformAbstraction::SetLoadFileResult(bool result, Dali::Vector<unsigned char>& buffer)
 {
   mLoadFileResult.loadResult = result;
-  if( result )
+  if(result)
   {
     mLoadFileResult.buffer = buffer;
   }
 }
 
-void TestPlatformAbstraction::SetSaveFileResult( bool result )
+void TestPlatformAbstraction::SetSaveFileResult(bool result)
 {
   mSaveFileResult = result;
 }
 
-void TestPlatformAbstraction::SetSynchronouslyLoadedResource( Integration::ResourcePointer resource )
+void TestPlatformAbstraction::SetSynchronouslyLoadedResource(Integration::ResourcePointer resource)
 {
   mSynchronouslyLoadedResource = resource;
 }
 
-void TestPlatformAbstraction::SetDecodedBitmap( Integration::BitmapPtr bitmap )
+void TestPlatformAbstraction::SetDecodedBitmap(Integration::BitmapPtr bitmap)
 {
   mDecodedBitmap = bitmap;
 }
 
-uint32_t TestPlatformAbstraction::StartTimer( uint32_t milliseconds, CallbackBase* callback )
+uint32_t TestPlatformAbstraction::StartTimer(uint32_t milliseconds, CallbackBase* callback)
 {
   mCallbackFunction = callback;
   mTimerId++;
@@ -154,13 +158,13 @@ uint32_t TestPlatformAbstraction::StartTimer( uint32_t milliseconds, CallbackBas
 
 void TestPlatformAbstraction::TriggerTimer()
 {
-  if (mCallbackFunction != nullptr)
+  if(mCallbackFunction != nullptr)
   {
-    CallbackBase::Execute( *mCallbackFunction );
+    CallbackBase::Execute(*mCallbackFunction);
   }
 }
 
-void TestPlatformAbstraction::CancelTimer ( uint32_t timerId )
+void TestPlatformAbstraction::CancelTimer(uint32_t timerId)
 {
   mCallbackFunction = nullptr;
 }
index 1adedd4..9be034b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_PLATFORM_ABSTRACTION_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <stdint.h>
+
 #include <cstring>
 #include <string>
 #include <vector>
 
 namespace Dali
 {
-
 /**
  * Concrete implementation of the platform abstraction class.
  */
 class DALI_CORE_API TestPlatformAbstraction : public Dali::Integration::PlatformAbstraction
 {
-
 public:
-
   /**
    * Constructor
    */
@@ -54,53 +52,55 @@ public:
   /**
    * @copydoc PlatformAbstraction::GetClosestImageSize()
    */
-  ImageDimensions GetClosestImageSize( const std::string& filename,
-                                                 ImageDimensions size,
-                                                 FittingMode::Type fittingMode,
-                                                 SamplingMode::Type samplingMode,
-                                                 bool orientationCorrection ) override;
+  ImageDimensions GetClosestImageSize(const std::string& filename,
+                                      ImageDimensions    size,
+                                      FittingMode::Type  fittingMode,
+                                      SamplingMode::Type samplingMode,
+                                      bool               orientationCorrection) override;
 
   /**
    * @copydoc PlatformAbstraction::GetClosestImageSize()
    */
-  ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
-                                               ImageDimensions size,
-                                               FittingMode::Type fittingMode,
-                                               SamplingMode::Type samplingMode,
-                                               bool orientationCorrection ) override;
+  ImageDimensions GetClosestImageSize(Integration::ResourcePointer resourceBuffer,
+                                      ImageDimensions              size,
+                                      FittingMode::Type            fittingMode,
+                                      SamplingMode::Type           samplingMode,
+                                      bool                         orientationCorrection) override;
 
   /**
    * @copydoc PlatformAbstraction::LoadResourceSynchronously()
    */
-  Integration::ResourcePointer LoadImageSynchronously( const Integration::BitmapResourceType& resourceType, const std::string& resourcePath ) override;
+  Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resourceType, const std::string& resourcePath) override;
 
   /**
    * @copydoc PlatformAbstraction::DecodeBuffer()
    */
-  Integration::BitmapPtr DecodeBuffer( const Dali::Integration::BitmapResourceType& resourceType, uint8_t * buffer, size_t size ) override;
+  Integration::BitmapPtr DecodeBuffer(const Dali::Integration::BitmapResourceType& resourceType, uint8_t* buffer, size_t size) override;
 
   /**
    * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
    */
-  bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const override;
+  bool LoadShaderBinaryFile(const std::string& filename, Dali::Vector<unsigned char>& buffer) const override;
 
   /**
    * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
    */
-  virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const override { return true; }
+  virtual bool SaveShaderBinaryFile(const std::string& filename, const unsigned char* buffer, unsigned int numBytes) const override
+  {
+    return true;
+  }
 
   /**
    * @copydoc PlatformAbstraction::StartTimer()
    */
-  uint32_t StartTimer( uint32_t milliseconds, CallbackBase* callback ) override;
+  uint32_t StartTimer(uint32_t milliseconds, CallbackBase* callback) override;
 
   /*
    * @copydoc PlatformAbstraction::CancelTimer()
    */
-  void CancelTimer ( uint32_t timerId ) override;
+  void CancelTimer(uint32_t timerId) override;
 
 public: // TEST FUNCTIONS
-
   // Enumeration of Platform Abstraction methods
   typedef enum
   {
@@ -112,9 +112,18 @@ public: // TEST FUNCTIONS
   /** Call this every test */
   void Initialize();
 
-  inline void EnableTrace(bool enable) { mTrace.Enable(enable); }
-  inline void ResetTrace() { mTrace.Reset(); }
-  inline TraceCallStack& GetTrace() { return mTrace; }
+  inline void EnableTrace(bool enable)
+  {
+    mTrace.Enable(enable);
+  }
+  inline void ResetTrace()
+  {
+    mTrace.Reset();
+  }
+  inline TraceCallStack& GetTrace()
+  {
+    return mTrace;
+  }
 
   /**
    * @brief Checks if a platform function was called
@@ -138,32 +147,32 @@ public: // TEST FUNCTIONS
    * @brief Sets the value returned by GetClosestImageSize.
    * @param[in] size The size that should be returned.
    */
-  void SetClosestImageSize( const Vector2& size );
+  void SetClosestImageSize(const Vector2& size);
 
   /**
    * @brief Sets the result return by LoadFile.
    * @param[in] result The value that LoadFile should return.
    * @param[in] buffer The buffer of the loaded file.
    */
-  void SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer );
+  void SetLoadFileResult(bool result, Dali::Vector<unsigned char>& buffer);
 
   /**
    * @brief Sets the SaveFile result
    * @param[in] result The value that SaveFile should return
    */
-  void SetSaveFileResult( bool result );
+  void SetSaveFileResult(bool result);
 
   /**
    * @brief Sets the resource loaded by LoadResourceSynchronously
    * @param[in] resource The loaded resource
    */
-  void SetSynchronouslyLoadedResource( Integration::ResourcePointer resource );
+  void SetSynchronouslyLoadedResource(Integration::ResourcePointer resource);
 
   /**
    * @brief Sets the bitmap returned by DecodeBuffer()
    * @param[in] bitmap The decoded bitmap
    */
-  void SetDecodedBitmap( Integration::BitmapPtr bitmap );
+  void SetDecodedBitmap(Integration::BitmapPtr bitmap);
 
   /**
    * @brief Triggers the previously stored callback function
@@ -171,38 +180,35 @@ public: // TEST FUNCTIONS
   void TriggerTimer();
 
 private:
-
-  TestPlatformAbstraction( const TestPlatformAbstraction& ); ///< Undefined
-  TestPlatformAbstraction& operator=( const TestPlatformAbstraction& ); ///< Undefined
+  TestPlatformAbstraction(const TestPlatformAbstraction&);            ///< Undefined
+  TestPlatformAbstraction& operator=(const TestPlatformAbstraction&); ///< Undefined
 
 private:
-
   struct LoadFileResult
   {
     inline LoadFileResult()
     : loadResult(false)
     {
-
     }
 
-    bool loadResult;
-    Dali::Vector< unsigned char> buffer;
+    bool                        loadResult;
+    Dali::Vector<unsigned char> buffer;
   };
 
-  mutable TraceCallStack        mTrace;
-  bool                          mIsLoadingResult;
-  ImageDimensions               mClosestSize;
+  mutable TraceCallStack mTrace;
+  bool                   mIsLoadingResult;
+  ImageDimensions        mClosestSize;
 
-  LoadFileResult                mLoadFileResult;
-  bool                          mSaveFileResult;
+  LoadFileResult mLoadFileResult;
+  bool           mSaveFileResult;
 
-  Integration::ResourcePointer  mSynchronouslyLoadedResource;
-  Integration::BitmapPtr        mDecodedBitmap;
+  Integration::ResourcePointer mSynchronouslyLoadedResource;
+  Integration::BitmapPtr       mDecodedBitmap;
 
-  uint32_t                      mTimerId;
-  CallbackBase*                 mCallbackFunction;
+  uint32_t      mTimerId;
+  CallbackBase* mCallbackFunction;
 };
 
-} // Dali
+} // namespace Dali
 
 #endif /* DALI_TEST_PLATFORM_ABSTRACTION_H */
index 6f845d4..1b90e0c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -19,7 +19,6 @@
 
 namespace Dali
 {
-
 TestRenderController::TestRenderController()
 {
   Initialize();
@@ -29,12 +28,12 @@ TestRenderController::~TestRenderController()
 {
 }
 
-void TestRenderController::RequestUpdate( bool forceUpdate )
+void TestRenderController::RequestUpdate(bool forceUpdate)
 {
   mRequestUpdateCalled = true;
 }
 
-void TestRenderController::RequestProcessEventsOnIdle( bool forceProcess )
+void TestRenderController::RequestProcessEventsOnIdle(bool forceProcess)
 {
   mRequestProcessEventsOnIdleCalled = true;
 }
@@ -43,8 +42,10 @@ bool TestRenderController::WasCalled(TestRenderControllerFuncEnum func)
 {
   switch(func)
   {
-    case RequestUpdateFunc: return mRequestUpdateCalled;
-    case RequestProcessEventsOnIdleFunc: return mRequestProcessEventsOnIdleCalled;
+    case RequestUpdateFunc:
+      return mRequestUpdateCalled;
+    case RequestProcessEventsOnIdleFunc:
+      return mRequestProcessEventsOnIdleCalled;
   }
 
   return false;
@@ -52,9 +53,8 @@ bool TestRenderController::WasCalled(TestRenderControllerFuncEnum func)
 
 void TestRenderController::Initialize()
 {
-  mRequestUpdateCalled = false;
+  mRequestUpdateCalled              = false;
   mRequestProcessEventsOnIdleCalled = false;
 }
 
-
-} // namespace dali
+} // namespace Dali
index facb50c..f7cafa4 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_RENDER_CONTROLLER_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
 #include <dali/integration-api/render-controller.h>
+#include <dali/public-api/common/dali-common.h>
 
 namespace Dali
 {
-
 class DALI_CORE_API TestRenderController : public Dali::Integration::RenderController
 {
 public:
   TestRenderController();
   ~TestRenderController() override;
 
-  void RequestUpdate( bool forceUpdate ) override;
-  void RequestProcessEventsOnIdle( bool forceProcess ) override;
+  void RequestUpdate(bool forceUpdate) override;
+  void RequestProcessEventsOnIdle(bool forceProcess) override;
 
   typedef enum
   {
@@ -43,12 +42,11 @@ public:
   bool WasCalled(TestRenderControllerFuncEnum func);
   void Initialize();
 
-
 private:
   bool mRequestUpdateCalled;
   bool mRequestProcessEventsOnIdleCalled;
 };
 
-} // Dali
+} // namespace Dali
 
 #endif // TEST_RENDER_CONTROLLER_H
index f894389..9fde7c4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  */
 
 #include "test-trace-call-stack.h"
+
 #include <sstream>
 
 namespace Dali
 {
-
 std::string ToString(int x)
 {
   std::stringstream out;
@@ -45,19 +45,30 @@ std::string ToString(float x)
 /**
  * Constructor
  */
-TraceCallStack::TraceCallStack() : mTraceActive(false) { }
+TraceCallStack::TraceCallStack()
+: mTraceActive(false)
+{
+}
 
 /**
  * Destructor
  */
-TraceCallStack::~TraceCallStack() { }
+TraceCallStack::~TraceCallStack()
+{
+}
 
 /**
  * Turn on / off tracing
  */
-void TraceCallStack::Enable(bool enable) { mTraceActive = enable; }
+void TraceCallStack::Enable(bool enable)
+{
+  mTraceActive = enable;
+}
 
-bool TraceCallStack::IsEnabled() { return mTraceActive; }
+bool TraceCallStack::IsEnabled()
+{
+  return mTraceActive;
+}
 
 /**
  * Push a call onto the stack if the trace is active
@@ -69,7 +80,7 @@ void TraceCallStack::PushCall(std::string method, std::string params)
   if(mTraceActive)
   {
     FunctionCall stackFrame(method, params);
-    mCallStack.push_back( stackFrame );
+    mCallStack.push_back(stackFrame);
   }
 }
 
@@ -78,7 +89,7 @@ void TraceCallStack::PushCall(std::string method, std::string params, const Trac
   if(mTraceActive)
   {
     FunctionCall stackFrame(method, params, altParams);
-    mCallStack.push_back( stackFrame );
+    mCallStack.push_back(stackFrame);
   }
 }
 
@@ -90,9 +101,9 @@ void TraceCallStack::PushCall(std::string method, std::string params, const Trac
 bool TraceCallStack::FindMethod(std::string method) const
 {
   bool found = false;
-  for( size_t i=0; i < mCallStack.size(); i++ )
+  for(size_t i = 0; i < mCallStack.size(); i++)
   {
-    if( 0 == mCallStack[i].method.compare(method) )
+    if(0 == mCallStack[i].method.compare(method))
     {
       found = true;
       break;
@@ -101,14 +112,14 @@ bool TraceCallStack::FindMethod(std::string method) const
   return found;
 }
 
-bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string& params ) const
+bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string& params) const
 {
   bool found = false;
-  for( size_t i=0; i < mCallStack.size(); i++ )
+  for(size_t i = 0; i < mCallStack.size(); i++)
   {
-    if( 0 == mCallStack[i].method.compare(method) )
+    if(0 == mCallStack[i].method.compare(method))
     {
-      found = true;
+      found  = true;
       params = mCallStack[i].paramList;
       break;
     }
@@ -119,9 +130,9 @@ bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string&
 int TraceCallStack::CountMethod(std::string method) const
 {
   int numCalls = 0;
-  for( size_t i=0; i < mCallStack.size(); i++ )
+  for(size_t i = 0; i < mCallStack.size(); i++)
   {
-    if( 0 == mCallStack[i].method.compare(method) )
+    if(0 == mCallStack[i].method.compare(method))
     {
       numCalls++;
     }
@@ -137,19 +148,19 @@ int TraceCallStack::CountMethod(std::string method) const
  */
 bool TraceCallStack::FindMethodAndParams(std::string method, std::string params) const
 {
-  return FindIndexFromMethodAndParams( method, params ) > -1;
+  return FindIndexFromMethodAndParams(method, params) > -1;
 }
 
 bool TraceCallStack::FindMethodAndParams(std::string method, const NamedParams& params) const
 {
-  return FindIndexFromMethodAndParams( method, params ) > -1;
+  return FindIndexFromMethodAndParams(method, params) > -1;
 }
 
-bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const
+bool TraceCallStack::FindMethodAndParamsFromStartIndex(std::string method, std::string params, size_t& startIndex) const
 {
-  for( size_t i = startIndex; i < mCallStack.size(); ++i )
+  for(size_t i = startIndex; i < mCallStack.size(); ++i)
   {
-    if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) )
+    if((mCallStack[i].method.compare(method) == 0) && (mCallStack[i].paramList.compare(params) == 0))
     {
       startIndex = i;
       return true;
@@ -167,11 +178,11 @@ bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std:
 int32_t TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
 {
   int32_t index = -1;
-  for( size_t i=0; i < mCallStack.size(); i++ )
+  for(size_t i = 0; i < mCallStack.size(); i++)
   {
-    if( 0 == mCallStack[i].method.compare(method) && 0 == mCallStack[i].paramList.compare(params) )
+    if(0 == mCallStack[i].method.compare(method) && 0 == mCallStack[i].paramList.compare(params))
     {
-      index = static_cast<int32_t>( i );
+      index = static_cast<int32_t>(i);
       break;
     }
   }
@@ -181,24 +192,24 @@ int32_t TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::st
 int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const TraceCallStack::NamedParams& params) const
 {
   int32_t index = -1;
-  for( size_t i=0; i < mCallStack.size(); i++ )
+  for(size_t i = 0; i < mCallStack.size(); i++)
   {
-    if( 0 == mCallStack[i].method.compare(method) )
+    if(0 == mCallStack[i].method.compare(method))
     {
       // Test each of the passed in parameters:
       bool match = true;
-      for( NamedParams::const_iterator iter = params.begin() ; iter != params.end() ; ++iter )
+      for(NamedParams::const_iterator iter = params.begin(); iter != params.end(); ++iter)
       {
         NamedParams::const_iterator paramIter = mCallStack[i].namedParams.find(iter->first);
-        if( paramIter == params.end() || paramIter->second.compare(iter->second) != 0 )
+        if(paramIter == params.end() || paramIter->second.compare(iter->second) != 0)
         {
           match = false;
           break;
         }
       }
-      if( match == true )
+      if(match == true)
       {
-        index = static_cast<int32_t>( i );
+        index = static_cast<int32_t>(i);
         break;
       }
     }
@@ -206,7 +217,6 @@ int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const Trace
   return index;
 }
 
-
 /**
  * Test if the given method and parameters are at a given index in the stack
  * @param[in] index Index in the call stack
@@ -215,7 +225,7 @@ int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const Trace
  */
 bool TraceCallStack::TestMethodAndParams(int index, std::string method, std::string params) const
 {
-  return ( 0 == mCallStack[index].method.compare(method) && 0 == mCallStack[index].paramList.compare(params) );
+  return (0 == mCallStack[index].method.compare(method) && 0 == mCallStack[index].paramList.compare(params));
 }
 
 /**
@@ -226,5 +236,4 @@ void TraceCallStack::Reset()
   mCallStack.clear();
 }
 
-
 } // namespace Dali
index d569cba..8cb5922 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_TRACE_CALL_STACK_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  *
  */
 
-#include <string>
-#include <vector>
 #include <map>
 #include <sstream>
+#include <string>
+#include <vector>
 
 namespace Dali
 {
-
 template<typename T>
 std::string ToString(const T& x)
 {
@@ -42,9 +41,8 @@ std::string ToString(float x);
 class TraceCallStack
 {
 public:
-
   /// Typedef for passing and storing named parameters
-  typedef std::map< std::string, std::string > NamedParams;
+  typedef std::map<std::string, std::string> NamedParams;
 
   /**
    * Constructor
@@ -91,7 +89,7 @@ public:
    * @param[out] params of the method
    * @return true if the method was in the stack
    */
-  bool FindMethodAndGetParameters(std::string method, std::string& params ) const;
+  bool FindMethodAndGetParameters(std::string method, std::string& params) const;
 
   /**
    * Count how many times a method was called
@@ -127,7 +125,7 @@ public:
    *                calls can search for methods occuring after this one.
    * @return True if the method was in the stack
    */
-  bool FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const;
+  bool FindMethodAndParamsFromStartIndex(std::string method, std::string params, size_t& startIndex) const;
 
   /**
    * Search for a method in the stack with the given parameter list
@@ -165,10 +163,10 @@ public:
   std::string GetTraceString()
   {
     std::stringstream traceStream;
-    std::size_t functionCount = mCallStack.size();
-    for( std::size_t i = 0; i < functionCount; ++i )
+    std::size_t       functionCount = mCallStack.size();
+    for(std::size_t i = 0; i < functionCount; ++i)
     {
-      Dali::TraceCallStack::FunctionCall functionCall = mCallStack[ i ];
+      Dali::TraceCallStack::FunctionCall functionCall = mCallStack[i];
       traceStream << "StackTrace: Index:" << i << ",  Function:" << functionCall.method << ",  ParamList:" << functionCall.paramList << std::endl;
     }
 
@@ -183,19 +181,22 @@ private:
     std::string method;
     std::string paramList;
     NamedParams namedParams;
-    FunctionCall( const std::string& aMethod, const std::string& aParamList )
-    : method( aMethod ), paramList( aParamList )
+    FunctionCall(const std::string& aMethod, const std::string& aParamList)
+    : method(aMethod),
+      paramList(aParamList)
     {
     }
-    FunctionCall( const std::string& aMethod, const std::string& aParamList, const NamedParams& altParams )
-    : method( aMethod ), paramList( aParamList ), namedParams( altParams )
+    FunctionCall(const std::string& aMethod, const std::string& aParamList, const NamedParams& altParams)
+    : method(aMethod),
+      paramList(aParamList),
+      namedParams(altParams)
     {
     }
   };
 
-  std::vector< FunctionCall > mCallStack; ///< The call stack
+  std::vector<FunctionCall> mCallStack; ///< The call stack
 };
 
-} // namespace dali
+} // namespace Dali
 
 #endif // TEST_TRACE_CALL_STACK_H