| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | /****************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Copyright (C) 2016 The Qt Company Ltd. | 
					
						
							|  |  |  | ** Contact: https://www.qt.io/licensing/
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator. | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Commercial License Usage | 
					
						
							|  |  |  | ** Licensees holding valid commercial Qt licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the commercial license agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and The Qt Company. For licensing terms | 
					
						
							|  |  |  | ** and conditions see https://www.qt.io/terms-conditions. For further
 | 
					
						
							|  |  |  | ** information use the contact form at https://www.qt.io/contact-us.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** GNU General Public License Usage | 
					
						
							|  |  |  | ** Alternatively, this file may be used under the terms of the GNU | 
					
						
							|  |  |  | ** General Public License version 3 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT | 
					
						
							|  |  |  | ** included in the packaging of this file. Please review the following | 
					
						
							|  |  |  | ** information to ensure the GNU General Public License requirements will | 
					
						
							|  |  |  | ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "googletest.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <refactoringdatabaseinitializer.h>
 | 
					
						
							|  |  |  | #include <filepathcaching.h>
 | 
					
						
							|  |  |  | #include <usedmacrosandsourcescollector.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <sqlitedatabase.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QDateTime>
 | 
					
						
							|  |  |  | #include <QDir>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using testing::AllOf; | 
					
						
							|  |  |  | using testing::Contains; | 
					
						
							|  |  |  | using testing::Not; | 
					
						
							|  |  |  | using testing::ElementsAre; | 
					
						
							|  |  |  | using testing::UnorderedElementsAre; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using ClangBackEnd::FilePathId; | 
					
						
							|  |  |  | using ClangBackEnd::FilePathIds; | 
					
						
							|  |  |  | using ClangBackEnd::FilePathView; | 
					
						
							|  |  |  | using ClangBackEnd::SourceDependency; | 
					
						
							|  |  |  | using ClangBackEnd::UsedMacro; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class UsedMacroAndSourcesCollector : public ::testing::Test | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  |     FilePathId filePathId(Utils::SmallStringView filePath) const | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return filePathCache.filePathId(ClangBackEnd::FilePathView{filePath}); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     static off_t fileSize(Utils::SmallStringView filePath) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return QFileInfo(QString(filePath)).size(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |    static std::time_t lastModified(Utils::SmallStringView filePath) | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-09-10 13:13:30 +02:00
										 |  |  |         return QFileInfo(QString(filePath)).lastModified().toSecsSinceEpoch(); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ClangBackEnd::FileStatus fileStatus(Utils::SmallStringView filePath) const | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-02-25 19:07:19 +01:00
										 |  |  |         return {filePathId(filePath), fileSize(filePath), lastModified(filePath)}; | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  |     Sqlite::Database database{":memory:", Sqlite::JournalMode::Memory}; | 
					
						
							|  |  |  |     ClangBackEnd::RefactoringDatabaseInitializer<Sqlite::Database> databaseInitializer{database}; | 
					
						
							|  |  |  |     ClangBackEnd::FilePathCaching filePathCache{database}; | 
					
						
							|  |  |  |     ClangBackEnd::UsedMacroAndSourcesCollector collector{filePathCache}; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, SourceFiles) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceFiles(), | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |                 UnorderedElementsAre(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), | 
					
						
							|  |  |  |                                      filePathId(TESTDATA_DIR "/symbolscollector/header1.h"), | 
					
						
							|  |  |  |                                      filePathId(TESTDATA_DIR "/symbolscollector/header2.h"))); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, MainFileInSourceFiles) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceFiles(), | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |                 ElementsAre(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"))); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, ResetMainFileInSourceFiles) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceFiles(), | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |                 ElementsAre(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"))); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, DontDuplicateSourceFiles) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceFiles(), | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |                 UnorderedElementsAre(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), | 
					
						
							|  |  |  |                                      filePathId(TESTDATA_DIR "/symbolscollector/header1.h"), | 
					
						
							|  |  |  |                                      filePathId(TESTDATA_DIR "/symbolscollector/header2.h"))); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, ClearSourceFiles) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     collector.clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceFiles(), IsEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, ClearFileStatus) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.fileStatuses(), IsEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, ClearUsedMacros) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/defines.h"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.usedMacros(), IsEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, ClearSourceDependencies) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main2.cpp"), {"cc", "-I" TESTDATA_DIR}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceDependencies(), IsEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, DontCollectSourceFilesAfterFilesAreCleared) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     collector.clear(); | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceFiles(), IsEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, DontCollectFileStatusAfterFilesAreCleared) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     collector.clear(); | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.fileStatuses(), IsEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, DontCollectUsedMacrosAfterFilesAreCleared) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     collector.clear(); | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.usedMacros(), IsEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, DontCollectSourceDependenciesAfterFilesAreCleared) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     collector.clear(); | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceDependencies(), IsEmpty()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, CollectUsedMacrosWithExternalDefine) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     auto fileId = filePathId(TESTDATA_DIR "/symbolscollector/defines.h"); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.addFile(fileId, {"cc", "-DCOMPILER_ARGUMENT"}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.usedMacros(), | 
					
						
							|  |  |  |                 ElementsAre(Eq(UsedMacro{"DEFINED", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"IF_DEFINE", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"__clang__", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"CLASS_EXPORT", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"IF_NOT_DEFINE", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"MACRO_EXPANSION", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"COMPILER_ARGUMENT", fileId}))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, CollectUsedMacrosWithoutExternalDefine) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     auto fileId = filePathId(TESTDATA_DIR "/symbolscollector/defines.h"); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.addFile(fileId, {"cc"}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.usedMacros(), | 
					
						
							|  |  |  |                 ElementsAre(Eq(UsedMacro{"DEFINED", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"IF_DEFINE", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"__clang__", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"CLASS_EXPORT", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"IF_NOT_DEFINE", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"MACRO_EXPANSION", fileId}), | 
					
						
							|  |  |  |                             Eq(UsedMacro{"COMPILER_ARGUMENT", fileId}))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, DontCollectHeaderGuards) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     auto fileId = filePathId(TESTDATA_DIR "/symbolscollector/defines.h"); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.addFile(fileId, {"cc"}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.usedMacros(), | 
					
						
							|  |  |  |                 Not(Contains(Eq(UsedMacro{"SYMBOLSCOLLECTOR_DEFINES_H", fileId})))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, DISABLED_DontCollectDynamicLibraryExports) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     auto fileId = filePathId(TESTDATA_DIR "/symbolscollector/defines.h"); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.addFile(fileId, {"cc"}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.usedMacros(), | 
					
						
							|  |  |  |                 Not(Contains(Eq(UsedMacro{"CLASS_EXPORT", fileId})))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, CollectFileStatuses) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     collector.addFile(filePathId(TESTDATA_DIR "/symbolscollector/main.cpp"), {"cc"}); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.fileStatuses(), | 
					
						
							|  |  |  |                 ElementsAre( | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |                     fileStatus(TESTDATA_DIR "/symbolscollector/main.cpp"), | 
					
						
							|  |  |  |                     fileStatus(TESTDATA_DIR "/symbolscollector/header1.h"), | 
					
						
							|  |  |  |                     fileStatus(TESTDATA_DIR "/symbolscollector/header2.h"))); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEST_F(UsedMacroAndSourcesCollector, CollectSourceDependencies) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-02-07 12:20:39 +01:00
										 |  |  |     auto mainFileId = filePathId(TESTDATA_DIR "/symbolscollector/main2.cpp"); | 
					
						
							|  |  |  |     auto header1FileId = filePathId(TESTDATA_DIR "/symbolscollector/header1.h"); | 
					
						
							|  |  |  |     auto header2FileId = filePathId(TESTDATA_DIR "/symbolscollector/header2.h"); | 
					
						
							|  |  |  |     auto header3FileId = filePathId(TESTDATA_DIR "/symbolscollector/header3.h"); | 
					
						
							| 
									
										
										
										
											2018-10-09 17:50:29 +02:00
										 |  |  |     collector.addFile(mainFileId, {"cc", "-I" TESTDATA_DIR}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     collector.collect(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     ASSERT_THAT(collector.sourceDependencies(), | 
					
						
							|  |  |  |                 UnorderedElementsAre(SourceDependency(mainFileId, header1FileId), | 
					
						
							|  |  |  |                                      SourceDependency(mainFileId, header3FileId), | 
					
						
							|  |  |  |                                      SourceDependency(header3FileId, header2FileId), | 
					
						
							|  |  |  |                                      SourceDependency(header1FileId, header2FileId))); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | } |