diff --git a/tests/HelpersTest.cpp b/tests/HelpersTest.cpp index 4b274956..b453f732 100644 --- a/tests/HelpersTest.cpp +++ b/tests/HelpersTest.cpp @@ -78,7 +78,7 @@ TEST(AppHelper, Ofstream) { TempFile myfile(name); { - std::ofstream out = myfile.ofstream(); + std::ofstream out{myfile}; out << "this is output" << std::endl; } diff --git a/tests/IniTest.cpp b/tests/IniTest.cpp index 52661dd4..29cacd0f 100644 --- a/tests/IniTest.cpp +++ b/tests/IniTest.cpp @@ -64,7 +64,7 @@ TEST_F(TApp, IniNotRequired) { app.add_config("--config", tmpini); { - std::ofstream out = tmpini.ofstream(); + std::ofstream out{tmpini}; out << "[default]" << std::endl; out << "two=99" << std::endl; out << "three=3" << std::endl; @@ -102,7 +102,7 @@ TEST_F(TApp, IniRequired) { app.add_config("--config", tmpini); { - std::ofstream out = tmpini.ofstream(); + std::ofstream out{tmpini}; out << "[default]" << std::endl; out << "two=99" << std::endl; out << "three=3" << std::endl; diff --git a/tests/app_helper.hpp b/tests/app_helper.hpp index 85b02aa6..363641b1 100644 --- a/tests/app_helper.hpp +++ b/tests/app_helper.hpp @@ -39,9 +39,6 @@ public: std::remove(_name.c_str()); // Doesn't matter if returns 0 or not } - /// Returns by move in C++11 - std::ofstream ofstream() const {return std::ofstream(_name);} - operator const std::string& () const {return _name;} const char* c_str() const {return _name.c_str();} };