@@ -45,10 +45,14 @@ class TestQgsRasterFill: public QObject
45
45
private slots:
46
46
void initTestCase ();// will be called before the first testfunction is executed.
47
47
void cleanupTestCase ();// will be called after the last testfunction was executed.
48
- void init () {}; // will be called before each testfunction is executed.
49
- void cleanup () {} ;// will be called after every testfunction.
48
+ void init (); // will be called before each testfunction is executed.
49
+ void cleanup ();// will be called after every testfunction.
50
50
51
51
void rasterFillSymbol ();
52
+ void coordinateMode ();
53
+ void alpha ();
54
+ void offset ();
55
+ void width ();
52
56
53
57
private:
54
58
bool mTestHasError ;
@@ -119,15 +123,61 @@ void TestQgsRasterFill::cleanupTestCase()
119
123
}
120
124
}
121
125
122
- void TestQgsRasterFill::rasterFillSymbol ()
126
+ void TestQgsRasterFill::init ()
123
127
{
124
- mReport += " <h2>Raster fill symbol renderer test</h2>\n " ;
125
128
mRasterFill ->setImageFilePath ( mTestDataDir + QString ( " sample_image.png" ) );
126
129
mRasterFill ->setWidth ( 30.0 );
130
+ mRasterFill ->setWidthUnit ( QgsSymbolV2::Pixel );
131
+ mRasterFill ->setCoordinateMode ( QgsRasterFillSymbolLayer::Feature );
132
+ mRasterFill ->setAlpha ( 1.0 );
133
+ mRasterFill ->setOffset ( QPointF ( 0 , 0 ) );
134
+ }
135
+
136
+ void TestQgsRasterFill::cleanup ()
137
+ {
138
+
139
+ }
140
+
141
+ void TestQgsRasterFill::rasterFillSymbol ()
142
+ {
143
+ mReport += " <h2>Raster fill symbol renderer test</h2>\n " ;
127
144
bool result = imageCheck ( " rasterfill" );
128
145
QVERIFY ( result );
129
146
}
130
147
148
+ void TestQgsRasterFill::coordinateMode ()
149
+ {
150
+ mReport += " <h2>Raster fill viewport mode</h2>\n " ;
151
+ mRasterFill ->setCoordinateMode ( QgsRasterFillSymbolLayer::Viewport );
152
+ bool result = imageCheck ( " rasterfill_viewport" );
153
+ QVERIFY ( result );
154
+ }
155
+
156
+ void TestQgsRasterFill::alpha ()
157
+ {
158
+ mReport += " <h2>Raster fill alpha</h2>\n " ;
159
+ mRasterFill ->setAlpha ( 0.5 );
160
+ bool result = imageCheck ( " rasterfill_alpha" );
161
+ QVERIFY ( result );
162
+ }
163
+
164
+ void TestQgsRasterFill::offset ()
165
+ {
166
+ mReport += " <h2>Raster fill offset</h2>\n " ;
167
+ mRasterFill ->setOffset ( QPointF ( 5 , 10 ) );;
168
+ bool result = imageCheck ( " rasterfill_offset" );
169
+ QVERIFY ( result );
170
+ }
171
+
172
+ void TestQgsRasterFill::width ()
173
+ {
174
+ mReport += " <h2>Raster fill width</h2>\n " ;
175
+ mRasterFill ->setWidthUnit ( QgsSymbolV2::MM );
176
+ mRasterFill ->setWidth ( 5.0 );
177
+ bool result = imageCheck ( " rasterfill_width" );
178
+ QVERIFY ( result );
179
+ }
180
+
131
181
//
132
182
// Private helper functions not called directly by CTest
133
183
//
0 commit comments