Lines Matching refs:rs

29   RangeSet rs(std::vector<Range>{ Range{ 8, 10 }, Range{ 1, 5 } });  in TEST()  local
30 ASSERT_TRUE(rs); in TEST()
40 RangeSet rs = RangeSet::Parse("2,1,10"); in TEST() local
41 ASSERT_EQ(static_cast<size_t>(1), rs.size()); in TEST()
42 ASSERT_EQ((Range{ 1, 10 }), rs[0]); in TEST()
43 ASSERT_EQ(static_cast<size_t>(9), rs.blocks()); in TEST()
52 ASSERT_EQ(rs, RangeSet::Parse(" 2, 1, 10")); in TEST()
77 RangeSet rs = RangeSet::Parse("2,1,6"); in TEST() local
78 ASSERT_TRUE(rs); in TEST()
79 rs.Clear(); in TEST()
80 ASSERT_FALSE(rs); in TEST()
83 rs.Clear(); in TEST()
84 ASSERT_FALSE(rs); in TEST()
88 RangeSet rs; in TEST() local
89 ASSERT_FALSE(rs); in TEST()
91 ASSERT_TRUE(rs.PushBack({ 3, 5 })); in TEST()
92 ASSERT_EQ(RangeSet::Parse("2,3,5"), rs); in TEST()
94 ASSERT_TRUE(rs.PushBack({ 5, 15 })); in TEST()
95 ASSERT_EQ(RangeSet::Parse("4,3,5,5,15"), rs); in TEST()
96 ASSERT_EQ(static_cast<size_t>(2), rs.size()); in TEST()
97 ASSERT_EQ(static_cast<size_t>(12), rs.blocks()); in TEST()
101 RangeSet rs; in TEST() local
102 ASSERT_FALSE(rs); in TEST()
103 ASSERT_FALSE(rs.PushBack({ 5, 3 })); in TEST()
104 ASSERT_FALSE(rs); in TEST()
105 ASSERT_FALSE(rs.PushBack({ 15, 15 })); in TEST()
106 ASSERT_FALSE(rs); in TEST()
108 ASSERT_TRUE(rs.PushBack({ 5, 15 })); in TEST()
109 ASSERT_FALSE(rs.PushBack({ 5, std::numeric_limits<size_t>::max() - 2 })); in TEST()
110 ASSERT_EQ(RangeSet::Parse("2,5,15"), rs); in TEST()
208 RangeSet rs = RangeSet::Parse("2,1,10"); in TEST() local
209 ASSERT_EQ(static_cast<size_t>(1), rs.GetBlockNumber(0)); in TEST()
210 ASSERT_EQ(static_cast<size_t>(6), rs.GetBlockNumber(5)); in TEST()
211 ASSERT_EQ(static_cast<size_t>(9), rs.GetBlockNumber(8)); in TEST()
215 ASSERT_EXIT(rs.GetBlockNumber(9), ::testing::KilledBySignal(SIGABRT), ""); in TEST()
229 RangeSet rs = RangeSet::Parse("4,1,5,8,10"); in TEST() local
231 for (const auto& range : rs) { in TEST()
239 for (auto it = rs.crbegin(); it != rs.crend(); it++) { in TEST()
276 SortedRangeSet rs({ { 2, 3 }, { 4, 6 }, { 8, 14 } }); in TEST() local
277 rs.Insert({ 1, 2 }); in TEST()
278 ASSERT_EQ(SortedRangeSet({ { 1, 3 }, { 4, 6 }, { 8, 14 } }), rs); in TEST()
279 ASSERT_EQ(static_cast<size_t>(10), rs.blocks()); in TEST()
280 rs.Insert({ 3, 5 }); in TEST()
281 ASSERT_EQ(SortedRangeSet({ { 1, 6 }, { 8, 14 } }), rs); in TEST()
282 ASSERT_EQ(static_cast<size_t>(11), rs.blocks()); in TEST()
285 rs.Insert(r1); in TEST()
286 ASSERT_EQ(SortedRangeSet({ { 1, 6 }, { 8, 14 }, { 15, 18 }, { 20, 22 } }), rs); in TEST()
287 ASSERT_EQ(static_cast<size_t>(16), rs.blocks()); in TEST()
290 rs.Insert(r2); in TEST()
291 ASSERT_EQ(SortedRangeSet({ { 1, 7 }, { 8, 14 }, { 15, 25 } }), rs); in TEST()
292 ASSERT_EQ(static_cast<size_t>(22), rs.blocks()); in TEST()
296 SortedRangeSet rs; in TEST() local
297 rs.Insert(4096, 4096); in TEST()
298 ASSERT_EQ(SortedRangeSet({ { 1, 2 } }), rs); in TEST()
300 rs.Insert(4096 * 3 - 1, 4096 * 7); in TEST()
301 ASSERT_EQ(SortedRangeSet({ { 1, 10 } }), rs); in TEST()
303 rs.Insert(4096 * 15 + 1, 4096 * 4); in TEST()
304 ASSERT_EQ(SortedRangeSet({ { 1, 10 }, { 15, 20 } }), rs); in TEST()
307 ASSERT_TRUE(rs.Overlaps(4096 * 2 - 1, 10)); in TEST()
308 ASSERT_FALSE(rs.Overlaps(4096 * 10, 4096 * 5)); in TEST()
310 ASSERT_EQ(static_cast<size_t>(10), rs.GetOffsetInRangeSet(4106)); in TEST()
311 ASSERT_EQ(static_cast<size_t>(40970), rs.GetOffsetInRangeSet(4096 * 16 + 10)); in TEST()
315 ASSERT_EXIT(rs.GetOffsetInRangeSet(40970), ::testing::KilledBySignal(SIGABRT), ""); in TEST()