MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TEST

Function TEST

valdi/test/runtime/ByteBuffer_tests.cpp:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace ValdiTest {
7
8TEST(ByteBuffer, reallocatesOnAppend) {
9 ByteBuffer buffer;
10
11 ASSERT_EQ(static_cast<size_t>(0), buffer.size());
12 ASSERT_EQ(static_cast<size_t>(0), buffer.capacity());
13
14 buffer.appendWritable(1);
15
16 ASSERT_EQ(static_cast<size_t>(1), buffer.size());
17 ASSERT_EQ(static_cast<size_t>(sizeof(size_t)), buffer.capacity());
18}
19
20TEST(ByteBuffer, reallocatesByPowerOfTwo) {
21 ByteBuffer buffer;

Callers

nothing calls this directly

Calls 12

appendWritableMethod · 0.80
toBytesVecMethod · 0.80
assignVecMethod · 0.80
appendMethod · 0.65
setMethod · 0.65
sizeMethod · 0.45
capacityMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45
shiftMethod · 0.45
resizeMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected