diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-09-25 16:23:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 18:45:16 +0200 |
commit | a3530859e9a7423db0b6839f15538f248aaf4a79 (patch) | |
tree | 72bc9467a84a8e74b212d9539201087777b06e11 /tests/auto/sql | |
parent | 0bf30a7caba53aa85dcbdc877ace5e25bf45b526 (diff) |
Expose QTest::currentAppName() and remove hard-coded argv[0] in tests
Except where we're actually testing QCoreApplication::applicationName()
and friends.
Change-Id: I25514884c11f43a4f82b1f818f822dc3d79f69a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'tests/auto/sql')
-rw-r--r-- | tests/auto/sql/kernel/qsql/tst_qsql.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/sql/kernel/qsql/tst_qsql.cpp b/tests/auto/sql/kernel/qsql/tst_qsql.cpp index bc6b36931a..5747683e4e 100644 --- a/tests/auto/sql/kernel/qsql/tst_qsql.cpp +++ b/tests/auto/sql/kernel/qsql/tst_qsql.cpp @@ -114,8 +114,8 @@ void tst_QSql::cleanup() void tst_QSql::basicDriverTest() { int argc = 1; - const char *argv[] = {"test"}; - QGuiApplication app(argc, const_cast<char **>(argv), false); + char *argv[] = { const_cast<char*>(QTest::currentAppName()) }; + QGuiApplication app(argc, argv, false); tst_Databases dbs; dbs.open(); @@ -155,10 +155,10 @@ void tst_QSql::open() { int i; int argc = 1; - const char *argv[] = {"test"}; + char *argv[] = { const_cast<char*>(QTest::currentAppName()) }; int count = -1; for (i = 0; i < 10; ++i) { - QGuiApplication app(argc, const_cast<char **>(argv), false); + QGuiApplication app(argc, argv, false); tst_Databases dbs; dbs.open(); @@ -184,8 +184,8 @@ void tst_QSql::openInvalid() void tst_QSql::concurrentAccess() { int argc = 1; - const char *argv[] = {"test"}; - QGuiApplication app(argc, const_cast<char **>(argv), false); + char *argv[] = { const_cast<char*>(QTest::currentAppName()) }; + QGuiApplication app(argc, argv, false); tst_Databases dbs; dbs.open(); @@ -213,8 +213,8 @@ void tst_QSql::concurrentAccess() void tst_QSql::openErrorRecovery() { int argc = 1; - const char *argv[] = {"test"}; - QGuiApplication app(argc, const_cast<char **>(argv), false); + char *argv[] = { const_cast<char*>(QTest::currentAppName()) }; + QGuiApplication app(argc, argv, false); tst_Databases dbs; dbs.addDbs(); @@ -261,8 +261,8 @@ void tst_QSql::openErrorRecovery() void tst_QSql::registerSqlDriver() { int argc = 1; - const char *argv[] = {"test"}; - QGuiApplication app(argc, const_cast<char **>(argv), false); + char *argv[] = { const_cast<char*>(QTest::currentAppName()) }; + QGuiApplication app(argc, argv, false); QSqlDatabase::registerSqlDriver("QSQLTESTDRIVER", new QSqlDriverCreator<QSqlNullDriver>); QVERIFY(QSqlDatabase::drivers().contains("QSQLTESTDRIVER")); |