From 99e841d140d86e8e3dce56292d253b241260050f Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 26 Aug 2019 16:33:26 +0200 Subject: [PATCH] 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 --- tests/unit/unittest/projectupdater-test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/unittest/projectupdater-test.cpp b/tests/unit/unittest/projectupdater-test.cpp index 1b9f271687d..52e68b308cf 100644 --- a/tests/unit/unittest/projectupdater-test.cpp +++ b/tests/unit/unittest/projectupdater-test.cpp @@ -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});