19 #include <boost/test/unit_test.hpp>
26 BOOST_AUTO_TEST_SUITE(physical)
42 BOOST_REQUIRE(designPtr.get() != 0);
53 BOOST_CHECK(designPtr->getDevice().empty());
54 BOOST_CHECK(designPtr->getPackage().empty());
55 BOOST_CHECK(designPtr->getSpeedGrade().empty());
56 BOOST_CHECK(designPtr->getXdlVersion().empty());
57 designPtr->setDevice(deviceName);
58 designPtr->setPackage(devicePackage);
59 designPtr->setSpeedGrade(deviceSpeedGrade);
60 designPtr->setXdlVersion(xdlVersion);
61 BOOST_CHECK_EQUAL(designPtr->getName(), designName);
62 BOOST_CHECK_EQUAL(designPtr->getDevice(), deviceName);
63 BOOST_CHECK_EQUAL(designPtr->getPackage(), devicePackage);
64 BOOST_CHECK_EQUAL(designPtr->getSpeedGrade(), deviceSpeedGrade);
65 BOOST_CHECK_EQUAL(designPtr->getXdlVersion(), xdlVersion);
75 BOOST_CHECK_EQUAL(designPtr->addModule(module1Ptr),
true);
76 BOOST_CHECK_EQUAL(designPtr->addModule(module2aPtr),
true);
77 BOOST_CHECK_EQUAL(designPtr->addModule(module2bPtr),
false);
78 BOOST_CHECK(designPtr->getModuleCount() == 2);
88 BOOST_CHECK(*p++ == module1Ptr);
89 BOOST_CHECK(*p++ == module2aPtr);
91 BOOST_CHECK(*(designPtr->findModule(moduleName)) == module1Ptr);
98 BOOST_CHECK_EQUAL(designPtr->removeModule(module1Ptr),
true);
99 BOOST_CHECK_EQUAL(designPtr->removeModule(module2aPtr),
true);
100 BOOST_CHECK_EQUAL(designPtr->removeModule(module2bPtr),
false);
101 BOOST_CHECK(designPtr->getModuleCount() == 0);
104 BOOST_AUTO_TEST_SUITE_END()
ModuleSharedPtrVector::const_iterator ModuleSharedPtrConstIterator
Constant iterator for Module shared pointers.
BOOST_AUTO_TEST_CASE(XdlUnpackUnitTest)
Unit test for the XdlUnpack class.
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Header for the Design class.
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
static ModuleSharedPtr newModulePtr(const string &inName, const string &inAnchor)
Create and return a new Module shared pointer.
static DesignSharedPtr newDesignPtr(const string &inName, const string &inDevice, const string &inPackage, const string &inSpeedGrade, const string &inXdlVersion)
Create and return a new Design shared pointer.
Header for the Factory class.