From 9ed8bb474d21af6610b1fbf8dec0bcb02322cf57 Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Tue, 5 Nov 2024 11:04:25 -0300 Subject: [PATCH] fixing code layout --- app/test/testmerginapi.cpp | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/test/testmerginapi.cpp b/app/test/testmerginapi.cpp index 4d76c17d4..1ba8ff113 100644 --- a/app/test/testmerginapi.cpp +++ b/app/test/testmerginapi.cpp @@ -2945,34 +2945,34 @@ void TestMerginApi::testParseVersion() void TestMerginApi::testDownloadWithNetworkError() { - QString projectName = "testDownloadWithNetworkError"; - QString projectNamespace = mWorkspaceName; + QString projectName = "testDownloadWithNetworkError"; + QString projectNamespace = mWorkspaceName; - // Create a test project on server - createRemoteProject( mApiExtra, projectNamespace, projectName, mTestDataPath + "/" + TEST_PROJECT_NAME + "/" ); + // Create a test project on server + createRemoteProject( mApiExtra, projectNamespace, projectName, mTestDataPath + "/" + TEST_PROJECT_NAME + "/" ); - // Create mock network manager - MockNetworkManager *mockManager = new MockNetworkManager( mApi ); - mApi->setNetworkManager( mockManager ); + // Create mock network manager + MockNetworkManager *mockManager = new MockNetworkManager( mApi ); + mApi->setNetworkManager( mockManager ); - // Track retry signals - QSignalSpy retrySpy( mApi, &MerginApi::downloadItemRetried ); + // Track retry signals + QSignalSpy retrySpy( mApi, &MerginApi::downloadItemRetried ); - // Start download and make network fail after project info - mApi->pullProject( projectNamespace, projectName ); + // Start download and make network fail after project info + mApi->pullProject( projectNamespace, projectName ); - QSignalSpy pullStartedSpy( mApi, &MerginApi::pullFilesStarted ); - QVERIFY( pullStartedSpy.wait( TestUtils::SHORT_REPLY ) ); - mockManager->setShouldFail( true ); + QSignalSpy pullStartedSpy( mApi, &MerginApi::pullFilesStarted ); + QVERIFY( pullStartedSpy.wait( TestUtils::SHORT_REPLY ) ); + mockManager->setShouldFail( true ); - // Wait for sync to finish - QSignalSpy syncFinishedSpy( mApi, &MerginApi::syncProjectFinished ); - QVERIFY( syncFinishedSpy.wait( TestUtils::LONG_REPLY ) ); + // Wait for sync to finish + QSignalSpy syncFinishedSpy( mApi, &MerginApi::syncProjectFinished ); + QVERIFY( syncFinishedSpy.wait( TestUtils::LONG_REPLY ) ); - // Verify we got retry signals - QVERIFY( retrySpy.count() > 0 ); + // Verify we got retry signals + QVERIFY( retrySpy.count() > 0 ); - // Cleanup - mApi->setNetworkManager( new QNetworkAccessManager( mApi ) ); - deleteRemoteProjectNow( mApi, projectNamespace, projectName ); + // Cleanup + mApi->setNetworkManager( new QNetworkAccessManager( mApi ) ); + deleteRemoteProjectNow( mApi, projectNamespace, projectName ); }