Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Functions
crossassetmodeldata.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <oret/datapaths.hpp>
#include <oret/fileutilities.hpp>
#include <oret/toplevelfixture.hpp>
#include <ored/model/irlgmdata.hpp>
#include <ored/model/calibrationinstruments/cpicapfloor.hpp>
#include <ored/model/crossassetmodeldata.hpp>
#include <ored/model/inflation/infdkdata.hpp>
#include <ored/utilities/correlationmatrix.hpp>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (testToXMLFromXML)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( testToXMLFromXML  )

Definition at line 326 of file crossassetmodeldata.cpp.

326 {
327
328 BOOST_TEST_MESSAGE("Testing toXML/fromXML...");
329
330 data::CrossAssetModelData data = *crossAssetData();
331 XMLDocument OutDoc;
332
333 XMLNode* simulationNode = OutDoc.allocNode("Simulation");
334 OutDoc.appendNode(simulationNode);
335
336 XMLNode* crossAssetModelNode = data.toXML(OutDoc);
337 XMLUtils::appendNode(simulationNode, crossAssetModelNode);
338
339 std::string filename = TEST_OUTPUT_FILE("simulationtest.xml");
340 OutDoc.toFile(filename);
341
343 newData.fromFile(filename);
344
345 BOOST_CHECK(data == newData);
346
347 newData.irConfigs() = {};
348 BOOST_CHECK(data != newData);
349}
Cross Asset Model Parameters.
const vector< QuantLib::ext::shared_ptr< IrModelData > > & irConfigs() const
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
void appendNode(XMLNode *)
Definition: xmlutils.cpp:118
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
void toFile(const string &filename) const
save the XML Document to the given file.
Definition: xmlutils.cpp:120
void fromFile(const std::string &filename)
Definition: xmlutils.cpp:150
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
@ data
Definition: log.hpp:77
+ Here is the call graph for this function: