Skip to content
Permalink
Browse files
Add test for attribute table sorting
  • Loading branch information
m-kuhn committed May 16, 2016
1 parent 9080aa1 commit ee533a7
Showing 1 changed file with 32 additions and 0 deletions.
@@ -50,6 +50,8 @@ class TestQgsDualView : public QObject

void testSelectAll();

void testSort();

void testAttributeFormSharedValueScanning();

private:
@@ -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

0 comments on commit ee533a7

Please sign in to comment.