Skip to content

Commit 306d1a4

Browse files
committedNov 14, 2011
Make more tests work - only 4/16 fail now
1 parent 8dc8222 commit 306d1a4

6 files changed

+73
-93
lines changed
 

‎tests/src/core/testqgsrenderers.cpp

+2-15
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class TestQgsRenderers: public QObject
4949
void uniqueValue();
5050
void graduatedSymbol();
5151
void continuousSymbol();
52-
void checkClassificationFieldMismatch();
5352
private:
5453
bool mTestHasError;
5554
bool setQml( QString theType ); //uniquevalue / continuous / single /
@@ -68,7 +67,8 @@ void TestQgsRenderers::initTestCase()
6867
mTestHasError = false;
6968
// init QGIS's paths - true means that all path will be inited from prefix
7069
QString qgisPath = QCoreApplication::applicationDirPath();
71-
QgsApplication::setPrefixPath( INSTALL_PREFIX, true );
70+
QgsApplication::init( INSTALL_PREFIX );
71+
QgsApplication::initQgis( );
7272
QgsApplication::showSettings();
7373
// Instantiate the plugin directory so that providers are loaded
7474
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
@@ -167,19 +167,6 @@ void TestQgsRenderers::continuousSymbol()
167167
QVERIFY( imageCheck( "continuous" ) );
168168
}
169169

170-
void TestQgsRenderers::checkClassificationFieldMismatch()
171-
{
172-
mReport += "<h2>Classification field mismatch test</h2>\n";
173-
// Here we test to see that a qml created for one layer
174-
// will raise an error properly if the
175-
// We will do this by trying to apply the points qml to the polys shpfile
176-
// it should fail and raise an error
177-
QString myFileName = mTestDataDir + "points_continuous_symbol.qml";
178-
bool myStyleFlag = false;
179-
mpPolysLayer->loadNamedStyle( myFileName, myStyleFlag );
180-
QVERIFY( !myStyleFlag ); //we are expecting this to have raised an error
181-
}
182-
183170
//
184171
// Private helper functions not called directly by CTest
185172
//
-887 Bytes
Loading

‎tests/testdata/expected_graduated.png

-1.67 KB
Loading

‎tests/testdata/expected_single.png

3.6 KB
Loading
4.18 KB
Loading
+71-78
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,73 @@
11
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
2-
<qgis version="0.9.2-Ganymede" minimumScale="1" maximumScale="1e+08" hasScaleBasedVisibilityFlag="0" geometry="Polygon" type="vector" >
3-
<id>polys20080110101725465</id>
4-
<datasource>/Users/timlinux/dev/cpp/qgis_qml/tests/testdata/polys.shp</datasource>
5-
<layername>polys</layername>
6-
<srs>
7-
<spatialrefsys>
8-
<proj4>+proj=longlat +ellps=WGS84 +no_defs</proj4>
9-
<srsid>1449</srsid>
10-
<srid>4031</srid>
11-
<epsg>4031</epsg>
12-
<description>Unknown datum based upon the GEM 10C ellipsoid</description>
13-
<projectionacronym>longlat</projectionacronym>
14-
<ellipsoidacronym>WGS84</ellipsoidacronym>
15-
<geographicflag>true</geographicflag>
16-
</spatialrefsys>
17-
</srs>
18-
<transparencyLevelInt>255</transparencyLevelInt>
19-
<provider>ogr</provider>
20-
<encoding>System</encoding>
21-
<classificationattribute>Value</classificationattribute>
22-
<displayfield>Name</displayfield>
23-
<label>0</label>
24-
<attributeactions/>
25-
<continuoussymbol>
26-
<classificationfield>Value</classificationfield>
27-
<polygonoutline>1</polygonoutline>
28-
<lowestsymbol>
29-
<symbol>
30-
<lowervalue>7.000000</lowervalue>
31-
<uppervalue></uppervalue>
32-
<label></label>
33-
<pointsymbol>hard:circle</pointsymbol>
34-
<pointsize>11</pointsize>
35-
<rotationclassificationfield>-1</rotationclassificationfield>
36-
<scaleclassificationfield>-1</scaleclassificationfield>
37-
<outlinecolor red="0" blue="0" green="0" />
38-
<outlinestyle>SolidLine</outlinestyle>
39-
<outlinewidth>0.4</outlinewidth>
40-
<fillcolor red="94" blue="213" green="172" />
41-
<fillpattern>SolidPattern</fillpattern>
42-
<texturepath></texturepath>
43-
</symbol>
44-
</lowestsymbol>
45-
<highestsymbol>
46-
<symbol>
47-
<lowervalue>20.000000</lowervalue>
48-
<uppervalue></uppervalue>
49-
<label></label>
50-
<pointsymbol>hard:circle</pointsymbol>
51-
<pointsize>11</pointsize>
52-
<rotationclassificationfield>-1</rotationclassificationfield>
53-
<scaleclassificationfield>-1</scaleclassificationfield>
54-
<outlinecolor red="0" blue="0" green="0" />
55-
<outlinestyle>SolidLine</outlinestyle>
56-
<outlinewidth>0.4</outlinewidth>
57-
<fillcolor red="59" blue="134" green="49" />
58-
<fillpattern>SolidPattern</fillpattern>
59-
<texturepath></texturepath>
60-
</symbol>
61-
</highestsymbol>
62-
</continuoussymbol>
63-
<labelattributes>
64-
<label field="" text="Label" />
65-
<family field="" name="Lucida Grande" />
66-
<size field="" units="pt" value="12" />
67-
<bold field="" on="0" />
68-
<italic field="" on="0" />
69-
<underline field="" on="0" />
70-
<color field="" red="0" blue="0" green="0" />
71-
<x field="" />
72-
<y field="" />
73-
<offset x="0" y="0" yfield="-1" xfield="-1" units="pt" />
74-
<angle field="" value="0" />
75-
<alignment field="-1" value="center" />
76-
<buffercolor field="" red="255" blue="255" green="255" />
77-
<buffersize field="" units="pt" value="1" />
78-
<bufferenabled field="" on="" />
79-
</labelattributes>
2+
<qgis version="1.9.90-Alpha" minimumScale="1" maximumScale="1e+08" minLabelScale="1" maxLabelScale="1e+08" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">
3+
<transparencyLevelInt>227</transparencyLevelInt>
4+
<classificationattribute>Name</classificationattribute>
5+
<uniquevalue>
6+
<classificationfield>Name</classificationfield>
7+
<symbol>
8+
<lowervalue>Dam</lowervalue>
9+
<uppervalue></uppervalue>
10+
<label>Dam</label>
11+
<pointsymbol>hard:circle</pointsymbol>
12+
<pointsize>11</pointsize>
13+
<pointsizeunits>pixels</pointsizeunits>
14+
<rotationclassificationfieldname></rotationclassificationfieldname>
15+
<scaleclassificationfieldname></scaleclassificationfieldname>
16+
<symbolfieldname></symbolfieldname>
17+
<outlinecolor red="159" blue="159" green="159"/>
18+
<outlinestyle>SolidLine</outlinestyle>
19+
<outlinewidth>2</outlinewidth>
20+
<fillcolor red="27" blue="212" green="54"/>
21+
<fillpattern>Dense4Pattern</fillpattern>
22+
<texturepath></texturepath>
23+
</symbol>
24+
<symbol>
25+
<lowervalue>Lake</lowervalue>
26+
<uppervalue></uppervalue>
27+
<label>Lake</label>
28+
<pointsymbol>hard:circle</pointsymbol>
29+
<pointsize>11</pointsize>
30+
<pointsizeunits>pixels</pointsizeunits>
31+
<rotationclassificationfieldname></rotationclassificationfieldname>
32+
<scaleclassificationfieldname></scaleclassificationfieldname>
33+
<symbolfieldname></symbolfieldname>
34+
<outlinecolor red="144" blue="144" green="144"/>
35+
<outlinestyle>SolidLine</outlinestyle>
36+
<outlinewidth>1</outlinewidth>
37+
<fillcolor red="110" blue="217" green="194"/>
38+
<fillpattern>SolidPattern</fillpattern>
39+
<texturepath></texturepath>
40+
</symbol>
41+
</uniquevalue>
42+
<customproperties/>
43+
<displayfield>Name</displayfield>
44+
<label>0</label>
45+
<labelattributes>
46+
<label fieldname="" text="Label"/>
47+
<family fieldname="" name="Lucida Grande"/>
48+
<size fieldname="" units="pt" value="12"/>
49+
<bold fieldname="" on="0"/>
50+
<italic fieldname="" on="0"/>
51+
<underline fieldname="" on="0"/>
52+
<strikeout fieldname="" on="0"/>
53+
<color fieldname="" red="0" blue="0" green="0"/>
54+
<x fieldname=""/>
55+
<y fieldname=""/>
56+
<offset x="0" y="0" units="pt" yfieldname="" xfieldname=""/>
57+
<angle fieldname="" value="0" auto="0"/>
58+
<alignment fieldname="" value="center"/>
59+
<buffercolor fieldname="" red="255" blue="255" green="255"/>
60+
<buffersize fieldname="" units="pt" value="1"/>
61+
<bufferenabled fieldname="" on=""/>
62+
<multilineenabled fieldname="" on=""/>
63+
<selectedonly on=""/>
64+
</labelattributes>
65+
<edittypes>
66+
<edittype type="0" name="Name"/>
67+
<edittype type="0" name="Value"/>
68+
</edittypes>
69+
<editform></editform>
70+
<editforminit></editforminit>
71+
<annotationform></annotationform>
72+
<attributeactions/>
8073
</qgis>

0 commit comments

Comments
 (0)
Please sign in to comment.