[PATCH] D45807: [libclang] Fix test LibclangReparseTest.FileName when TMPDIR is set to a symbolic link

Phabricator via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 21 07:38:34 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC330507: [libclang] Fix LibclangReparseTest.FileName when TMPDIR is set to a symlink (authored by petr.pavlu, committed by ).

Repository:
  rC Clang

https://reviews.llvm.org/D45807

Files:
  unittests/libclang/LibclangTest.cpp


Index: unittests/libclang/LibclangTest.cpp
===================================================================
--- unittests/libclang/LibclangTest.cpp
+++ unittests/libclang/LibclangTest.cpp
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang-c/Index.h"
+#include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
@@ -490,11 +491,11 @@
   CXFile cxf = clang_getFile(ClangTU, CppName.c_str());
 
   CXString cxname = clang_getFileName(cxf);
-  ASSERT_TRUE(strstr(clang_getCString(cxname), CppName.c_str()));
+  ASSERT_STREQ(clang_getCString(cxname), CppName.c_str());
   clang_disposeString(cxname);
 
   cxname = clang_File_tryGetRealPathName(cxf);
-  ASSERT_TRUE(strstr(clang_getCString(cxname), CppName.c_str()));
+  ASSERT_TRUE(llvm::StringRef(clang_getCString(cxname)).endswith("main.cpp"));
   clang_disposeString(cxname);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45807.143451.patch
Type: text/x-patch
Size: 974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180421/98d7d783/attachment.bin>


More information about the cfe-commits mailing list