Skip to content

Commit 0caaf64

Browse files
committed
Update test case for collapse_count and extrusion depth
1 parent c6f18d6 commit 0caaf64

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/test_collapse.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@
66
TEST(SweepAndCollapse, Same) {
77
// Collapse and Sweep should be each other's reverse
88
auto storage = new chunked_voxel_storage<bit_t>(0., 0., 0., 0.1, 100, 100, 100, 32);
9-
storage->Set(make_vec<size_t>( 1U,1U,1U ));
9+
auto loc = make_vec<size_t>(1U, 1U, 1U);
10+
storage->Set(loc);
11+
1012
sweep s;
1113
collapse c;
14+
collapse_count cc;
15+
1216
auto swept = s(storage, 0, 0, 5);
17+
ASSERT_EQ(swept->count(), 5);
1318
auto result = c(swept, 0, 0, -1);
1419
ASSERT_EQ(result->count(), 1);
15-
ASSERT_TRUE(result->Get(make_vec<size_t>( 1U,1U,1U )));
20+
ASSERT_TRUE(result->Get(loc));
21+
22+
auto result2 = cc(swept, 0, 0, -1);
23+
size_t value;
24+
result2->Get(loc, &value);
25+
ASSERT_EQ(value, 5);
26+
// @nb dz=1 because the extrusion depth is now stored in the voxel value
27+
auto swept2 = s(result2, 0, 0, 1);
28+
ASSERT_EQ(swept2->count(), 5);
1629
}

0 commit comments

Comments
 (0)