1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-03 09:09:47 +02:00
openrw/tests/test_config.cpp

21 lines
505 B
C++
Raw Normal View History

#include <GameConfig.hpp>
2016-09-09 22:13:22 +02:00
#include <boost/test/unit_test.hpp>
#include <fstream>
BOOST_AUTO_TEST_SUITE(ConfigTests)
2016-09-09 22:13:22 +02:00
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;
2016-09-09 22:13:22 +02:00
GameConfig config("openrw_test.ini", "/tmp");
2016-09-09 22:13:22 +02:00
BOOST_CHECK(config.isValid());
2016-09-09 22:13:22 +02:00
BOOST_CHECK_EQUAL(config.getGameDataPath(), "/dev/test");
}
BOOST_AUTO_TEST_SUITE_END()