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

Method testValue

bolt/vector/tests/VectorTest.cpp:954–967  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952
953template <>
954StringView VectorTest::testValue(int32_t n, BufferPtr& buffer) {
955 if (!buffer || buffer->capacity() < 1000) {
956 buffer = AlignedBuffer::allocate<char>(1000, pool());
957 }
958 std::stringstream out;
959 out << n;
960 for (int32_t i = 0; i < n % 20; ++i) {
961 out << " " << i * i;
962 }
963 std::string str = out.str();
964 EXPECT_LE(str.size(), buffer->capacity());
965 memcpy(buffer->asMutable<char>(), str.data(), str.size());
966 return StringView(buffer->as<char>(), str.size());
967}
968
969template <>
970bool VectorTest::testValue(int32_t i, BufferPtr& /*space*/) {

Callers

nothing calls this directly

Calls 8

memcpyFunction · 0.85
strMethod · 0.80
poolFunction · 0.50
StringViewClass · 0.50
TimestampClass · 0.50
capacityMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected