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

Method AreNodesEqual

Modules/SceneSerialization/test/mitkDataStorageCompare.cpp:237–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237bool mitk::DataStorageCompare::AreNodesEqual(const mitk::DataNode *reference, const mitk::DataNode *test, bool verbose)
238{
239 if (reference == nullptr && test == nullptr)
240 return true;
241
242 if (reference == nullptr && test != nullptr)
243 {
244 if (verbose)
245 MITK_WARN << " Reference node is nullptr, test node is not (type " << test->GetNameOfClass() << ")";
246 return false;
247 }
248
249 if (reference != nullptr && test == nullptr)
250 {
251 if (verbose)
252 MITK_WARN << " Test node is nullptr, reference node is not (type " << reference->GetNameOfClass() << ")";
253 return false;
254 }
255
256 if (m_TestAspects & CMP_Data)
257 m_DataPassed &= IsDataEqual(reference->GetData(), test->GetData(), verbose);
258
259 if (m_TestAspects & CMP_Properties)
260 m_PropertiesPassed &= ArePropertyListsEqual(*reference, *test, verbose);
261
262 if (m_TestAspects & CMP_Mappers)
263 m_MappersPassed &= AreMappersEqual(*reference, *test, verbose);
264
265 // .. add interactors/mappers
266
267 // two real nodes, need to really compare
268 return m_AspectsFailed == 0;
269}
270
271bool mitk::DataStorageCompare::IsDataEqual(const mitk::BaseData *reference, const mitk::BaseData *test, bool verbose)
272{

Callers

nothing calls this directly

Calls 2

GetNameOfClassMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected