| 191 | } |
| 192 | |
| 193 | void 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 | |
| 214 | void test_double_sparse_attribute( geode::AttributeManager& manager ) |
| 215 | { |
no test coverage detected