| 212 | } |
| 213 | |
| 214 | void test_double_sparse_attribute( geode::AttributeManager& manager ) |
| 215 | { |
| 216 | auto sparse_attribute = |
| 217 | manager.find_or_create_attribute< geode::SparseAttribute, double >( |
| 218 | "double", 12., { true, true } ); |
| 219 | geode::OpenGeodeBasicException::test( |
| 220 | sparse_attribute->default_value() == 12, "Wrong default value" ); |
| 221 | sparse_attribute->set_value( 3, 3 ); |
| 222 | sparse_attribute->set_value( 7, 7 ); |
| 223 | manager.assign_attribute_value( 3, 2 ); |
| 224 | manager.interpolate_attribute_value( { { 1, 7 }, { 0.5, 0.3 } }, 4 ); |
| 225 | |
| 226 | auto attribute = manager.find_attribute< double >( "double" ); |
| 227 | geode::OpenGeodeBasicException::test( attribute->value( 2 ) == 3, |
| 228 | "Double sparse value 2 should be equal to 3" ); |
| 229 | geode::OpenGeodeBasicException::test( attribute->value( 3 ) == 3, |
| 230 | "Double sparse value 3 should be equal to 3" ); |
| 231 | geode::OpenGeodeBasicException::test( |
| 232 | attribute->value( 4 ) == 8.1, "Should be equal to 8.1" ); |
| 233 | geode::OpenGeodeBasicException::test( |
| 234 | attribute->value( 6 ) == 12, "Should be equal to 12" ); |
| 235 | geode::OpenGeodeBasicException::test( |
| 236 | attribute->value( 7 ) == 7, "Should be equal to 7" ); |
| 237 | |
| 238 | sparse_attribute->set_value( 3, 5 ); |
| 239 | geode::OpenGeodeBasicException::test( |
| 240 | attribute->value( 3 ) == 5, "Should be equal to 5" ); |
| 241 | } |
| 242 | |
| 243 | void test_double_array_attribute( geode::AttributeManager& manager ) |
| 244 | { |
no test coverage detected