Skip to content
Snippets Groups Projects
Commit 0238a2a4 authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Correction to ConfigService test so that if a test fails and leaves a file,...

Correction to ConfigService test so that if a test fails and leaves a file, the next run of the test removes the file before starting the test. Re #1248
parent bdaa1b94
No related branches found
No related tags found
No related merge requests found
......@@ -195,11 +195,13 @@ public:
void testSaveConfigCleanFile()
{
const std::string filename("user.settings");
Poco::File prop_file(filename);
// Start with a clean state
if( prop_file.exists() ) prop_file.remove();
ConfigServiceImpl& settings = ConfigService::Instance();
TS_ASSERT_THROWS_NOTHING(settings.saveConfig(filename));
Poco::File prop_file(filename);
// No changes yet, so no file
TS_ASSERT_EQUALS(prop_file.exists(), false);
......@@ -209,6 +211,9 @@ public:
void testSaveConfigExistingSettings()
{
const std::string filename("user.settings");
Poco::File prop_file(filename);
if( prop_file.exists() ) prop_file.remove();
ConfigServiceImpl& settings = ConfigService::Instance();
std::ofstream writer(filename.c_str(),std::ios_base::trunc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment