MCPcopy Create free account
hub / github.com/GANGE666/xVMP / checkContents

Function checkContents

src/unittests/Support/VirtualFileSystemTest.cpp:598–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596
597template <typename DirIter>
598static void checkContents(DirIter I, ArrayRef<StringRef> ExpectedOut) {
599 std::error_code EC;
600 SmallVector<StringRef, 4> Expected(ExpectedOut.begin(), ExpectedOut.end());
601 SmallVector<std::string, 4> InputToCheck;
602
603 // Do not rely on iteration order to check for contents, sort both
604 // content vectors before comparison.
605 for (DirIter E; !EC && I != E; I.increment(EC))
606 InputToCheck.push_back(I->path());
607
608 llvm::sort(InputToCheck);
609 llvm::sort(Expected);
610 EXPECT_EQ(InputToCheck.size(), Expected.size());
611
612 unsigned LastElt = std::min(InputToCheck.size(), Expected.size());
613 for (unsigned Idx = 0; Idx != LastElt; ++Idx)
614 EXPECT_EQ(StringRef(InputToCheck[Idx]), Expected[Idx]);
615}
616
617TEST(VirtualFileSystemTest, OverlayIteration) {
618 IntrusiveRefCntPtr<DummyFileSystem> Lower(new DummyFileSystem());

Callers 2

TESTFunction · 0.85
TEST_FFunction · 0.85

Calls 9

sortFunction · 0.50
minFunction · 0.50
StringRefClass · 0.50
beginMethod · 0.45
endMethod · 0.45
incrementMethod · 0.45
push_backMethod · 0.45
pathMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected