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

Function test_attribute

tests/mesh/test-light-regular-grid.cpp:333–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void test_attribute( const geode::LightRegularGrid3D& grid )
334{
335 auto attribute =
336 grid.cell_attribute_manager()
337 .find_or_create_attribute< geode::VariableAttribute, double >(
338 "toto", -1 );
339 attribute->set_value( 10, 10 );
340 geode::OpenGeodeMeshException::test(
341 attribute->value( 0 ) == -1, "Wrong attribute value" );
342 geode::OpenGeodeMeshException::test(
343 attribute->value( 10 ) == 10, "Wrong attribute value" );
344 geode::OpenGeodeMeshException::test(
345 attribute->value( grid.nb_cells() - 1 ) == -1,
346 "Wrong attribute value" );
347}
348
349void test_io(
350 const geode::LightRegularGrid3D& grid, const std::string& filename )

Callers 1

testFunction · 0.85

Calls 4

testFunction · 0.70
set_valueMethod · 0.45
valueMethod · 0.45
nb_cellsMethod · 0.45

Tested by

no test coverage detected