MCPcopy Create free account
hub / github.com/comaps/comaps / ToUIntTest

Function ToUIntTest

libs/base/base_tests/string_utils_test.cpp:240–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238namespace
239{
240void ToUIntTest(char const * p, bool good = false, uint32_t expected = 0)
241{
242 std::string s(p);
243 std::string_view v(s);
244
245 uint32_t i1, i2, i3;
246 TEST(good == strings::to_uint(p, i1), (s));
247 TEST(good == strings::to_uint(s, i2), (s));
248 TEST(good == strings::to_uint(v, i3), (s));
249 if (good)
250 TEST(expected == i1 && expected == i2 && expected == i3, (s, i1, i2, i3));
251}
252} // namespace
253
254UNIT_TEST(to_uint)

Callers 1

UNIT_TESTFunction · 0.85

Calls 2

TESTFunction · 0.85
to_uintFunction · 0.85

Tested by

no test coverage detected