X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-trace-call-stack.h;h=d569cba555d4550ad2a31013a9735d6aaa404c71;hp=137bfafefd920a27c50694cb370a9ac3fbc80dee;hb=a76b6c2b9fc30dd5e8f5f7e0cfd2537e274fd71e;hpb=fc3b9f75eedc1e29b78507d170a7dccd13784178 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h index 137bfaf..d569cba 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.h @@ -25,6 +25,13 @@ namespace Dali { + +template +std::string ToString(const T& x) +{ + return "undefined"; +} + std::string ToString(int x); std::string ToString(unsigned int x); std::string ToString(float x); @@ -79,6 +86,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 @@ -102,6 +117,19 @@ public: bool FindMethodAndParams(std::string method, const NamedParams& params) const; /** + * Search for a method in the stack with the given parameter list. + * The search is done from a given index. + * This allows the order of methods and parameters to be checked. + * @param[in] method The name of the method + * @param[in] params A comma separated list of parameter values + * @param[in/out] startIndex The method index to start looking from. + * This is updated if a method is found so subsequent + * 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; + + /** * Search for a method in the stack with the given parameter list * @param[in] method The name of the method * @param[in] params A comma separated list of parameter values @@ -137,8 +165,8 @@ public: std::string GetTraceString() { std::stringstream traceStream; - int functionCount = mCallStack.size(); - for( int 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 ]; traceStream << "StackTrace: Index:" << i << ", Function:" << functionCall.method << ", ParamList:" << functionCall.paramList << std::endl;