[tests] Rewrite resource loading test

Make it more readable and easier to debug.
This commit is contained in:
John Firebaugh
2015-12-22 16:32:25 -08:00
parent d745ff0923
commit 7c22792bdf
4 changed files with 131 additions and 139 deletions

View File

@@ -22,6 +22,15 @@ inline std::string toString(int8_t num) {
return boost::lexical_cast<std::string>(int(num));
}
inline std::string toString(std::exception_ptr error) {
try {
std::rethrow_exception(error);
} catch (const std::exception& ex) {
return ex.what();
} catch (...) {
return "Unknown exception type";
}
}
template<size_t max, typename... Args>
inline std::string sprintf(const char *msg, Args... args) {