| 171 | } |
| 172 | |
| 173 | void 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 | |
| 193 | void test_foo_sparse_attribute( geode::AttributeManager& manager ) |
| 194 | { |
no test coverage detected