void ConversionProperties::addOption(const ConversionOption &option) { ConversionOption *old = removeOption(option.getKey()); if (old != NULL) delete old; mOptions.insert(pair<string, ConversionOption*>(option.getKey(), option.clone())); }
END_TEST START_TEST (test_conversion_options_clone) { ConversionOption option("key", 1.1, "some description"); fail_unless(option.getDoubleValue() == 1.1); fail_unless(option.getType() == CNV_TYPE_DOUBLE); ConversionOption *clone = option.clone(); fail_unless(option.getKey() == clone->getKey()); fail_unless(option.getType() == clone->getType()); fail_unless(option.getValue() == clone->getValue()); fail_unless(option.getDescription() == clone->getDescription()); delete clone; }
void ConversionProperties::addOption(const ConversionOption &option) { if (&option == NULL) return; mOptions.insert(pair<string, ConversionOption*>( option.getKey(), option.clone())); }