| 27 | using namespace sonic_json::internal; |
| 28 | |
| 29 | void TestU64toa(const std::string& expect, uint64_t val) { |
| 30 | // reserved buffer should be 32 bytes |
| 31 | char buf[32] = {0}; |
| 32 | char* out = U64toa(buf, val); |
| 33 | *out = '\0'; |
| 34 | EXPECT_STREQ(expect.data(), buf); |
| 35 | EXPECT_EQ(out - buf, expect.size()); |
| 36 | } |
| 37 | |
| 38 | void TestI64toa(const std::string& expect, int64_t val) { |
| 39 | // reserved buffer should be 32 bytes |