| 238 | namespace |
| 239 | { |
| 240 | void 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 | |
| 254 | UNIT_TEST(to_uint) |