MCPcopy Create free account
hub / github.com/aria2/aria2 / testParameterOptionHandler

Method testParameterOptionHandler

test/OptionHandlerTest.cc:163–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void OptionHandlerTest::testParameterOptionHandler()
164{
165 ParameterOptionHandler handler(PREF_TIMEOUT, "", "", {"value1", "value2"});
166 Option option;
167 handler.parse(option, "value1");
168 CPPUNIT_ASSERT_EQUAL(std::string("value1"), option.get(PREF_TIMEOUT));
169 handler.parse(option, "value2");
170 CPPUNIT_ASSERT_EQUAL(std::string("value2"), option.get(PREF_TIMEOUT));
171 try {
172 handler.parse(option, "value3");
173 CPPUNIT_FAIL("exception must be thrown.");
174 }
175 catch (Exception& e) {
176 }
177 CPPUNIT_ASSERT_EQUAL(std::string("value1, value2"),
178 handler.createPossibleValuesString());
179}
180
181void OptionHandlerTest::testDefaultOptionHandler()
182{

Callers

nothing calls this directly

Calls 3

parseMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected