MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_cell_index

Function test_cell_index

tests/mesh/test-regular-grid.cpp:69–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void test_cell_index( const geode::RegularGrid3D& grid )
70{
71 geode::OpenGeodeMeshException::test(
72 grid.cell_index( { 0, 0, 0 } ) == 0, "Wrong cell index" );
73 geode::OpenGeodeMeshException::test(
74 grid.cell_index( { 1, 0, 0 } ) == 1, "Wrong cell index" );
75 geode::OpenGeodeMeshException::test(
76 grid.cell_index( { 0, 1, 0 } ) == 5, "Wrong cell index" );
77 geode::OpenGeodeMeshException::test(
78 grid.cell_index( { 0, 0, 1 } ) == 50, "Wrong cell index" );
79 geode::OpenGeodeMeshException::test(
80 grid.cell_index( { 1, 1, 1 } ) == 56, "Wrong cell index" );
81 geode::OpenGeodeMeshException::test(
82 grid.cell_index( { 2, 2, 2 } ) == 112, "Wrong cell index" );
83
84 geode::OpenGeodeMeshException::test(
85 grid.cell_index( grid.cell_indices( 0 ) ) == 0, "Wrong cell index" );
86 geode::OpenGeodeMeshException::test(
87 grid.cell_index( grid.cell_indices( 1 ) ) == 1, "Wrong cell index" );
88 geode::OpenGeodeMeshException::test(
89 grid.cell_index( grid.cell_indices( 5 ) ) == 5, "Wrong cell index" );
90 geode::OpenGeodeMeshException::test(
91 grid.cell_index( grid.cell_indices( 50 ) ) == 50, "Wrong cell index" );
92 geode::OpenGeodeMeshException::test(
93 grid.cell_index( grid.cell_indices( 56 ) ) == 56, "Wrong cell index" );
94 geode::OpenGeodeMeshException::test(
95 grid.cell_index( grid.cell_indices( 112 ) ) == 112,
96 "Wrong cell index" );
97
98 geode::OpenGeodeMeshException::test(
99 grid.next_cell( { 0, 0, 0 }, 0 )
100 == geode::Grid3D::CellIndices( { 1, 0, 0 } ),
101 "Wrong cell index" );
102 geode::OpenGeodeMeshException::test(
103 !grid.next_cell( { 4, 0, 0 }, 0 ), "Wrong cell index" );
104 geode::OpenGeodeMeshException::test(
105 !grid.previous_cell( { 0, 0, 0 }, 1 ), "Wrong cell index" );
106 geode::OpenGeodeMeshException::test(
107 grid.previous_cell( { 0, 0, 1 }, 2 )
108 == geode::Grid3D::CellIndices( { 0, 0, 0 } ),
109 "Wrong cell index" );
110}
111
112void test_cell_on_border( const geode::RegularGrid3D& grid )
113{

Callers 1

test_gridFunction · 0.70

Calls 5

testFunction · 0.70
cell_indexMethod · 0.45
cell_indicesMethod · 0.45
next_cellMethod · 0.45
previous_cellMethod · 0.45

Tested by

no test coverage detected