X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=modules%2Ftest%2Fsrc%2Ftest_runner.cpp;fp=modules_wearable%2Ftest%2Fsrc%2Ftest_runner.cpp;h=483720ffe6bbf5d6e089f2e4e52005631503df33;hb=3a034abb4dca58ff0940687d8dd2b829ce2e226f;hp=aaac7af2d1c1a1ef6da1e90ff951bee09ae246e7;hpb=58be0971049907f3166ce56a6ad509769565158f;p=framework%2Fweb%2Fwrt-commons.git diff --git a/modules_wearable/test/src/test_runner.cpp b/modules/test/src/test_runner.cpp similarity index 97% rename from modules_wearable/test/src/test_runner.cpp rename to modules/test/src/test_runner.cpp index aaac7af..483720f 100644 --- a/modules_wearable/test/src/test_runner.cpp +++ b/modules/test/src/test_runner.cpp @@ -24,9 +24,10 @@ #include #include #include -#include +#include +#include #include -#include +#include #include #include #include @@ -65,11 +66,11 @@ namespace // anonymous { std::string BaseName(std::string aPath) { - ScopedFree path(strdup(aPath.c_str())); - if (NULL == path.Get()) { + std::unique_ptr path(strdup(aPath.c_str())); + if (NULL == path.get()) { throw std::bad_alloc(); } - char* baseName = basename(path.Get()); + char* baseName = basename(path.get()); std::string retValue = baseName; return retValue; } @@ -188,14 +189,14 @@ bool TestRunner::filterGroupsByXmls(const std::vector & files) } xmlNodeSetPtr nodes = xpathObject->nodesetval; unsigned size = (nodes) ? nodes->nodeNr : 0; - LogDebug("Found " << size << " nodes matching xpath"); + WrtLogD("Found %i nodes matching xpath", size); for(unsigned i = 0; i < size; ++i) { - LogPedantic("Type: " << nodes->nodeTab[i]->type); + WrtLogD("Type: %i", nodes->nodeTab[i]->type); if (nodes->nodeTab[i]->type == XML_ATTRIBUTE_NODE) { xmlNodePtr curNode = nodes->nodeTab[i]; result = getXMLNode(curNode); - LogPedantic("Result: " << result); + WrtLogD("Result: %s", result.c_str()); normalizeXMLTag(result, testsuite); casesMap.insert(make_pair(result, false)); } @@ -208,7 +209,7 @@ bool TestRunner::filterGroupsByXmls(const std::vector & files) } Catch(XMLError) { - LogError("Libxml error: " << _rethrown_exception.DumpToString()); + WrtLogE("Libxml error: %s", _rethrown_exception.DumpToString().c_str()); success = false; } xmlCleanupParser(); @@ -238,7 +239,7 @@ bool TestRunner::filterByXML(std::map & casesMap) { if(cs->second == false) { - LogError("Cannot find testcase from XML file: " << cs->first); + WrtLogE("Cannot find testcase from XML file: %s", cs->first.c_str()); return false; } }