Skip to content

[clang][Unit Test] Updating Negative Stat Caching Diagnostic Unit Test #138955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025

Conversation

qiongsiwu
Copy link
Contributor

@qiongsiwu qiongsiwu commented May 7, 2025

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

@llvmbot llvmbot added the clang Clang issues not falling into any other category label May 7, 2025
@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/pr-subscribers-clang

Author: Qiongsi Wu (qiongsiwu)

Changes

This PR makes a minor modification to make it more stable. The only change is adding a suffix to the path under test.


Full diff: https://github.com/llvm/llvm-project/pull/138955.diff

1 Files Affected:

  • (modified) clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp (+4-4)
diff --git a/clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp b/clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp
index 5ea8d02353dc3..aed793785f7b1 100644
--- a/clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp
+++ b/clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp
@@ -186,12 +186,12 @@ TEST(DependencyScanningFilesystem, DiagnoseStaleStatFailures) {
   DependencyScanningFilesystemSharedCache SharedCache;
   DependencyScanningWorkerFilesystem DepFS(SharedCache, InMemoryFS);
 
-  bool Path1Exists = DepFS.exists("/path1");
+  bool Path1Exists = DepFS.exists("/path1.suffix");
   EXPECT_EQ(Path1Exists, false);
 
   // Adding a file that has been stat-ed,
-  InMemoryFS->addFile("/path1", 0, llvm::MemoryBuffer::getMemBuffer(""));
-  Path1Exists = DepFS.exists("/path1");
+  InMemoryFS->addFile("/path1.suffix", 0, llvm::MemoryBuffer::getMemBuffer(""));
+  Path1Exists = DepFS.exists("/path1.suffix");
   // Due to caching in SharedCache, path1 should not exist in
   // DepFS's eyes.
   EXPECT_EQ(Path1Exists, false);
@@ -200,5 +200,5 @@ TEST(DependencyScanningFilesystem, DiagnoseStaleStatFailures) {
       SharedCache.getInvalidNegativeStatCachedPaths(*InMemoryFS.get());
 
   EXPECT_EQ(InvalidPaths.size(), 1u);
-  ASSERT_STREQ("/path1", InvalidPaths[0].str().c_str());
+  ASSERT_STREQ("/path1.suffix", InvalidPaths[0].str().c_str());
 }

@qiongsiwu qiongsiwu merged commit 2017831 into llvm:main May 8, 2025
13 checks passed
qiongsiwu added a commit to qiongsiwu/llvm-project that referenced this pull request May 14, 2025
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants