diff options
Diffstat (limited to 'tests/unit/unittest/symbolindexer-test.cpp')
-rw-r--r-- | tests/unit/unittest/symbolindexer-test.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/unit/unittest/symbolindexer-test.cpp b/tests/unit/unittest/symbolindexer-test.cpp index 2972e2019e..2db11dc5fb 100644 --- a/tests/unit/unittest/symbolindexer-test.cpp +++ b/tests/unit/unittest/symbolindexer-test.cpp @@ -267,7 +267,8 @@ protected: mockProjectPartsStorage, mockModifiedTimeChecker, testEnvironment}; - SymbolIndexerTaskQueue indexerQueue{indexerScheduler, progressCounter}; + NiceMock<MockSqliteDatabase> mockSqliteDatabase; + SymbolIndexerTaskQueue indexerQueue{indexerScheduler, progressCounter, mockSqliteDatabase}; Scheduler indexerScheduler{collectorManger, indexerQueue, progressCounter, @@ -921,6 +922,21 @@ TEST_F(SymbolIndexer, DependentSourceAreUpToDate) indexer.updateProjectParts({projectPart1}); } +TEST_F(SymbolIndexer, SourcesAreWatched) +{ + using ClangBackEnd::IdPaths; + InSequence s; + FilePathIds sourcePathIds{4, 6, 8}; + + EXPECT_CALL(mockBuildDependenciesStorage, fetchSources(projectPart1.projectPartId)) + .WillOnce(Return(sourcePathIds)); + EXPECT_CALL(mockPathWatcher, + updateIdPaths(ElementsAre(AllOf(Field(&IdPaths::id, projectPart1.projectPartId), + Field(&IdPaths::filePathIds, sourcePathIds))))); + + indexer.updateProjectParts({projectPart1}); +} + TEST_F(SymbolIndexer, CallSetNotifier) { EXPECT_CALL(mockPathWatcher, setNotifier(_)); |