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

Method GetInt

Modules/Core/test/mitkPreferencesTest.cpp:182–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 }
181
182 void GetInt()
183 {
184 auto* preferences = mitk::CoreServices::GetPreferencesService()->GetSystemPreferences();
185 const int expectedValue = 42;
186
187 preferences->PutInt("integer", expectedValue);
188 CPPUNIT_ASSERT_EQUAL(expectedValue, preferences->GetInt("integer", 0));
189
190 preferences->Put("overflow", "4200000000");
191 CPPUNIT_ASSERT_THROW(preferences->GetInt("overflow", 0), mitk::Exception);
192
193 preferences->Put("string", "fourty two");
194 CPPUNIT_ASSERT_THROW(preferences->GetInt("string", 0), mitk::Exception);
195 }
196
197 void GetFloat()
198 {

Callers 1

OverrideIntMethod · 0.45

Calls 3

PutIntMethod · 0.80
GetSystemPreferencesMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected