diff --git a/tests/libtransport/config.cpp b/tests/libtransport/config.cpp index fea9ada11c53bb5d50a556af3ae635710c23c7a6..8062b6e5829de3cd96853d9610abb22d3e2407db 100644 --- a/tests/libtransport/config.cpp +++ b/tests/libtransport/config.cpp @@ -16,6 +16,7 @@ using namespace Transport; class ConfigTest : public CPPUNIT_NS :: TestFixture{ CPPUNIT_TEST_SUITE(ConfigTest); CPPUNIT_TEST(setStringTwice); + CPPUNIT_TEST(setUnknownBool); CPPUNIT_TEST(updateBackendConfig); CPPUNIT_TEST(updateBackendConfigJIDEscaping); CPPUNIT_TEST(unregisteredList); @@ -40,6 +41,14 @@ class ConfigTest : public CPPUNIT_NS :: TestFixture{ CPPUNIT_ASSERT_EQUAL(std::string("localhost"), CONFIG_STRING(&cfg, "service.jids")); } + void setUnknownBool() { + char *argv[3] = {"binary", "--service.jids=localhost", NULL}; + Config cfg(2, argv); + std::istringstream ifs("service.irc_send_pass = 1\n"); + cfg.load(ifs); + CPPUNIT_ASSERT_EQUAL(true, CONFIG_BOOL_DEFAULTED(&cfg, "service.irc_send_pass", false)); + } + void updateBackendConfig() { Config cfg; CPPUNIT_ASSERT(!cfg.hasKey("registration.needPassword"));