Skip to content

Commit

Permalink
Use one project in test and call QgsProject::clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent authored and nyalldawson committed Jun 21, 2021
1 parent f3c217c commit 479173d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/src/core/testqgsproject.cpp
Expand Up @@ -708,15 +708,14 @@ void TestQgsProject::testDefaultRelativePaths()
s.setValue( QStringLiteral( "/qgis/defaultProjectPathsRelative" ), true );
QgsProject p1;
bool p1PathsAbsolute = p1.readBoolEntry( QStringLiteral( "Paths" ), QStringLiteral( "/Absolute" ), false );

s.setValue( QStringLiteral( "/qgis/defaultProjectPathsRelative" ), false );
QgsProject p2;
bool p2PathsAbsolute = p2.readBoolEntry( QStringLiteral( "Paths" ), QStringLiteral( "/Absolute" ), false );
p1.clear();
bool p1PathsAbsolute_2 = p1.readBoolEntry( QStringLiteral( "Paths" ), QStringLiteral( "/Absolute" ), false );

s.setValue( QStringLiteral( "/qgis/defaultProjectPathsRelative" ), bk_defaultRelativePaths );

QCOMPARE( p1PathsAbsolute, false );
QCOMPARE( p2PathsAbsolute, true );
QCOMPARE( p1PathsAbsolute_2, true );
}

QGSTEST_MAIN( TestQgsProject )
Expand Down

0 comments on commit 479173d

Please sign in to comment.