| 48 | CPPUNIT_TEST_SUITE_REGISTRATION(OptionHandlerTest); |
| 49 | |
| 50 | void OptionHandlerTest::testBooleanOptionHandler() |
| 51 | { |
| 52 | BooleanOptionHandler handler(PREF_DAEMON); |
| 53 | Option option; |
| 54 | handler.parse(option, A2_V_TRUE); |
| 55 | CPPUNIT_ASSERT_EQUAL(std::string(A2_V_TRUE), option.get(PREF_DAEMON)); |
| 56 | handler.parse(option, A2_V_FALSE); |
| 57 | CPPUNIT_ASSERT_EQUAL(std::string(A2_V_FALSE), option.get(PREF_DAEMON)); |
| 58 | try { |
| 59 | handler.parse(option, "hello"); |
| 60 | CPPUNIT_FAIL("exception must be thrown."); |
| 61 | } |
| 62 | catch (Exception& e) { |
| 63 | } |
| 64 | CPPUNIT_ASSERT_EQUAL(std::string("true, false"), |
| 65 | handler.createPossibleValuesString()); |
| 66 | } |
| 67 | |
| 68 | void OptionHandlerTest::testNumberOptionHandler() |
| 69 | { |
nothing calls this directly
no test coverage detected