#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.
public:
/**
- * @brief
- *
- * Call in main part of code
+ * @brief Call in main part of code
*/
ObjectDestructionTracker();
/**
* @brief Call to check if Actor alive or destroyed.
+ *
* @return bool true if Actor was destroyed
*/
bool IsDestroyed();
return geometry;
}
+
+
} // namespace Dali
namespace
{
+
const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
attribute mediump vec2 aPosition;\n
uniform mediump mat4 uMvpMatrix;\n
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
{
/*
- * 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.
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;
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