diff --git a/tests/iotests.cpp b/tests/iotests.cpp index d39b32a..9b5d829 100644 --- a/tests/iotests.cpp +++ b/tests/iotests.cpp @@ -328,12 +328,12 @@ void IoTests::testIniFile() // write values to another file fstream outputFile; outputFile.exceptions(ios_base::failbit | ios_base::badbit); - outputFile.open(workingCopyPathMode("output.ini", WorkingCopyMode::NoCopy), ios_base::out | ios_base::trunc); + outputFile.open(workingCopyPath("output.ini", WorkingCopyMode::NoCopy), ios_base::out | ios_base::trunc); ini.make(outputFile); // parse written values (again) outputFile.close(); - outputFile.open(workingCopyPathMode("output.ini", WorkingCopyMode::NoCopy), ios_base::in); + outputFile.open(workingCopyPath("output.ini", WorkingCopyMode::NoCopy), ios_base::in); IniFile ini2; ini2.parse(outputFile); CPPUNIT_ASSERT(ini.data() == ini2.data()); diff --git a/tests/testutils.cpp b/tests/testutils.cpp index 793b90b..e81adc5 100644 --- a/tests/testutils.cpp +++ b/tests/testutils.cpp @@ -253,20 +253,11 @@ string TestApplication::testFilePath(const string &relativeTestFilePath) const * * \remarks The test file is located using testFilePath(). */ -string TestApplication::workingCopyPathMode(const string &relativeTestFilePath, WorkingCopyMode mode) const +string TestApplication::workingCopyPath(const string &relativeTestFilePath, WorkingCopyMode mode) const { return workingCopyPathAs(relativeTestFilePath, relativeTestFilePath, mode); } -/*! - * \brief Returns the full path to a working copy of the test file with the specified \a relativeTestFilePath. - * \remarks The test file is located using testFilePath(). - */ -string TestApplication::workingCopyPath(const string &relativeTestFilePath) const -{ - return workingCopyPathAs(relativeTestFilePath, relativeTestFilePath, WorkingCopyMode::CreateCopy); -} - /*! * \brief Returns the full path to a working copy of the test file with the specified \a relativeTestFilePath. * diff --git a/tests/testutils.h b/tests/testutils.h index 9a8f27c..256f4fc 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -11,7 +11,7 @@ namespace TestUtilities { /*! - * \brief The WorkingCopyMode enum specifies additional options to influence behavior of TestApplication::workingCopyPathMode(). + * \brief The WorkingCopyMode enum specifies additional options to influence behavior of TestApplication::workingCopyPath(). */ enum class WorkingCopyMode { CreateCopy, /**< a working copy of the test file is created */ @@ -26,8 +26,7 @@ public: operator bool() const; std::string testFilePath(const std::string &relativeTestFilePath) const; - std::string workingCopyPathMode(const std::string &relativeTestFilePath, WorkingCopyMode mode) const; - std::string workingCopyPath(const std::string &relativeTestFilePath) const; + std::string workingCopyPath(const std::string &relativeTestFilePath, WorkingCopyMode mode = WorkingCopyMode::CreateCopy) const; std::string workingCopyPathAs(const std::string &relativeTestFilePath, const std::string &relativeWorkingCopyPath, WorkingCopyMode mode = WorkingCopyMode::CreateCopy) const; #ifdef PLATFORM_UNIX @@ -110,16 +109,7 @@ inline CPP_UTILITIES_EXPORT std::string testFilePath(const std::string &relative * \brief Convenience function to invoke TestApplication::workingCopyPath(). * \remarks A TestApplication must be present. */ -inline CPP_UTILITIES_EXPORT std::string workingCopyPath(const std::string &relativeTestFilePath) -{ - return TestApplication::instance()->workingCopyPathAs(relativeTestFilePath, relativeTestFilePath, WorkingCopyMode::CreateCopy); -} - -/*! - * \brief Convenience function to invoke TestApplication::workingCopyPathMode(). - * \remarks A TestApplication must be present. - */ -inline CPP_UTILITIES_EXPORT std::string workingCopyPathMode(const std::string &relativeTestFilePath, WorkingCopyMode mode) +inline CPP_UTILITIES_EXPORT std::string workingCopyPath(const std::string &relativeTestFilePath, WorkingCopyMode mode = WorkingCopyMode::CreateCopy) { return TestApplication::instance()->workingCopyPathAs(relativeTestFilePath, relativeTestFilePath, mode); }