reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

unittests/Support/VirtualFileSystemTest.cpp
  957   auto Stat = FS.status("/a");
  958   ASSERT_EQ(Stat.getError(), errc::no_such_file_or_directory) << FS.toString();
  959   Stat = FS.status("/");
  960   ASSERT_EQ(Stat.getError(), errc::no_such_file_or_directory) << FS.toString();
  964   FS.addFile("c:/windows/system128/foo.cpp", 0, MemoryBuffer::getMemBuffer(""));
  965   auto Stat = FS.status("c:");
  967   ASSERT_FALSE(Stat.getError()) << Stat.getError() << FS.toString();
  969   Stat = FS.status("c:/windows/system128/foo.cpp");
  970   ASSERT_FALSE(Stat.getError()) << Stat.getError() << FS.toString();
  971   FS.addFile("d:/windows/foo.cpp", 0, MemoryBuffer::getMemBuffer(""));
  972   Stat = FS.status("d:/windows/foo.cpp");
  973   ASSERT_FALSE(Stat.getError()) << Stat.getError() << FS.toString();
  977   FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("a"));
  979   auto Stat = FS.status("/");
  980   ASSERT_FALSE(Stat.getError()) << Stat.getError() << FS.toString();
  981   Stat = FS.status("/.");
  984   ASSERT_FALSE(Stat.getError()) << Stat.getError() << FS.toString();
  985   Stat = FS.status("/a");
  986   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
  992   FS.addFileNoOwn("/a", 0, Buf.get());
  993   auto Stat = FS.status("/a");
  994   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
  999   FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("a"));
 1000   FS.addFile("././c", 0, MemoryBuffer::getMemBuffer("c"));
 1001   FS.addFile("./d/../d", 0, MemoryBuffer::getMemBuffer("d"));
 1005   auto File = FS.openFileForRead("/a");
 1007   File = FS.openFileForRead("/a"); // Open again.
 1011   File = FS.openFileForRead("/");
 1012   ASSERT_EQ(File.getError(), errc::invalid_argument) << FS.toString();
 1013   File = FS.openFileForRead("/b");
 1014   ASSERT_EQ(File.getError(), errc::no_such_file_or_directory) << FS.toString();
 1015   File = FS.openFileForRead("./c");
 1017   File = FS.openFileForRead("e/../d");
 1026   ASSERT_TRUE(FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("a")));
 1027   ASSERT_FALSE(FS.addFile("/a/b", 0, MemoryBuffer::getMemBuffer("a")));
 1028   ASSERT_TRUE(FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("a")));
 1029   ASSERT_FALSE(FS.addFile("/a", 0, MemoryBuffer::getMemBuffer("b")));
 1033   FS.addFile("/a", 0, MemoryBuffer::getMemBuffer(""));
 1034   FS.addFile("/b/c", 0, MemoryBuffer::getMemBuffer(""));
 1037   vfs::directory_iterator I = FS.dir_begin("/", EC);
 1047   I = FS.dir_begin("/b", EC);
 1058   FS.setCurrentWorkingDirectory("/b");
 1059   FS.addFile("c", 0, MemoryBuffer::getMemBuffer(""));
 1061   auto Stat = FS.status("/b/c");
 1062   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1064   ASSERT_EQ("/b", *FS.getCurrentWorkingDirectory());
 1066   Stat = FS.status("c");
 1067   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1079   FS.setCurrentWorkingDirectory("/b");
 1080   FS.addFile("c", 0, MemoryBuffer::getMemBuffer(""));
 1084   EC = FS.isLocal("c", IsLocal);
 1092   EXPECT_EQ(FS.getRealPath("b", Path), errc::operation_not_permitted);
 1096     auto EC = FS.getRealPath(P, Output);
 1101   FS.setCurrentWorkingDirectory("a");
 1106   FS.setCurrentWorkingDirectory("/a");
 1114   FS.addFile("/a/b/c", 0, MemoryBuffer::getMemBuffer("abc"), 0xFEEDFACE);
 1115   auto Stat = FS.status("/a");
 1116   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1119   Stat = FS.status("/a/b");
 1120   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1123   Stat = FS.status("/a/b/c");
 1124   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1131   FS.addFile("/a/b/c", 0, MemoryBuffer::getMemBuffer("abc"), None, 0xDABBAD00);
 1132   auto Stat = FS.status("/a");
 1133   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1136   Stat = FS.status("/a/b");
 1138   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1140   Stat = FS.status("/a/b/c");
 1141   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1148   FS.addFile("/a/b/c", 0, MemoryBuffer::getMemBuffer("abc"), None, None,
 1150   auto Stat = FS.status("/a");
 1151   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1153   Stat = FS.status("/a/b");
 1154   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1156   Stat = FS.status("/a/b/c");
 1157   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1163   FS.addFile("/a/b/c", 0, MemoryBuffer::getMemBuffer("abc"), None, None, None,
 1165   auto Stat = FS.status("/a");
 1166   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1171   Stat = FS.status("/a/b");
 1172   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1177   Stat = FS.status("/a/b/c");
 1178   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1185   FS.addFile("/a", 0, MemoryBuffer::getMemBuffer(""), /*User=*/None,
 1187   FS.addFile("/a/b", 0, MemoryBuffer::getMemBuffer("abc"), /*User=*/None,
 1189   auto Stat = FS.status("/a");
 1190   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1192   Stat = FS.status("/a/b");
 1193   ASSERT_FALSE(Stat.getError()) << Stat.getError() << "\n" << FS.toString();
 1233   FS.addFile(Target, 0, MemoryBuffer::getMemBuffer("content of target"));
 1234   EXPECT_TRUE(FS.addHardLink(FromLink, Target));
 1235   EXPECT_THAT(FromLink, IsHardLinkTo(&FS, Target));
 1236   EXPECT_TRUE(FS.status(FromLink)->getSize() == FS.status(Target)->getSize());
 1236   EXPECT_TRUE(FS.status(FromLink)->getSize() == FS.status(Target)->getSize());
 1237   EXPECT_TRUE(FS.getBufferForFile(FromLink)->get()->getBuffer() ==
 1238               FS.getBufferForFile(Target)->get()->getBuffer());
 1246   FS.addFile(Target, 0, MemoryBuffer::getMemBuffer("content of target file"));
 1247   EXPECT_TRUE(FS.addHardLink(Link2, Target));
 1248   EXPECT_TRUE(FS.addHardLink(Link1, Link2));
 1249   EXPECT_TRUE(FS.addHardLink(Link0, Link1));
 1250   EXPECT_THAT(Link0, IsHardLinkTo(&FS, Target));
 1251   EXPECT_THAT(Link1, IsHardLinkTo(&FS, Target));
 1252   EXPECT_THAT(Link2, IsHardLinkTo(&FS, Target));
 1256   EXPECT_FALSE(FS.addHardLink("/path/to/link", "/path/to/target"));
 1262   FS.addFile(Target, 0, MemoryBuffer::getMemBuffer("content of target"));
 1263   FS.addFile(Link, 0, MemoryBuffer::getMemBuffer("content of link"));
 1264   EXPECT_FALSE(FS.addHardLink(Link, Target));
 1270   FS.addFile(Target, 0, MemoryBuffer::getMemBuffer("content of target"));
 1271   EXPECT_TRUE(FS.addHardLink(Link, Target));
 1272   EXPECT_FALSE(FS.addHardLink(Link, Target));
 1279   EXPECT_TRUE(FS.addFile(Target, 0, MemoryBuffer::getMemBuffer(Content)));
 1280   EXPECT_TRUE(FS.addHardLink(Link, Target));
 1281   EXPECT_TRUE(FS.addFile(Link, 0, MemoryBuffer::getMemBuffer(Content)));
 1289   EXPECT_TRUE(FS.addFile(Target, 0, MemoryBuffer::getMemBuffer(Content)));
 1290   EXPECT_TRUE(FS.addHardLink(Link, Target));
 1291   EXPECT_FALSE(FS.addFile(Link, 0, MemoryBuffer::getMemBuffer(LinkContent)));
 1299   EXPECT_TRUE(FS.addFile(File, 0, MemoryBuffer::getMemBuffer(Content)));
 1300   EXPECT_FALSE(FS.addHardLink(Link, Dir));
 1307   EXPECT_TRUE(FS.addFile(Target, 0, MemoryBuffer::getMemBuffer(Content)));
 1308   EXPECT_FALSE(FS.addHardLink(Dir, Target));
 1313   FS.addFile("/a/b", 0, MemoryBuffer::getMemBuffer(CommonContent));
 1314   FS.addFile("/c/d", 0, MemoryBuffer::getMemBuffer(CommonContent));
 1315   EXPECT_FALSE(FS.addHardLink("/c/d/e", "/a/b"));
 1320   FS.addFile("/a/b", 0, MemoryBuffer::getMemBuffer("content string"));
 1321   EXPECT_TRUE(FS.addHardLink("/c/d", "/a/b"));
 1322   auto I = vfs::recursive_directory_iterator(FS, "/", EC);