mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Make Qt5 fix for RiaApplication::launchUnitTests() a bit safer.
This commit is contained in:
parent
cd75be6671
commit
e510237793
@ -1296,6 +1296,10 @@ int RiaApplication::launchUnitTests()
|
||||
#ifdef USE_UNIT_TESTS
|
||||
cvf::Assert::setReportMode(cvf::Assert::CONSOLE);
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
int argc = QCoreApplication::argc();
|
||||
char** argv = QCoreApplication::argv();
|
||||
#else
|
||||
int argc = QCoreApplication::arguments().size();
|
||||
QStringList arguments = QCoreApplication::arguments();
|
||||
std::vector<std::string> argumentsStd;
|
||||
@ -1303,13 +1307,15 @@ int RiaApplication::launchUnitTests()
|
||||
{
|
||||
argumentsStd.push_back(qstring.toStdString());
|
||||
}
|
||||
std::vector<char*> argv;
|
||||
std::vector<char*> argVector;
|
||||
for (std::string& string : argumentsStd)
|
||||
{
|
||||
argv.push_back(&string.front());
|
||||
argVector.push_back(&string.front());
|
||||
}
|
||||
char** argv = argVector.data();
|
||||
#endif
|
||||
|
||||
testing::InitGoogleTest(&argc, argv.data());
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
|
||||
// Use this macro in main() to run all tests. It returns 0 if all
|
||||
// tests are successful, or 1 otherwise.
|
||||
|
Loading…
Reference in New Issue
Block a user