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

Method Setup

Modules/Core/test/mitkTinyXMLTest.cpp:60–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60 bool Setup(double valueToWrite)
61 {
62 m_Document.Clear();
63 m_DoubleTest = nullptr;
64
65 // 1. create simple document
66 m_Document.InsertEndChild(m_Document.NewDeclaration());
67
68 auto *version = m_Document.NewElement("Version");
69 version->SetAttribute("Writer", __FILE__);
70 version->SetAttribute("CVSRevision", "$Revision: 17055 $");
71 version->SetAttribute("FileVersion", 1);
72 m_Document.InsertEndChild(version);
73
74 // 2. store one element containing a double value with potentially many after comma digits.
75 auto *vElement = m_Document.NewElement(m_ElementToStoreAttributeName.c_str());
76 vElement->SetAttribute(m_AttributeToStoreName.c_str(), valueToWrite);
77 m_Document.InsertEndChild(vElement);
78
79 // 3. store in file.
80 auto err = m_Document.SaveFile(m_Filename.c_str());
81 return tinyxml2::XML_SUCCESS == err;
82 }
83
84public:
85 void setUp() override {}

Callers

nothing calls this directly

Calls 1

ClearMethod · 0.45

Tested by

no test coverage detected