File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2945,6 +2945,7 @@ const QgsRasterBandStats QgsRasterLayer::getRasterBandStats(int theBandNoInt)
2945
2945
myFirstIterationFlag = false ;
2946
2946
myRasterBandStats.minValDouble = myDouble;
2947
2947
myRasterBandStats.maxValDouble = myDouble;
2948
+ ++myRasterBandStats.elementCountInt ;
2948
2949
} // end of true part for first iteration check
2949
2950
else
2950
2951
{
Original file line number Diff line number Diff line change 24
24
25
25
// qgis includes...
26
26
#include < qgsrasterlayer.h>
27
+ #include < qgsrasterbandstats.h>
27
28
#include < qgsapplication.h>
28
29
29
30
/* * \ingroup UnitTests
@@ -39,7 +40,7 @@ class TestQgsRasterLayer: public QObject
39
40
void cleanup (){};// will be called after every testfunction.
40
41
41
42
void isValid ();
42
-
43
+ void checkDimensions ();
43
44
private:
44
45
QgsRasterLayer * mpLayer;
45
46
};
@@ -71,6 +72,14 @@ void TestQgsRasterLayer::isValid()
71
72
{
72
73
QVERIFY ( mpLayer->isValid () );
73
74
}
75
+ void TestQgsRasterLayer::checkDimensions ()
76
+ {
77
+ QVERIFY ( mpLayer->getRasterXDim () == 10 );
78
+ QVERIFY ( mpLayer->getRasterYDim () == 10 );
79
+ // regression check for ticket #832
80
+ // note getRasterBandStats call is base 1
81
+ QVERIFY ( mpLayer->getRasterBandStats (1 ).elementCountInt == 100 );
82
+ }
74
83
75
84
QTEST_MAIN (TestQgsRasterLayer)
76
85
#include " moc_testqgsrasterlayer.cxx"
You can’t perform that action at this time.
0 commit comments