From d2b706b874e144eb586df034aad2a75d73767b24 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 6 Jan 2017 22:45:25 +0100 Subject: [PATCH] tests: added test for comments in INI files tests: test whitespaces and comments handling in config unit test --- tests/test_config.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_config.cpp b/tests/test_config.cpp index c11339e2..9fe2b331 100644 --- a/tests/test_config.cpp +++ b/tests/test_config.cpp @@ -8,13 +8,19 @@ BOOST_AUTO_TEST_CASE(test_loading) { // Write out a temporary file std::ofstream test_config("/tmp/openrw_test.ini"); test_config << "[game]\n" - << "path=/dev/test" << std::endl; + << "\tpath=\t/dev/test\n" + << " language = american ;Comment\n" + << ";lineComment\n" + << "nonexistingkey=somevalue" + << std::endl; GameConfig config("openrw_test.ini", "/tmp"); BOOST_CHECK(config.isValid()); BOOST_CHECK_EQUAL(config.getGameDataPath(), "/dev/test"); + BOOST_CHECK_EQUAL(config.getGameLanguage(), "american"); } + BOOST_AUTO_TEST_SUITE_END()