(Automated Tests) Sync with core tests 55/97255/3
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 11 Nov 2016 17:39:04 +0000 (17:39 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 14 Nov 2016 10:03:49 +0000 (10:03 +0000)
Change-Id: I536c8e625567103fb073a7d94d5e0c2e6d6516e8

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/test-actor-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.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

index 9e0364b..a3149f4 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TEST_SUITE_UTILS_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
@@ -516,9 +516,7 @@ class ObjectDestructionTracker : public ConnectionTracker
 public:
 
   /**
-   * @brief
-   *
-   * Call in main part of code
+   * @brief Call in main part of code
    */
   ObjectDestructionTracker();
 
@@ -531,6 +529,7 @@ public:
 
   /**
    * @brief Call to check if Actor alive or destroyed.
+   *
    * @return bool true if Actor was destroyed
    */
   bool IsDestroyed();
index f8d7bf8..6e2e204 100644 (file)
@@ -30,6 +30,7 @@ namespace Dali
 
 namespace
 {
+
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
   uniform mediump mat4 uMvpMatrix;\n
index 10c3264..9bed832 100644 (file)
@@ -956,10 +956,11 @@ public:
   inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
   {
     const std::string shaderSource = mShaderSources[shader];
-    if( static_cast<int>(shaderSource.length()) < bufsize )
+    const int shaderSourceLength = static_cast<int>(shaderSource.length());
+    if( shaderSourceLength < bufsize )
     {
-      strcpy(source, shaderSource.c_str());
-      *length = shaderSource.length();
+      strncpy( source, shaderSource.c_str(), shaderSourceLength );
+      *length = shaderSourceLength;
     }
     else
     {
index 0054e59..76ccff7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
@@ -101,6 +101,21 @@ bool TraceCallStack::FindMethod(std::string method) const
   return found;
 }
 
+bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string& params ) const
+{
+  bool found = false;
+  for( size_t i=0; i < mCallStack.size(); i++ )
+  {
+    if( 0 == mCallStack[i].method.compare(method) )
+    {
+      found = true;
+      params = mCallStack[i].paramList;
+      break;
+    }
+  }
+  return found;
+}
+
 int TraceCallStack::CountMethod(std::string method) const
 {
   int numCalls = 0;
index e1882ea..c3f3358 100644 (file)
@@ -79,6 +79,14 @@ public:
   bool FindMethod(std::string method) const;
 
   /**
+   * Search for a method in the stack and return its parameters if found
+   * @param[in] method The name of the method
+   * @param[out] params of the method
+   * @return true if the method was in the stack
+   */
+  bool FindMethodAndGetParameters(std::string method, std::string& params ) const;
+
+  /**
    * Count how many times a method was called
    * @param[in] method The name of the method
    * @return The number of times it was called