| 195 | } |
| 196 | |
| 197 | void GetFloat() |
| 198 | { |
| 199 | auto* preferences = mitk::CoreServices::GetPreferencesService()->GetSystemPreferences(); |
| 200 | float expectedValue = 3.14f; |
| 201 | |
| 202 | preferences->PutFloat("float", expectedValue); |
| 203 | CPPUNIT_ASSERT_DOUBLES_EQUAL(expectedValue, preferences->GetFloat("float", 0.0f), mitk::eps); |
| 204 | |
| 205 | preferences->Put("overflow", "3.14e100"); |
| 206 | CPPUNIT_ASSERT_THROW(preferences->GetFloat("overflow", 0.0f), mitk::Exception); |
| 207 | |
| 208 | preferences->Put("string", "pi"); |
| 209 | CPPUNIT_ASSERT_THROW(preferences->GetFloat("string", 0.0f), mitk::Exception); |
| 210 | } |
| 211 | |
| 212 | void OverrideString() |
| 213 | { |
nothing calls this directly
no test coverage detected