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

Method TestGetMTime

Modules/Core/test/mitkDataNodeTest.cpp:237–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 renderWindow->Delete();
236 }
237 static void TestGetMTime(mitk::DataNode::Pointer dataNode)
238 {
239 unsigned long time;
240 time = dataNode->GetMTime();
241 mitk::PointSet::Pointer pointSet = mitk::PointSet::New();
242
243 dataNode->SetData(pointSet);
244 MITK_TEST_CONDITION(time != dataNode->GetMTime(),
245 "Testing if the node timestamp is updated after adding data to the node")
246
247 mitk::Point3D point;
248 point.Fill(3.0);
249 pointSet->SetPoint(0, point);
250
251 // less or equal because dataNode timestamp is little later then the basedata timestamp
252 MITK_TEST_CONDITION(pointSet->GetMTime() <= dataNode->GetMTime(),
253 "Testing if the node timestamp is updated after base data was modified")
254
255 // testing if changing anything in the property list also sets the node in a modified state
256 unsigned long lastModified = dataNode->GetMTime();
257 dataNode->SetIntProperty("testIntProp", 2344);
258 MITK_TEST_CONDITION(lastModified <= dataNode->GetMTime(),
259 "Testing if the node timestamp is updated after property list was modified")
260 }
261 static void TestSetDataUnderPropertyChange(void)
262 {
263 mitk::Image::Pointer image = mitk::Image::New();

Callers

nothing calls this directly

Calls 6

NewFunction · 0.50
GetMTimeMethod · 0.45
SetDataMethod · 0.45
FillMethod · 0.45
SetPointMethod · 0.45
SetIntPropertyMethod · 0.45

Tested by

no test coverage detected