X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-trace-call-stack.cpp;h=f57dc50078545f5f5d52b6849a16c77b001a4508;hb=d913b0f4830fb9a1ef035941e206911abeb1e3c3;hp=3f2e6e5fe07e5e73c4efa451c39bc6d50dfa062e;hpb=279dbb691ca801e105dde798be819eea9a54ad96;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp index 3f2e6e5..f57dc50 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-trace-call-stack.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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; @@ -130,6 +145,18 @@ bool TraceCallStack::FindMethodAndParams(std::string method, const NamedParams& return FindIndexFromMethodAndParams( method, params ) > -1; } +bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const +{ + for( size_t i = startIndex; i < mCallStack.size(); ++i ) + { + if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) ) + { + startIndex = i; + return true; + } + } + return false; +} /** * Search for a method in the stack with the given parameter list