| 240 | } |
| 241 | |
| 242 | void OptionHandlerTest::testFloatNumberOptionHandler_min_max() |
| 243 | { |
| 244 | FloatNumberOptionHandler handler(PREF_TIMEOUT, "", "", 0.0, 10.0); |
| 245 | Option option; |
| 246 | handler.parse(option, "0.0"); |
| 247 | CPPUNIT_ASSERT_EQUAL(std::string("0.0"), option.get(PREF_TIMEOUT)); |
| 248 | handler.parse(option, "10.0"); |
| 249 | CPPUNIT_ASSERT_EQUAL(std::string("10.0"), option.get(PREF_TIMEOUT)); |
| 250 | try { |
| 251 | handler.parse(option, "-0.1"); |
| 252 | CPPUNIT_FAIL("exception must be thrown."); |
| 253 | } |
| 254 | catch (Exception& e) { |
| 255 | } |
| 256 | try { |
| 257 | handler.parse(option, "10.1"); |
| 258 | CPPUNIT_FAIL("exception must be thrown."); |
| 259 | } |
| 260 | catch (Exception& e) { |
| 261 | } |
| 262 | CPPUNIT_ASSERT_EQUAL(std::string("0.0-10.0"), |
| 263 | handler.createPossibleValuesString()); |
| 264 | } |
| 265 | |
| 266 | void OptionHandlerTest::testHttpProxyOptionHandler() |
| 267 | { |
nothing calls this directly
no test coverage detected