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=137bfafefd920a27c50694cb370a9ac3fbc80dee;hp=32375a682b23aaf1d6b5a3d1c4e20bd8b5cf9753;hb=fc3b9f75eedc1e29b78507d170a7dccd13784178;hpb=279dbb691ca801e105dde798be819eea9a54ad96 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 32375a6..137bfaf 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 @@ -1,8 +1,8 @@ -#ifndef __TEST_TRACE_CALL_STACK_H__ -#define __TEST_TRACE_CALL_STACK_H__ +#ifndef TEST_TRACE_CALL_STACK_H +#define TEST_TRACE_CALL_STACK_H /* - * 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. @@ -21,6 +21,7 @@ #include #include #include +#include namespace Dali { @@ -34,6 +35,7 @@ std::string ToString(float x); class TraceCallStack { public: + /// Typedef for passing and storing named parameters typedef std::map< std::string, std::string > NamedParams; @@ -128,6 +130,23 @@ public: */ void Reset(); + /** + * Method to display contents of the TraceCallStack. + * @return A string containing a list of function calls and parameters (may contain newline characters) + */ + std::string GetTraceString() + { + std::stringstream traceStream; + int functionCount = mCallStack.size(); + for( int i = 0; i < functionCount; ++i ) + { + Dali::TraceCallStack::FunctionCall functionCall = mCallStack[ i ]; + traceStream << "StackTrace: Index:" << i << ", Function:" << functionCall.method << ", ParamList:" << functionCall.paramList << std::endl; + } + + return traceStream.str(); + } + private: bool mTraceActive; ///< True if the trace is active @@ -151,4 +170,4 @@ private: } // namespace dali -#endif //__TEST_TRACE_CALL_STACK_H__ +#endif // TEST_TRACE_CALL_STACK_H