File tree 2 files changed +9
-6
lines changed 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,5 @@ clang_target_link_libraries(BasicTests
18
18
clangAST
19
19
clangBasic
20
20
clangLex
21
+ LLVMTestingSupport
21
22
)
Original file line number Diff line number Diff line change 12
12
#include " llvm/ADT/STLExtras.h"
13
13
#include " llvm/Support/Path.h"
14
14
#include " llvm/Support/VirtualFileSystem.h"
15
+ #include " llvm/Testing/Support/Error.h"
15
16
#include " gtest/gtest.h"
16
17
17
18
using namespace llvm ;
@@ -559,9 +560,10 @@ TEST_F(FileManagerTest, getBypassFile) {
559
560
560
561
// Calling a second time should not affect the UID or size.
561
562
unsigned VirtualUID = FE.getUID ();
562
- EXPECT_EQ (
563
- &FE,
564
- &expectedToOptional (Manager.getFileRef (" /tmp/test" ))->getFileEntry ());
563
+ llvm::Optional<FileEntryRef> SearchRef;
564
+ ASSERT_THAT_ERROR (Manager.getFileRef (" /tmp/test" ).moveInto (SearchRef),
565
+ Succeeded ());
566
+ EXPECT_EQ (&FE, &SearchRef->getFileEntry ());
565
567
EXPECT_EQ (FE.getUID (), VirtualUID);
566
568
EXPECT_EQ (FE.getSize (), 10 );
567
569
@@ -578,9 +580,9 @@ TEST_F(FileManagerTest, getBypassFile) {
578
580
EXPECT_NE (BypassRef->getSize (), FE.getSize ());
579
581
580
582
// The virtual file should still be returned when searching.
581
- EXPECT_EQ (
582
- &FE,
583
- & expectedToOptional (Manager. getFileRef ( " /tmp/test " )) ->getFileEntry ());
583
+ ASSERT_THAT_ERROR (Manager. getFileRef ( " /tmp/test " ). moveInto (SearchRef),
584
+ Succeeded ());
585
+ EXPECT_EQ (&FE, &SearchRef ->getFileEntry ());
584
586
}
585
587
586
588
} // anonymous namespace
You can’t perform that action at this time.
0 commit comments