MCPcopy Create free account
hub / github.com/MITK/MITK / GetFloat

Method GetFloat

Modules/Core/test/mitkPreferencesTest.cpp:197–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

GetSystemPreferencesMethod · 0.45
PutFloatMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected