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

Function test_basic_accessor

tests/mesh/test-generic-mesh-accessor.cpp:98–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97template < typename Mesh >
98void test_basic_accessor( const Mesh& mesh, geode::index_t nb_element_vertices )
99{
100 using Accessor = geode::GenericMeshAccessor< Mesh >;
101 const Accessor accessor{ mesh };
102 geode::OpenGeodeMeshException::test(
103 accessor.nb_elements() == 2, "Wrong number of elements" );
104 geode::OpenGeodeMeshException::test(
105 accessor.nb_element_vertices( 0 ) == nb_element_vertices,
106 "Wrong number of element vertices" );
107 geode::OpenGeodeMeshException::test(
108 accessor.nb_element_facets( 0 ) == nb_element_vertices,
109 "Wrong number of element facets" );
110 geode::OpenGeodeMeshException::test(
111 accessor.element_vertex( { 0, 0 } ) == 0,
112 "Wrong element vertex { 0, 0 }" );
113 geode::OpenGeodeMeshException::test(
114 accessor.element_vertex( { 0, 1 } ) == 1,
115 "Wrong element vertex { 0, 1 }" );
116 geode::OpenGeodeMeshException::test(
117 accessor.element_vertices( 0 ).size() == nb_element_vertices,
118 "Wrong size of element vertices container" );
119 const auto attribute =
120 accessor.element_attribute_manager()
121 .template find_attribute< geode::index_t >( "test_attribute" );
122 geode::OpenGeodeMeshException::test(
123 attribute->value( 0 ) == 2 && attribute->value( 1 ) == 5,
124 "Wrong values of the element attributes." );
125 geode::OpenGeodeMeshException::test(
126 accessor.id() == mesh.id(), "Wrong uuid value." );
127 geode::OpenGeodeMeshException::test(
128 accessor.point( 0 ).value( 0 ) == 0
129 && accessor.point( 0 ).value( 1 ) == 0,
130 "Wrong point coordinate value." );
131}
132
133template < typename Mesh >
134void test_adjacent_accessor( const Mesh& mesh )

Callers 1

testFunction · 0.85

Calls 9

testFunction · 0.70
nb_elementsMethod · 0.45
nb_element_verticesMethod · 0.45
nb_element_facetsMethod · 0.45
element_vertexMethod · 0.45
sizeMethod · 0.45
element_verticesMethod · 0.45
valueMethod · 0.45
pointMethod · 0.45

Tested by

no test coverage detected