mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Update intervals tests for better code coverage
This commit is contained in:
@@ -61,8 +61,7 @@ Intervals<uint64_t> make_intervals(const rdcarray<Interval> &intervals)
|
||||
{
|
||||
auto j = res.end();
|
||||
j--;
|
||||
if(i->start > j->start())
|
||||
j->split(i->start);
|
||||
RDCASSERTMSG("make_intervals parameters must fully specify intervals", i->start == j->start());
|
||||
if(i->end < j->finish())
|
||||
{
|
||||
j->split(i->end);
|
||||
@@ -284,15 +283,14 @@ TEST_CASE("Test Intervals type", "[intervals]")
|
||||
SECTION("update an empty interval at 0")
|
||||
{
|
||||
Intervals<uint64_t> test = make_intervals({{0, 0, 5}, {5, 1, 10}, {10, 0, UINT64_MAX}});
|
||||
test.update(0, 0, 1, [](uint64_t x, uint64_t y) -> uint64_t { return x + y; });
|
||||
test.update(0, 0, 1, [](uint64_t x, uint64_t y) -> uint64_t { return 99; });
|
||||
check_intervals(test, {{0, 0, 5}, {5, 1, 10}, {10, 0, UINT64_MAX}});
|
||||
};
|
||||
|
||||
SECTION("update an empty interval at UINT64_MAX")
|
||||
{
|
||||
Intervals<uint64_t> test = make_intervals({{0, 0, 5}, {5, 1, 10}, {10, 0, UINT64_MAX}});
|
||||
test.update(UINT64_MAX, UINT64_MAX, 1,
|
||||
[](uint64_t x, uint64_t y) -> uint64_t { return x + y; });
|
||||
test.update(UINT64_MAX, UINT64_MAX, 1, [](uint64_t x, uint64_t y) -> uint64_t { return 99; });
|
||||
check_intervals(test, {{0, 0, 5}, {5, 1, 10}, {10, 0, UINT64_MAX}});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user