Skip to content

Commit

Permalink
Add test for attribute table sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 16, 2016
1 parent 9080aa1 commit ee533a7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/src/gui/testqgsdualview.cpp
Expand Up @@ -50,6 +50,8 @@ class TestQgsDualView : public QObject

void testSelectAll();

void testSort();

void testAttributeFormSharedValueScanning();

private:
Expand Down Expand Up @@ -141,6 +143,36 @@ void TestQgsDualView::testSelectAll()
QVERIFY( mPointsLayer->selectedFeatureCount() == 1 );
}

void TestQgsDualView::testSort()
{
mDualView->setSortExpression( "Class" );

QStringList classes;
classes << "B52"
<< "B52"
<< "B52"
<< "B52"
<< "Biplane"
<< "Biplane"
<< "Biplane"
<< "Biplane"
<< "Biplane"
<< "Jet"
<< "Jet"
<< "Jet"
<< "Jet"
<< "Jet"
<< "Jet"
<< "Jet"
<< "Jet";

for ( int i = 0; i < classes.length(); ++i )
{
QModelIndex index = mDualView->tableView()->model()->index( i, 0 );
QCOMPARE( mDualView->tableView()->model()->data( index ).toString(), classes.at( i ) );
}
}

void TestQgsDualView::testAttributeFormSharedValueScanning()
{
// test QgsAttributeForm::scanForEqualAttributes
Expand Down

0 comments on commit ee533a7

Please sign in to comment.