Skip to content
Permalink
Browse files

Add unit test for QgsDataDefined copy

  • Loading branch information
vmora authored and nyalldawson committed Apr 21, 2015
1 parent 2fddcaf commit 8cb875546e35bf8249be0f6c86d31e6baf5c5347
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/src/core/testqgsdatadefined.cpp
@@ -34,6 +34,7 @@ class TestQgsDataDefined: public QObject
void init();// will be called before each testfunction is executed.
void cleanup();// will be called after every testfunction.
void create();//test creating a data defined container
void copy();// test cpy destruction (double delete)
void gettersSetters(); //test getters and setters
void defaultValues(); //test hasDefaultValues method
void equality(); //test equality operators
@@ -71,6 +72,15 @@ void TestQgsDataDefined::create()
QCOMPARE( dd->field(), QString( "field" ) );
}

void TestQgsDataDefined::copy()
{
QgsDataDefined dd( true, true, QString( "sqrt(2)" ), QString( "field" ) );
dd.prepareExpression(NULL);
QgsDataDefined cpy( dd );
QgsDataDefined assigned;
assigned = cpy;
}

void TestQgsDataDefined::gettersSetters()
{
QgsDataDefined dd;

0 comments on commit 8cb8755

Please sign in to comment.
You can’t perform that action at this time.