From 4e5dbcbd2bb03adb0f7f520fd4c4c2bfa729cb85 Mon Sep 17 00:00:00 2001 From: PeterPetrik Date: Thu, 28 Sep 2023 11:10:09 +0200 Subject: [PATCH] fix std::bad_function in tests --- app/test/testactiveproject.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/test/testactiveproject.cpp b/app/test/testactiveproject.cpp index 7337d1a0f..1335de0c3 100644 --- a/app/test/testactiveproject.cpp +++ b/app/test/testactiveproject.cpp @@ -49,6 +49,9 @@ void TestActiveProject::testProjectValidations() QCOMPARE( spyErrorsFound.count(), 1 ); QCOMPARE( spyReportIssues.count(), 3 ); // invalid project CRS, invalid layer CRS, missing layer Survey + + const QString id = mApi->localProjectsManager().projectId( projectDir + "/" + projectFilename ); + mApi->localProjectsManager().removeLocalProject( id ); } void TestActiveProject::testProjectLoadFailure() @@ -71,6 +74,9 @@ void TestActiveProject::testProjectLoadFailure() QVERIFY( !activeProject.load( projectdir + "/" + projectfilename ) ); QVERIFY( !activeProject.localProject().isValid() ); QVERIFY( spy.count() ); + + const QString id = mApi->localProjectsManager().projectId( projectdir + "/" + projectdir ); + mApi->localProjectsManager().removeLocalProject( id ); } void TestActiveProject::testPositionTrackingFlag() @@ -97,6 +103,9 @@ void TestActiveProject::testPositionTrackingFlag() QCOMPARE( spy.count(), 1 ); QCOMPARE( activeProject.positionTrackingSupported(), false ); + QString id = mApi->localProjectsManager().projectId( projectDir + "/" + projectName ); + mApi->localProjectsManager().removeLocalProject( id ); + // project "tracking" - tracking enabled projectDir = TestUtils::testDataDir() + "/tracking/"; projectName = "tracking-project.qgz"; @@ -107,4 +116,7 @@ void TestActiveProject::testPositionTrackingFlag() QCOMPARE( spy.count(), 2 ); QCOMPARE( activeProject.positionTrackingSupported(), true ); + + id = mApi->localProjectsManager().projectId( projectDir + "/" + projectName ); + mApi->localProjectsManager().removeLocalProject( id ); }