MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / TEST

Function TEST

tests/writebuffer_test.cpp:25–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using namespace sonic_json;
24
25TEST(WriteBuffer, CopyControl) {
26 WriteBuffer wb;
27 wb.Push("hello", 5);
28 WriteBuffer wb2(std::move(wb));
29 EXPECT_EQ(wb2.Size(), 5);
30 EXPECT_TRUE(wb.Empty());
31
32 WriteBuffer wb3;
33 wb3 = std::move(wb2);
34 EXPECT_EQ(wb3.Size(), 5);
35 EXPECT_TRUE(wb.Empty());
36}
37
38TEST(WriteBuffer, PushPop) {
39 WriteBuffer wb;

Callers

nothing calls this directly

Calls 6

ToStringMethod · 0.80
PushMethod · 0.45
SizeMethod · 0.45
EmptyMethod · 0.45
ReserveMethod · 0.45
CapacityMethod · 0.45

Tested by

no test coverage detected