Skip to content

Commit 2017831

Browse files
authored
[clang][Unit Test] Updating Negative Stat Caching Diagnostic Unit Test (#138955)
This PR makes a minor modification to make it more stable. The only change is adding a suffix to the path under test. rdar://149147920
1 parent 850d96e commit 2017831

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ TEST(DependencyScanningFilesystem, DiagnoseStaleStatFailures) {
186186
DependencyScanningFilesystemSharedCache SharedCache;
187187
DependencyScanningWorkerFilesystem DepFS(SharedCache, InMemoryFS);
188188

189-
bool Path1Exists = DepFS.exists("/path1");
189+
bool Path1Exists = DepFS.exists("/path1.suffix");
190190
EXPECT_EQ(Path1Exists, false);
191191

192192
// Adding a file that has been stat-ed,
193-
InMemoryFS->addFile("/path1", 0, llvm::MemoryBuffer::getMemBuffer(""));
194-
Path1Exists = DepFS.exists("/path1");
193+
InMemoryFS->addFile("/path1.suffix", 0, llvm::MemoryBuffer::getMemBuffer(""));
194+
Path1Exists = DepFS.exists("/path1.suffix");
195195
// Due to caching in SharedCache, path1 should not exist in
196196
// DepFS's eyes.
197197
EXPECT_EQ(Path1Exists, false);
@@ -200,5 +200,5 @@ TEST(DependencyScanningFilesystem, DiagnoseStaleStatFailures) {
200200
SharedCache.getInvalidNegativeStatCachedPaths(*InMemoryFS.get());
201201

202202
EXPECT_EQ(InvalidPaths.size(), 1u);
203-
ASSERT_STREQ("/path1", InvalidPaths[0].str().c_str());
203+
ASSERT_STREQ("/path1.suffix", InvalidPaths[0].str().c_str());
204204
}

0 commit comments

Comments
 (0)