Revert "testTypeCast: Escape non-printing characters"

This reverts commit f7cad98f3e.
This commit is contained in:
Michael Davidsaver
2016-09-07 15:28:48 -04:00
parent f7cad98f3e
commit 4d6d5620b0

View File

@@ -20,7 +20,6 @@
#include <stdio.h>
#include <float.h>
#include <epicsMath.h>
#include <epicsString.h>
#include <epicsUnitTest.h>
#include <testMain.h>
@@ -31,14 +30,6 @@ using std::string;
namespace {
std::string escapedFromRaw(const std::string & s)
{
std::vector<char> result;
result.resize(epicsStrnEscapedFromRawSize(s.c_str(), s.length())+1);
epicsStrnEscapedFromRaw(&result[0], result.size(), s.c_str(), s.length());
return std::string(&result[0]);
}
template<typename T>
struct testequal {
static bool op(T A, T B) {return A==B; }
@@ -66,7 +57,7 @@ namespace {
<<inp<<" ("<<typeid(FROM).name()<<") -> "
<<expect<<" ("<<typeid(TO).name()<<")\n Error: "
<<typeid(e).name()<<"("<<e.what()<<")";
testFail("%s", escapedFromRaw(msg.str()).c_str());
testFail("%s", msg.str().c_str());
return;
}
if(!testequal<TO>::op(actual, expect)) {
@@ -74,14 +65,14 @@ namespace {
<<inp<<" ("<<typeid(FROM).name()<<") -> "
<<expect<<" ("<<typeid(TO).name()<<") yields: "
<<actual;
testFail("%s", escapedFromRaw(msg.str()).c_str());
testFail("%s", msg.str().c_str());
return;
}
msg<<"cast "
<<inp<<" ("<<typeid(FROM).name()<<") -> "
<<expect<<" ("<<typeid(TO).name()<<") yields: "
<<actual;
testPass("%s", escapedFromRaw(msg.str()).c_str());
testPass("%s", msg.str().c_str());
return;
}
};
@@ -98,14 +89,14 @@ namespace {
<<inp<<" ("<<typeid(FROM).name()<<") -> ("
<<typeid(TO).name()<<") yields: "
<<actual;
testFail("%s", escapedFromRaw(msg.str()).c_str());
testFail("%s", msg.str().c_str());
return;
} catch(std::runtime_error& e) {
msg<<"Got expected error "
<<inp<<" ("<<typeid(FROM).name()<<") -> ("
<<typeid(TO).name()<<") fails with: "
<<e.what();
testPass("%s", escapedFromRaw(msg.str()).c_str());
testPass("%s", msg.str().c_str());
return;
}
}