Skip to content

Commit

Permalink
tests used QueryUtils::queryResultSize() SQLite
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Jul 29, 2022
1 parent bf7ae58 commit 2e376c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/supported-compilers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords: [c++ orm, supported compilers, supported build systems, tinyorm]

# Supported Compilers

Following compilers are backed up by the GitHub Action [workflows](https://github.com/silverqx/TinyORM/tree/main/.github/workflows) (CI pipelines), these workflows also include more then __1219 unit tests__ 😮💥.
Following compilers are backed up by the GitHub Action [workflows](https://github.com/silverqx/TinyORM/tree/main/.github/workflows) (CI pipelines), these workflows also include more then __1220 unit tests__ 😮💥.

<div id="supported-compilers">

Expand Down
14 changes: 3 additions & 11 deletions tests/auto/functional/orm/query/querybuilder/tst_querybuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,32 +764,24 @@ void tst_QueryBuilder::limit() const
{
QFETCH_GLOBAL(QString, connection);

if (const auto qtConnection = QSqlDatabase::database(connection);
!qtConnection.driver()->hasFeature(QSqlDriver::QuerySize)
)
// ", " to prevent warning about variadic macro
QSKIP(QStringLiteral("'%1' driver doesn't support reporting the size "
"of a query.")
.arg(qtConnection.driverName()).toUtf8().constData(), );

auto builder = createQuery(connection);

{
auto query = builder->from("torrents").limit(1).get({ID});

QCOMPARE(query.size(), 1);
QCOMPARE(QueryUtils::queryResultSize(query), 1);
}

{
auto query = builder->from("torrents").limit(3).get({ID});

QCOMPARE(query.size(), 3);
QCOMPARE(QueryUtils::queryResultSize(query), 3);
}

{
auto query = builder->from("torrents").limit(4).get({ID});

QCOMPARE(query.size(), 4);
QCOMPARE(QueryUtils::queryResultSize(query), 4);
}
}

Expand Down

0 comments on commit 2e376c2

Please sign in to comment.