UnitTests: Add return value to mock function

Otherwise we try to get access a negative index. The real implementation
will never return a negative value, so the shouldn't the mock function.

Change-Id: I369e168bd18530b39fa5e2a622a716b30b8b344c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2019-08-26 16:33:26 +02:00
parent bcd9a3dfbd
commit 99e841d140

View File

@@ -316,7 +316,7 @@ TEST_F(ProjectUpdater, ProjectPartIdsPrefetchingInsideTransaction)
settingsManager};
EXPECT_CALL(mockSqliteTransactionBackend, deferredBegin());
EXPECT_CALL(mockProjectPartsStorage, fetchProjectPartIdUnguarded(Eq(projectPartName)));
EXPECT_CALL(mockProjectPartsStorage, fetchProjectPartIdUnguarded(Eq(projectPartName))).WillOnce(Return(1));
EXPECT_CALL(mockSqliteTransactionBackend, commit());
updater.fetchProjectPartIds({&projectPart});