Remove workingCopyPathMode()
This commit is contained in:
parent
f0c6035609
commit
f16703ffc0
|
@ -328,12 +328,12 @@ void IoTests::testIniFile()
|
||||||
// write values to another file
|
// write values to another file
|
||||||
fstream outputFile;
|
fstream outputFile;
|
||||||
outputFile.exceptions(ios_base::failbit | ios_base::badbit);
|
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);
|
ini.make(outputFile);
|
||||||
|
|
||||||
// parse written values (again)
|
// parse written values (again)
|
||||||
outputFile.close();
|
outputFile.close();
|
||||||
outputFile.open(workingCopyPathMode("output.ini", WorkingCopyMode::NoCopy), ios_base::in);
|
outputFile.open(workingCopyPath("output.ini", WorkingCopyMode::NoCopy), ios_base::in);
|
||||||
IniFile ini2;
|
IniFile ini2;
|
||||||
ini2.parse(outputFile);
|
ini2.parse(outputFile);
|
||||||
CPPUNIT_ASSERT(ini.data() == ini2.data());
|
CPPUNIT_ASSERT(ini.data() == ini2.data());
|
||||||
|
|
|
@ -253,20 +253,11 @@ string TestApplication::testFilePath(const string &relativeTestFilePath) const
|
||||||
*
|
*
|
||||||
* \remarks The test file is located using testFilePath().
|
* \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);
|
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.
|
* \brief Returns the full path to a working copy of the test file with the specified \a relativeTestFilePath.
|
||||||
*
|
*
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
namespace TestUtilities {
|
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 {
|
enum class WorkingCopyMode {
|
||||||
CreateCopy, /**< a working copy of the test file is created */
|
CreateCopy, /**< a working copy of the test file is created */
|
||||||
|
@ -26,8 +26,7 @@ public:
|
||||||
|
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
std::string testFilePath(const std::string &relativeTestFilePath) 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, WorkingCopyMode mode = WorkingCopyMode::CreateCopy) const;
|
||||||
std::string workingCopyPath(const std::string &relativeTestFilePath) const;
|
|
||||||
std::string workingCopyPathAs(const std::string &relativeTestFilePath, const std::string &relativeWorkingCopyPath,
|
std::string workingCopyPathAs(const std::string &relativeTestFilePath, const std::string &relativeWorkingCopyPath,
|
||||||
WorkingCopyMode mode = WorkingCopyMode::CreateCopy) const;
|
WorkingCopyMode mode = WorkingCopyMode::CreateCopy) const;
|
||||||
#ifdef PLATFORM_UNIX
|
#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().
|
* \brief Convenience function to invoke TestApplication::workingCopyPath().
|
||||||
* \remarks A TestApplication must be present.
|
* \remarks A TestApplication must be present.
|
||||||
*/
|
*/
|
||||||
inline CPP_UTILITIES_EXPORT std::string workingCopyPath(const std::string &relativeTestFilePath)
|
inline CPP_UTILITIES_EXPORT std::string workingCopyPath(const std::string &relativeTestFilePath, WorkingCopyMode mode = WorkingCopyMode::CreateCopy)
|
||||||
{
|
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
return TestApplication::instance()->workingCopyPathAs(relativeTestFilePath, relativeTestFilePath, mode);
|
return TestApplication::instance()->workingCopyPathAs(relativeTestFilePath, relativeTestFilePath, mode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue