winfsp unit tests and fixes
This commit is contained in:
parent
ab9765582a
commit
a9125196ce
@ -68,10 +68,10 @@ static void test_file(auto &&file_path, auto &&flags) {
|
|||||||
EXPECT_TRUE(::ReadFile(handle, read_buffer.data(), read_buffer.size(),
|
EXPECT_TRUE(::ReadFile(handle, read_buffer.data(), read_buffer.size(),
|
||||||
&bytes_read, nullptr));
|
&bytes_read, nullptr));
|
||||||
|
|
||||||
// ASSERT(BytesPerSector == BytesTransferred);
|
EXPECT_EQ(static_cast<DWORD>(16U), bytes_read);
|
||||||
// ASSERT(FilePointer + BytesTransferred ==
|
EXPECT_EQ(pointer + bytes_read, ::SetFilePointer(handle, 0, 0, FILE_CURRENT));
|
||||||
// SetFilePointer(Handle, 0, 0, FILE_CURRENT));
|
EXPECT_EQ(0,
|
||||||
// ASSERT(0 == memcmp(Buffer[0], Buffer[1], BytesTransferred));
|
std::memcmp(write_buffer.data(), read_buffer.data(), bytes_read));
|
||||||
//
|
//
|
||||||
// FilePointer = SetFilePointer(Handle, 2 * BytesPerSector, 0, FILE_BEGIN);
|
// FilePointer = SetFilePointer(Handle, 2 * BytesPerSector, 0, FILE_BEGIN);
|
||||||
// ASSERT(2 * BytesPerSector == FilePointer);
|
// ASSERT(2 * BytesPerSector == FilePointer);
|
||||||
@ -197,12 +197,26 @@ static void test_file(auto &&file_path, auto &&flags) {
|
|||||||
ASSERT_EQ(ERROR_FILE_NOT_FOUND, ::GetLastError());
|
ASSERT_EQ(ERROR_FILE_NOT_FOUND, ::GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPED_TEST(winfsp_test, rdrw_can_read_and_write_file_no_cache) {
|
TYPED_TEST(winfsp_test, rdrw_can_read_and_write_file_no_flags) {
|
||||||
|
auto file_path{
|
||||||
|
utils::path::combine(this->mount_location, {"test_file_5"}),
|
||||||
|
};
|
||||||
|
test_file(file_path, 0U);
|
||||||
|
}
|
||||||
|
|
||||||
|
TYPED_TEST(winfsp_test, rdrw_can_read_and_write_file_no_buffering) {
|
||||||
auto file_path{
|
auto file_path{
|
||||||
utils::path::combine(this->mount_location, {"test_file_5"}),
|
utils::path::combine(this->mount_location, {"test_file_5"}),
|
||||||
};
|
};
|
||||||
test_file(file_path, FILE_FLAG_NO_BUFFERING);
|
test_file(file_path, FILE_FLAG_NO_BUFFERING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TYPED_TEST(winfsp_test, rdrw_can_read_and_write_file_write_through) {
|
||||||
|
auto file_path{
|
||||||
|
utils::path::combine(this->mount_location, {"test_file_5"}),
|
||||||
|
};
|
||||||
|
test_file(file_path, FILE_FLAG_WRITE_THROUGH);
|
||||||
|
}
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user