9 #include "CppUTest/TestHarness.h"
11 #include "drmTestUtils.h"
13 TestUtilJsonWrapper::TestUtilJsonWrapper(
const std::string& jsonStr)
15 mJsonObj = cJSON_Parse(jsonStr.c_str());
18 TestUtilJsonWrapper::~TestUtilJsonWrapper()
20 if (mJsonObj) cJSON_Delete(mJsonObj);
23 SimpleString StringFrom(
const std::vector<std::string>& vec)
25 std::ostringstream oss;
29 std::copy(vec.begin(), vec.end() - 1, std::ostream_iterator<std::string>(oss,
","));
33 return SimpleString(oss.str().c_str());
36 SimpleString StringFrom(
const std::vector<std::uint8_t>& v)
38 std::ostringstream oss;
42 oss << std::hex << std::setw(2) << std::setfill(
'0') << (unsigned)x;
45 return SimpleString(oss.str().c_str());