MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / testLine

Function testLine

source/test/blocks_along_line_test.cpp:8–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6using namespace Star;
7
8void testLine(Vec2D a, Vec2D b, Vec2I offset, List<Vec2I> comp) {
9 List<Vec2I> res;
10 forBlocksAlongLine(a + Vec2D(offset),
11 b - a,
12 [&res](int x, int y) {
13 res.append({x, y});
14 return true;
15 });
16 for (auto& c : comp)
17 c += offset;
18 EXPECT_TRUE(comp == res);
19}
20
21void testGroup(Vec2I offset) {
22 testLine(Vec2D(0.5, 0.5), Vec2D(0.5, 0.5), offset, {{0, 0}});

Callers 1

testGroupFunction · 0.85

Calls 2

forBlocksAlongLineFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected