Rename TestApplication::m_instance to TestApplication::s_instance

sendfile
Martchus 3 years ago
parent 5efb1b4710
commit 66bb3e5253
  1. 8
      tests/testutils.cpp
  2. 6
      tests/testutils.h

@ -93,7 +93,7 @@ bool makeDir(const string &path)
#endif
}
TestApplication *TestApplication::m_instance = nullptr;
TestApplication *TestApplication::s_instance = nullptr;
/*!
* \class TestApplication
@ -123,10 +123,10 @@ TestApplication::TestApplication(int argc, const char *const *argv)
, m_unitsArg("units", 'u', "specifies the units to test; omit to test all units", { "unit1", "unit2", "unit3" })
{
// check whether there is already an instance
if (m_instance) {
if (s_instance) {
throw runtime_error("only one TestApplication instance allowed at a time");
}
m_instance = this;
s_instance = this;
// handle specified arguments (if present)
if (argc && argv) {
@ -212,7 +212,7 @@ TestApplication::TestApplication(int argc, const char *const *argv)
*/
TestApplication::~TestApplication()
{
m_instance = nullptr;
s_instance = nullptr;
}
/*!

@ -61,7 +61,7 @@ private:
std::vector<std::string> m_testFilesPaths;
std::string m_workingDir;
bool m_valid;
static TestApplication *m_instance;
static TestApplication *s_instance;
};
/*!
@ -80,7 +80,7 @@ inline TestApplication::operator bool() const
*/
inline const TestApplication *TestApplication::instance()
{
return TestApplication::m_instance;
return TestApplication::s_instance;
}
/*!
@ -88,7 +88,7 @@ inline const TestApplication *TestApplication::instance()
*/
inline const char *TestApplication::appPath()
{
return m_instance ? m_instance->applicationPath() : "";
return s_instance ? s_instance->applicationPath() : "";
}
/*!

Loading…
Cancel
Save