Skip to content

Commit 4c2536c

Browse files
committed
[clang][Unit Test] Updating Negative Stat Caching Diagnostic Unit Test (llvm#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 (cherry picked from commit 2017831)
1 parent da26ac3 commit 4c2536c

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
@@ -154,12 +154,12 @@ TEST(DependencyScanningFilesystem, DiagnoseStaleStatFailures) {
154154
DependencyScanningFilesystemSharedCache SharedCache;
155155
DependencyScanningWorkerFilesystem DepFS(SharedCache, InMemoryFS);
156156

157-
bool Path1Exists = DepFS.exists("/path1");
157+
bool Path1Exists = DepFS.exists("/path1.suffix");
158158
EXPECT_EQ(Path1Exists, false);
159159

160160
// Adding a file that has been stat-ed,
161-
InMemoryFS->addFile("/path1", 0, llvm::MemoryBuffer::getMemBuffer(""));
162-
Path1Exists = DepFS.exists("/path1");
161+
InMemoryFS->addFile("/path1.suffix", 0, llvm::MemoryBuffer::getMemBuffer(""));
162+
Path1Exists = DepFS.exists("/path1.suffix");
163163
// Due to caching in SharedCache, path1 should not exist in
164164
// DepFS's eyes.
165165
EXPECT_EQ(Path1Exists, false);
@@ -168,5 +168,5 @@ TEST(DependencyScanningFilesystem, DiagnoseStaleStatFailures) {
168168
SharedCache.getInvalidNegativeStatCachedPaths(*InMemoryFS.get());
169169

170170
EXPECT_EQ(InvalidPaths.size(), 1u);
171-
ASSERT_STREQ("/path1", InvalidPaths[0].str().c_str());
171+
ASSERT_STREQ("/path1.suffix", InvalidPaths[0].str().c_str());
172172
}

0 commit comments

Comments
 (0)