MCPcopy Create free account
hub / github.com/bytedance/bolt / testToByteArray

Function testToByteArray

bolt/type/tests/DecimalTest.cpp:81–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void testToByteArray(int128_t value, int8_t* expected, int32_t size) {
82 std::vector<char> out(size);
83 int32_t length = DecimalUtil::toByteArray(value, out.data());
84 EXPECT_EQ(length, size);
85 EXPECT_EQ(DecimalUtil::getByteArrayLength(value), size);
86 EXPECT_EQ(std::memcmp(expected, out.data(), length), 0);
87}
88
89std::string zeros(uint32_t numZeros) {
90 return std::string(numZeros, '0');

Callers 1

TESTFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected