diff --git a/tests/unit/unittest/symbolindexer-test.cpp b/tests/unit/unittest/symbolindexer-test.cpp index 8940442ce4f..09088ec637e 100644 --- a/tests/unit/unittest/symbolindexer-test.cpp +++ b/tests/unit/unittest/symbolindexer-test.cpp @@ -57,7 +57,11 @@ using ClangBackEnd::SymbolType; class SymbolIndexer : public testing::Test { protected: - void SetUp(); + void SetUp() + { + ON_CALL(mockCollector, symbols()).WillByDefault(ReturnRef(symbolEntries)); + ON_CALL(mockCollector, sourceLocations()).WillByDefault(ReturnRef(sourceLocations)); + } protected: PathString main1Path = TESTDATA_DIR "/includecollector_main3.cpp"; @@ -163,11 +167,5 @@ TEST_F(SymbolIndexer, UpdateProjectPartsCallsInOrder) indexer.updateProjectParts({projectPart1}, Utils::clone(unsaved)); } -void SymbolIndexer::SetUp() -{ - ON_CALL(mockCollector, symbols()).WillByDefault(ReturnRef(symbolEntries)); - ON_CALL(mockCollector, sourceLocations()).WillByDefault(ReturnRef(sourceLocations)); -} } -