class DirentChecker

Defined at line 28 of file ../../src/storage/lib/vfs/cpp/tests/dir_test_util.h

Helper class to check entries of a directory

Usage example:

fs::PseudoDir* test; // Test directory has SampleDir and SampleFile.

uint8_t buffer[256];

size_t len;

EXPECT_EQ(test->Readdir(

&cookie

, buffer, sizeof(buffer),

&len

), ZX_OK);

fs::DirentChecker dc(buffer, len);

dc.ExpectEntry(".", fuchsia_io::DirentType::kDirectory);

dc.ExpectEntry("SampleDir", fuchsia_io::DirentType::kDirectory);

dc.ExpectEntry("SampleFile",fuchsia_io::DirentType::kFile);

dc.ExpectEnd();

Public Methods

void DirentChecker (const uint8_t * buffer, size_t length)

Defined at line 30 of file ../../src/storage/lib/vfs/cpp/tests/dir_test_util.h

void ExpectEnd ()

Defined at line 32 of file ../../src/storage/lib/vfs/cpp/tests/dir_test_util.h

void ExpectEntry (std::string_view name, fuchsia_io::DirentType type)

Defined at line 34 of file ../../src/storage/lib/vfs/cpp/tests/dir_test_util.h