Files
pvAccess/testApp/utils/testHexDump.cpp
Michael Davidsaver ecee708d3a redo hexDump
ludicrously inefficient (cf. toHex() ), and inflexible.
2019-05-21 08:51:00 -07:00

27 lines
538 B
C++

#include <sstream>
#include <testMain.h>
#include <pv/pvUnitTest.h>
#include <pv/hexDump.h>
using namespace epics::pvData;
using namespace epics::pvAccess;
MAIN(testHexDump)
{
testPlan(1);
testDiag("Tests for hexDump");
char TO_DUMP[] = "pvAccess dump test\0\1\2\3\4\5\6\xfd\xfe\xff";
std::ostringstream msg;
msg<<HexDump(TO_DUMP, sizeof(TO_DUMP)-1);
testEqual(msg.str(), "0x00 70764163 63657373 2064756d 70207465\n"
"0x10 73740001 02030405 06fdfeff\n");
return testDone();
}