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

Function test_bool_variable_attribute

tests/basic/test-attribute.cpp:302–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void test_bool_variable_attribute( geode::AttributeManager& manager )
303{
304 auto variable_attribute =
305 manager.find_or_create_attribute< geode::VariableAttribute, bool >(
306 "bool_var", false, { true, true } );
307 geode::OpenGeodeBasicException::test(
308 variable_attribute->default_value() == false, "Wrong default value" );
309 variable_attribute->set_value( 3, true );
310
311 const auto attribute = manager.find_attribute< bool >( "bool_var" );
312 geode::OpenGeodeBasicException::test(
313 attribute->value( 3 ), "Should be equal to true" );
314
315 variable_attribute->set_value( 3, false );
316 geode::OpenGeodeBasicException::test(
317 !attribute->value( 3 ), "Should be equal to false" );
318}
319
320bool managers_have_same_attributes( const geode::AttributeManager& manager,
321 const geode::AttributeManager& reloaded_manager )

Callers 1

testFunction · 0.85

Calls 4

default_valueMethod · 0.80
testFunction · 0.70
set_valueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected