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

Function test_int_variable_attribute

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

Source from the content-addressed store, hash-verified

171}
172
173void test_int_variable_attribute( geode::AttributeManager& manager )
174{
175 auto variable_attribute =
176 manager.find_or_create_attribute< geode::VariableAttribute, int >(
177 "int", 12, { true, true } );
178 geode::OpenGeodeBasicException::test(
179 variable_attribute->default_value() == 12, "Wrong default value" );
180 variable_attribute->set_value( 3, 3 );
181
182 const auto attribute = manager.find_attribute< int >( "int" );
183 geode::OpenGeodeBasicException::test( attribute->value( 3 ) == 3,
184 "Int variable value 3 should be equal to 3" );
185 geode::OpenGeodeBasicException::test( attribute->value( 6 ) == 12,
186 "Int variable value 6 should be equal to 12" );
187
188 variable_attribute->set_value( 3, 5 );
189 geode::OpenGeodeBasicException::test( attribute->value( 3 ) == 5,
190 "Int variable value 3 should be equal to 5" );
191}
192
193void test_foo_sparse_attribute( geode::AttributeManager& manager )
194{

Callers 1

testFunction · 0.70

Calls 4

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

Tested by

no test coverage detected