Skip to content
Permalink
Browse files

Invalid CRS instances should be equal

  • Loading branch information
wonder-sk committed Mar 25, 2014
1 parent c69f2e1 commit af9da1deb4e66608c6c2e879cda18b638679299a
@@ -1130,7 +1130,8 @@ long QgsCoordinateReferenceSystem::findMatchingProj()

bool QgsCoordinateReferenceSystem::operator==( const QgsCoordinateReferenceSystem &theSrs ) const
{
return mIsValidFlag && theSrs.mIsValidFlag && theSrs.authid() == authid();
return ( !mIsValidFlag && !theSrs.mIsValidFlag ) ||
( mIsValidFlag && theSrs.mIsValidFlag && theSrs.authid() == authid() );
}

bool QgsCoordinateReferenceSystem::operator!=( const QgsCoordinateReferenceSystem &theSrs ) const
@@ -49,6 +49,7 @@ class TestQgsCoordinateReferenceSystem: public QObject
void validate();
void equality();
void noEquality();
void equalityInvalid();
void readXML();
void writeXML();
void setCustomSrsValidation();
@@ -312,6 +313,12 @@ void TestQgsCoordinateReferenceSystem::noEquality()
debugPrint( myCrs );
QVERIFY( myCrs != myCrs2 );
}
void TestQgsCoordinateReferenceSystem::equalityInvalid()
{
QgsCoordinateReferenceSystem invalidCrs1;
QgsCoordinateReferenceSystem invalidCrs2;
QVERIFY( invalidCrs1 == invalidCrs2 );
}
void TestQgsCoordinateReferenceSystem::readXML()
{
//QgsCoordinateReferenceSystem myCrs;

0 comments on commit af9da1d

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