Skip to content

Commit d421505

Browse files
committed
unittests: Pass a safely modifiable arg to QCoreApplication
This also silents C++11 warning about deprecated conversion.
1 parent 9fa8e24 commit d421505

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tests/TestImport.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ TestImport::TestImport()
1515
// The app needs to be initialized for the utf8 test
1616
// to work
1717
argcount = 1;
18-
args[0] = "sqlb-unittests";
18+
args[0] = new char[20];
19+
strcpy(args[0], "sqlb-unittests");
1920
app = new QCoreApplication(argcount, args);
2021
}
2122

2223
TestImport::~TestImport()
2324
{
25+
delete[] args[0];
2426
delete app;
2527
}
2628

0 commit comments

Comments
 (0)