void PluginsTest::pluginInformations() { CPPUNIT_ASSERT_MESSAGE("'Test' plugin must be loaded", PluginLister::pluginExists("Test")); std::list<Dependency> dependencies = PluginLister::instance()->getPluginDependencies("Test"); CPPUNIT_ASSERT_EQUAL(size_t(1), dependencies.size()); CPPUNIT_ASSERT_EQUAL(string("Test"), dependencies.begin()->pluginName); CPPUNIT_ASSERT_EQUAL(string("1.0"), dependencies.begin()->pluginRelease); tlp::ParameterDescriptionList parameters = PluginLister::instance()->getPluginParameters("Test"); Iterator<ParameterDescription>* it = parameters.getParameters(); CPPUNIT_ASSERT_MESSAGE("Test plugin has no parameters", it->hasNext()); ParameterDescription param = it->next(); CPPUNIT_ASSERT_EQUAL(string("result"), param.getName()); param = it->next(); CPPUNIT_ASSERT_EQUAL(string("testParameter"), param.getName()); CPPUNIT_ASSERT_MESSAGE("test parameter should not be mandatory", !param.isMandatory()); CPPUNIT_ASSERT_EQUAL(string("0"), param.getDefaultValue()); #ifndef _MSC_VER CPPUNIT_ASSERT_EQUAL(string("i"), param.getTypeName()); #else CPPUNIT_ASSERT_EQUAL(string("int"), param.getTypeName()); #endif const Plugin& factory(PluginLister::instance()->pluginInformation("Test")); CPPUNIT_ASSERT_EQUAL(string("Jezequel"), factory.author()); CPPUNIT_ASSERT_EQUAL(string("03/11/2004"), factory.date()); CPPUNIT_ASSERT_EQUAL(string(""), factory.group()); CPPUNIT_ASSERT_EQUAL(0, factory.id()); CPPUNIT_ASSERT_EQUAL(string("1"), factory.major()); CPPUNIT_ASSERT_EQUAL(string("0"), factory.minor()); CPPUNIT_ASSERT_EQUAL(string("Test"), factory.name()); CPPUNIT_ASSERT_EQUAL(string("1.0"), factory.release()); CPPUNIT_ASSERT_EQUAL(tlp::getMajor(TULIP_VERSION), factory.tulipMajor()); CPPUNIT_ASSERT_EQUAL(tlp::getMinor(TULIP_VERSION), factory.tulipMinor()); CPPUNIT_ASSERT_EQUAL(string(TULIP_VERSION), factory.tulipRelease()); CPPUNIT_ASSERT_EQUAL(getTulipVersion(), factory.tulipRelease()); CPPUNIT_ASSERT_EQUAL(tlp::getMajor(getTulipVersion()), factory.tulipMajor()); CPPUNIT_ASSERT_EQUAL(tlp::getMinor(getTulipVersion()), factory.tulipMinor()); }
bool operator<(const ParameterDescription &lhs, const ParameterDescription &rhs) { return lhs.id() < rhs.id(); }
void Device::add(ParameterDescription parameter) { _parameters.insert(std::make_pair(parameter.name(), parameter)); }
bool compare_test(const ParameterDescription & lhs, const ParameterDescription & rhs) { return lhs.id() == rhs.id() && lhs.description() == rhs.description() && lhs.name() == rhs.name(); }