Skip to content

Commit

Permalink
tests revisited QVERIFY_THROWS_EXCEPTION quoting
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Sep 1, 2024
1 parent 7ebc899 commit 8e03b24
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tests/auto/functional/orm/tiny/model/tst_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1353,13 +1353,13 @@ void tst_Model::create_Failed() const

Torrent torrent;
QVERIFY_THROWS_EXCEPTION(QueryError,
(torrent = Torrent::create({
torrent = Torrent::create({
{"name-NON_EXISTENT", "test100"},
{SIZE_, 100},
{Progress, 333},
{AddedOn, addedOn},
{HASH_, "1009e3af2768cdf52ec84c1f320333f68401dc6e"},
})));
}));

QVERIFY(!torrent.exists);
QVERIFY(torrent.getAttributes().isEmpty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ defaultAttributeValues_WithQDateTime_ListInitializationCtor() const
/* List initialization using the std::initializer_list<AttributeItem> must throw
because of the QDateTime. */
QVERIFY_THROWS_EXCEPTION(InvalidArgumentError,
(Torrent_With_QDateTime {
Torrent_With_QDateTime({
{NAME, "test22"},
{NOTE, "Torrent::instance()"},
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,23 +419,23 @@ void tst_Model_Relations::getRelation_EagerLoad_Failed() const
// Many relation
QVERIFY_THROWS_EXCEPTION(
RelationNotLoadedError,
(torrent.getRelation<TorrentPreviewableFile>("torrentFiles")));
torrent.getRelation<TorrentPreviewableFile>("torrentFiles"));
// One relation, obtained as QList, also possible
QVERIFY_THROWS_EXCEPTION(
RelationNotLoadedError,
(torrent.getRelation<TorrentPeer>("torrentFiles")));
torrent.getRelation<TorrentPeer>("torrentFiles"));
// Many relation
QVERIFY_THROWS_EXCEPTION(
RelationNotLoadedError,
(torrent.getRelation<TorrentPeer, One>("torrentFiles")));
torrent.getRelation<TorrentPeer, One>("torrentFiles"));
// BelongsTo relation
QVERIFY_THROWS_EXCEPTION(
RelationNotLoadedError,
(TorrentPeer().getRelation<Torrent, One>("torrent")));
TorrentPeer().getRelation<Torrent, One>("torrent"));
// BelongsToMany relation
QVERIFY_THROWS_EXCEPTION(
RelationNotLoadedError,
(torrent.getRelation<Tag>("tags")));
torrent.getRelation<Tag>("tags"));
}

void tst_Model_Relations::eagerLoad_Failed() const
Expand Down Expand Up @@ -935,8 +935,8 @@ void tst_Model_Relations::with_Vector_MoreRelations() const
// No TorrentPreviewableFileProperty loaded
QVERIFY_THROWS_EXCEPTION(
RuntimeError,
(file->getRelation<TorrentPreviewableFileProperty, One>(
"fileProperty")));
file->getRelation<TorrentPreviewableFileProperty, One>(
"fileProperty"));
}
}

Expand Down

0 comments on commit 8e03b24

Please sign in to comment.