MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / makeChunkWithRange

Function makeChunkWithRange

pj_datastore/tests/regression_test.cpp:31–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29// ---------------------------------------------------------------------------
30
31TopicChunk makeChunkWithRange(TopicId tid, Timestamp t_start, Timestamp t_end, uint32_t num_rows) {
32 std::vector<ColumnDescriptor> cols = {{0, PrimitiveType::kFloat32, "v"}};
33 TopicChunkBuilder b(tid, /*schema_id=*/1, cols, num_rows);
34 Timestamp step = (num_rows > 1) ? (t_end - t_start) / static_cast<Timestamp>(num_rows - 1) : 0;
35 for (uint32_t i = 0; i < num_rows; ++i) {
36 b.beginRow(t_start + static_cast<Timestamp>(i) * step);
37 b.set(0, static_cast<float>(i));
38 b.finishRow();
39 }
40 return b.seal();
41}
42
43// ===========================================================================
44// Bug #1 — flush() with an in-progress row corrupts chunk stats

Callers 1

TESTFunction · 0.85

Calls 4

setMethod · 0.80
sealMethod · 0.80
beginRowMethod · 0.45
finishRowMethod · 0.45

Tested by

no test coverage detected