Skip to content

Commit

Permalink
Added QAbstractItemModelTester to object list model tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilInTheGaps committed Oct 2, 2023
1 parent 14170bf commit e72df4b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/common/models/testcustomobjectlistmodel.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "models/customobjectlistmodel.h"
#include <QAbstractItemModelTester>
#include <QList>
#include <gtest/gtest.h>

Expand Down Expand Up @@ -122,9 +123,19 @@ TEST_F(CustomObjectListTest, TestOwningModel)
testModel(owningModel);
}

TEST_F(CustomObjectListTest, TestOwningModelUsingAbstractItemModelTester)
{
QAbstractItemModelTester tester(&owningModel, QAbstractItemModelTester::FailureReportingMode::QtTest);
}

TEST_F(CustomObjectListTest, TestNonOwningModel)
{
testModel(nonOwningModel);
}

TEST_F(CustomObjectListTest, TestNonOwningModelUsingAbstractItemModelTester)
{
QAbstractItemModelTester tester(&nonOwningModel, QAbstractItemModelTester::FailureReportingMode::QtTest);
}

#include "testcustomobjectlistmodel.moc"

0 comments on commit e72df4b

Please sign in to comment.