From a88450bf131038984a8615a7c305cd66054eb46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20M=C3=A1rton?= Date: Sat, 11 Jan 2020 15:18:04 +0100 Subject: [PATCH] - Use SQLite for testing on Linux (#64) - Fix clang warning about parentheses --- test/common/consts.h | 8 ++++++++ test/tst_basic/tst_basic.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/common/consts.h b/test/common/consts.h index a75b771..717948d 100644 --- a/test/common/consts.h +++ b/test/common/consts.h @@ -12,12 +12,20 @@ .arg(timer.elapsed() / 1000.) \ .arg(__func__) +#ifdef Q_OS_LINUX +#define DRIVER "QSQLITE" +#define DATABASE QStringLiteral("/tmp/testdb.sqlite") +#define HOST QString() +#define USERNAME QString() +#define PASSWORD QString() +#else #define DRIVER "QODBC" #define DATABASE QString("DRIVER={SQL Server};Server=.;Database=%1;Uid=sa;Port=1433;Pwd=qwe123!@#;WSID=.") \ .arg(QString("nut_test_%1_db").arg(metaObject()->className()).toLower()) #define HOST "127.0.0.1" #define USERNAME "sa" #define PASSWORD "qwe123!@#" +#endif #ifdef Q_OS_LINUX # define OS "Linux" diff --git a/test/tst_basic/tst_basic.cpp b/test/tst_basic/tst_basic.cpp index 422a0e3..1a49325 100644 --- a/test/tst_basic/tst_basic.cpp +++ b/test/tst_basic/tst_basic.cpp @@ -148,7 +148,7 @@ void BasicTest::selectPosts() { auto q = db.posts()->query() ->join() - ->orderBy(!Post::saveDateField() | Post::bodyField()) + ->orderBy((!Post::saveDateField()) | Post::bodyField()) ->setWhere(Post::idField() == postId); auto posts = q->toList();