MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / TEST

Function TEST

tests/host/ui/ipc_buffer_model_test.cpp:49–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49TEST(IpcBufferModel, UpsertAddsThenReplacesByName) {
50 IpcBufferModel m;
51 m.upsert(rec("a", std::byte{1})); // -> index 0
52 m.upsert(rec("b", std::byte{2})); // -> index 1
53 ASSERT_EQ(m.size(), 2u);
54 ASSERT_EQ(m.variable_name_of(0), "a");
55 const std::uint64_t rev_a0 = m.revision_of(0);
56 // Re-plot "a": replaces in place (index 0 stays "a"), size unchanged,
57 // bytes updated, that slot's revision advances.
58 m.upsert(rec("a", std::byte{9}));
59 EXPECT_EQ(m.size(), 2u);
60 EXPECT_EQ(m.variable_name_of(0), "a");
61 EXPECT_EQ(m.at(0).bytes.front(), std::byte{9});
62 EXPECT_GT(m.revision_of(0), rev_a0);
63}
64
65TEST(IpcBufferModel, VariableNameAndRevisionOfTrackReplots) {
66 IpcBufferModel m;

Callers

nothing calls this directly

Calls 6

recFunction · 0.85
upsertMethod · 0.80
revisionMethod · 0.80
removeMethod · 0.80
sizeMethod · 0.45
revision_ofMethod · 0.45

Tested by

no test coverage detected