/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
public:
//! Global test input data path set with setDataInputDirectory().
- static const char *s_inputDirectory;
+ static std::string s_inputDirectory;
//! Global temporary output directory for tests, set with setGlobalOutputTempDirectory().
static const char *s_globalOutputTempDirectory;
std::string outputTempDirectory_;
};
-const char *TestFileManager::Impl::s_inputDirectory = NULL;
+std::string TestFileManager::Impl::s_inputDirectory;
const char *TestFileManager::Impl::s_globalOutputTempDirectory = NULL;
/** Controls whether TestFileManager should delete temporary files
after the test finishes. */
const char *TestFileManager::getInputDataDirectory()
{
- GMX_RELEASE_ASSERT(Impl::s_inputDirectory != NULL, "Path for test input files is not set");
- return Impl::s_inputDirectory;
+ GMX_RELEASE_ASSERT(!Impl::s_inputDirectory.empty(), "Path for test input files is not set");
+ return Impl::s_inputDirectory.c_str();
}
const char *TestFileManager::getGlobalOutputTempDirectory()
return impl_->outputTempDirectory_.c_str();
}
-void TestFileManager::setInputDataDirectory(const char *path)
+void TestFileManager::setInputDataDirectory(const std::string &path)
{
// There is no need to protect this by a mutex, as this is called in early
// initialization of the tests.