Permalink
Browse files

Finish ConfigTest::testThatQueryConfigPropertyWorksOkForStrings() test.

  • Loading branch information...
1 parent fdb0150 commit 8c5e624dc3a4fc0d6d87ccbca2b93327151e6ebb @novel committed Jan 27, 2009
Showing with 4 additions and 5 deletions.
  1. +0 −3 src/Config.cc
  2. +4 −2 tests/livejournalxx/ConfigTest.cc
View
@@ -20,8 +20,6 @@ Config::Config()
{
this->configDirectory = std::string(getenv("HOME")) + "/.ecru/";
- //string filename = std::string(getenv("HOME")) + "/.ecru/default.conf";
- //string filename = this->configDirectory + "default.conf";
string filename = getCurrentConfigFilename();
libconfig::Config *cfg = new libconfig::Config();
@@ -48,7 +46,6 @@ string Config::queryConfigProperty(string property)
result = (const char*)setting;
break;
case libconfig::Setting::TypeBoolean:
- //bool val = (bool)setting;
result = ((bool)setting) ? "true" : "false";
break;
default:
@@ -38,11 +38,13 @@ void ConfigTest::testThatQueryConfigPropertyWorksOkForStrings()
configSetting.add("true", libconfig::Setting::TypeBoolean);
configSetting.add("false", libconfig::Setting::TypeBoolean);
configSetting["test"] = "foobar";
+ configSetting["true"] = true;
+ configSetting["false"] = false;
Config *config = new Config(cfg);
string result = config->queryConfigProperty("config.test");
CPPUNIT_ASSERT(result == "foobar");
- // XXX
- //cout << config->queryConfigProperty("config.true") << endl;
+ CPPUNIT_ASSERT("true" == config->queryConfigProperty("config.true"));
+ CPPUNIT_ASSERT("false" == config->queryConfigProperty("config.false"));
}

0 comments on commit 8c5e624

Please sign in to comment.