MCPcopy Create free account
hub / github.com/c42f/tinyformat / compareSprintf

Function compareSprintf

tinyformat_test.cpp:27–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25// Compare result of tfm::format() to C's sprintf().
26template<typename... Args>
27void compareSprintf(const Args&... args)
28{
29 std::string tfmResult = tfm::format(args...);
30 char sprintfResult[200];
31 sprintf(sprintfResult, args...);
32 if (tfmResult != sprintfResult)
33 {
34 std::cout << tfmResult << std::endl;
35 std::cout << sprintfResult << std::endl;
36 assert(0 && "results didn't match, see above.");
37 }
38}
39#endif
40
41#define EXPECT_ERROR(expression) \

Callers

nothing calls this directly

Calls 1

formatFunction · 0.85

Tested by

no test coverage detected