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

Function TEST

pj_datastore/tests/query_test.cpp:64–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62// =========================================================================
63
64TEST(QueryTest, RangeQuerySpanningTwoChunks) {
65 auto chunks = makeStandardChunks();
66 auto cursor = rangeQuery(chunks, 150, 250);
67
68 std::vector<Timestamp> timestamps;
69 while (cursor.valid()) {
70 timestamps.push_back(cursor.current().timestamp);
71 cursor.advance();
72 }
73
74 // Expected: 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250
75 ASSERT_EQ(timestamps.size(), 11u);
76 EXPECT_EQ(timestamps.front(), 150);
77 EXPECT_EQ(timestamps.back(), 250);
78 for (std::size_t i = 1; i < timestamps.size(); ++i) {
79 EXPECT_EQ(timestamps[i] - timestamps[i - 1], 10);
80 }
81}
82
83TEST(QueryTest, RangeQueryWithinSingleChunk) {
84 auto chunks = makeStandardChunks();

Callers

nothing calls this directly

Calls 11

makeStandardChunksFunction · 0.85
rangeQueryFunction · 0.85
latestAtFunction · 0.85
makeChunkFromTimestampsFunction · 0.85
currentMethod · 0.80
advanceMethod · 0.80
forEachMethod · 0.80
forEachChunkMethod · 0.80
readTimestampMethod · 0.80
validMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected