Skip to content

Commit

Permalink
tests added more QVERIFY
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Aug 21, 2022
1 parent d78b6bc commit 4fd32ed
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,20 +292,26 @@ void tst_Model_Connection_Independent::equalComparison() const
auto torrent1_1 = Torrent::find(1);
auto torrent1_2 = Torrent::find(1);

QVERIFY(torrent1_1);
QVERIFY(torrent1_2);
QVERIFY(*torrent1_1 == *torrent1_2);
}
// Is equal with relations
{
auto torrent1_1 = Torrent::with("torrentFiles")->find(1);
auto torrent1_2 = Torrent::with("torrentFiles")->find(1);

QVERIFY(torrent1_1);
QVERIFY(torrent1_2);
QVERIFY(*torrent1_1 == *torrent1_2);
}
// Is equal with sub-relations
{
auto torrent1_1 = Torrent::with("torrentFiles.fileProperty")->find(1);
auto torrent1_2 = Torrent::with("torrentFiles.fileProperty")->find(1);

QVERIFY(torrent1_1);
QVERIFY(torrent1_2);
QVERIFY(*torrent1_1 == *torrent1_2);
}
}
Expand All @@ -314,13 +320,17 @@ void tst_Model_Connection_Independent::notEqualComparison() const
{
auto torrent1_1 = Torrent::with("torrentFiles.fileProperty")->find(1);
auto torrent2 = Torrent::with("torrentFiles.fileProperty")->find(2);
QVERIFY(torrent1_1);
QVERIFY(torrent2);

// Different torrent
QVERIFY(*torrent1_1 != *torrent2);

// Different attribute
{
auto torrent1_2 = Torrent::with("torrentFiles.fileProperty")->find(1);
QVERIFY(torrent1_2);

// Check before change
QVERIFY(*torrent1_1 == *torrent1_2);

Expand All @@ -331,6 +341,8 @@ void tst_Model_Connection_Independent::notEqualComparison() const
// Different relations
{
auto torrent1_2 = Torrent::with("torrentFiles.fileProperty")->find(1);
QVERIFY(torrent1_2);

// Check before change
QVERIFY(*torrent1_1 == *torrent1_2);

Expand All @@ -341,6 +353,7 @@ void tst_Model_Connection_Independent::notEqualComparison() const
// Different sub-relation
{
auto torrent1_2 = Torrent::with("torrentFiles")->find(1);
QVERIFY(torrent1_2);

QVERIFY(*torrent1_1 != *torrent1_2);
}
Expand Down

0 comments on commit 4fd32ed

Please sign in to comment.