From 4197ec4e96213c7e7fe626de4fc2dddff27f5f09 Mon Sep 17 00:00:00 2001 From: silverqx Date: Sun, 21 Aug 2022 14:38:35 +0200 Subject: [PATCH] tests used Model::operator== in some tests - removed todo tasks --- .../tst_relations_inserting_updating.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/auto/functional/orm/tiny/relations_insrt_updt/tst_relations_inserting_updating.cpp b/tests/auto/functional/orm/tiny/relations_insrt_updt/tst_relations_inserting_updating.cpp index 21865b157..79865a9d7 100644 --- a/tests/auto/functional/orm/tiny/relations_insrt_updt/tst_relations_inserting_updating.cpp +++ b/tests/auto/functional/orm/tiny/relations_insrt_updt/tst_relations_inserting_updating.cpp @@ -1361,7 +1361,7 @@ void tst_Relations_Inserting_Updating::associate_WithModel() const QVERIFY(verifyTorrent5->exists); QCOMPARE(typeid (Torrent *), typeid (verifyTorrent5)); QVERIFY(verifyTorrent5->is(torrent)); - // TEST ideal place for comparing models, verifyTorrent5 == torrent, have to have the same attribtues silverqx + QVERIFY(torrent == *verifyTorrent5); file.save(); @@ -1371,7 +1371,7 @@ void tst_Relations_Inserting_Updating::associate_WithModel() const QVERIFY(verifyTorrent5->exists); QCOMPARE(typeid (Torrent *), typeid (verifyTorrent5)); QVERIFY(verifyTorrent5->is(torrent)); - // TEST ideal place for comparing models, verifyTorrent5 == torrent, have to have the same attribtues silverqx + QVERIFY(torrent == *verifyTorrent5); // Obtain file from the database and verify saved values auto verifyFile = TorrentPreviewableFile::find(file[ID]); @@ -1472,7 +1472,7 @@ void tst_Relations_Inserting_Updating::associate_WithId_ShouldUnsetRelation() co QVERIFY(verifyTorrent5->exists); QCOMPARE(typeid (Torrent *), typeid (verifyTorrent5)); QVERIFY(verifyTorrent5->is(torrent)); - // TEST ideal place for comparing models, verifyTorrent5 == torrent, have to have the same attribtues silverqx + QVERIFY(torrent == *verifyTorrent5); /* Have to unset current relationship, this is clearly visible in the Eqloquent's associate implementation. */ @@ -1527,6 +1527,7 @@ void tst_Relations_Inserting_Updating::dissociate() const QVERIFY(verifyTorrent5->exists); QCOMPARE(typeid (Torrent *), typeid (verifyTorrent5)); QVERIFY(verifyTorrent5->is(torrent)); + QVERIFY(torrent == *verifyTorrent5); auto &fileRefDissociate = file.torrent()->dissociate();