- Use SQLite for testing on Linux (#64)

- Fix clang warning about parentheses
This commit is contained in:
Miklós Márton 2020-01-11 15:18:04 +01:00 committed by Hamed Masafi
parent 9762d65742
commit a88450bf13
2 changed files with 9 additions and 1 deletions

View File

@ -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"

View File

@ -148,7 +148,7 @@ void BasicTest::selectPosts()
{
auto q = db.posts()->query()
->join<Comment>()
->orderBy(!Post::saveDateField() | Post::bodyField())
->orderBy((!Post::saveDateField()) | Post::bodyField())
->setWhere(Post::idField() == postId);
auto posts = q->toList();