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

Function test_foo_sparse_attribute

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

Source from the content-addressed store, hash-verified

191}
192
193void test_foo_sparse_attribute( geode::AttributeManager& manager )
194{
195 auto sparse_attribute =
196 manager.find_or_create_attribute< geode::SparseAttribute, Foo >(
197 "foo_spr", Foo{} );
198 sparse_attribute->modify_value( 3, []( Foo& foo ) {
199 foo.double_ = 12.4;
200 } );
201 sparse_attribute->modify_value( 3, []( Foo& foo ) {
202 foo.int_ = 3;
203 } );
204 geode::OpenGeodeBasicException::test(
205 sparse_attribute->value( 0 ).double_ == 0, "Should be equal to 0" );
206 geode::OpenGeodeBasicException::test(
207 sparse_attribute->value( 3 ).double_ == 12.4,
208 "Should be equal to 12.4" );
209 geode::OpenGeodeBasicException::test(
210 sparse_attribute->value( 3 ).int_ == 3,
211 "Foo sparse value should be equal to 3" );
212}
213
214void test_double_sparse_attribute( geode::AttributeManager& manager )
215{

Callers 1

testFunction · 0.85

Calls 3

testFunction · 0.70
modify_valueMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected