#include <dpl/test/test_runner.h>
#include <dpl/test/test_results_collector.h>
#include <dpl/exception.h>
-#include <dpl/scoped_free.h>
+#include <dpl/free_deleter.h>
+#include <memory>
#include <dpl/foreach.h>
-#include <dpl/log/log.h>
+#include <dpl/log/wrt_log.h>
#include <dpl/colors.h>
#include <pcrecpp.h>
#include <algorithm>
{
std::string BaseName(std::string aPath)
{
- ScopedFree<char> path(strdup(aPath.c_str()));
- if (NULL == path.Get()) {
+ std::unique_ptr<char[],free_deleter> 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;
}
}
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));
}
}
Catch(XMLError)
{
- LogError("Libxml error: " << _rethrown_exception.DumpToString());
+ WrtLogE("Libxml error: %s", _rethrown_exception.DumpToString().c_str());
success = false;
}
xmlCleanupParser();
{
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;
}
}