mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Internal change.
PiperOrigin-RevId: 674050572
This commit is contained in:
@@ -1211,16 +1211,14 @@ TEST_F(MMapFileTest, WriteSharedTruncateUp) {
|
||||
std::string first(kPageSize / 2, 'A');
|
||||
memcpy(reinterpret_cast<void*>(addr), first.c_str(), first.size());
|
||||
|
||||
// Second half; this is not reflected in the file now (see
|
||||
// WriteSharedBeyondEnd), but will be after the truncate.
|
||||
// Extend the file to a full page.
|
||||
EXPECT_THAT(ftruncate(fd_.get(), kPageSize), SyscallSucceeds());
|
||||
|
||||
// Second half; this will be reflected in the file now.
|
||||
std::string second(kPageSize / 2, 'B');
|
||||
memcpy(reinterpret_cast<void*>(addr + kPageSize / 2), second.c_str(),
|
||||
second.size());
|
||||
|
||||
// Extend the file to a full page. The second half of the page will be
|
||||
// reflected in the file.
|
||||
EXPECT_THAT(ftruncate(fd_.get(), kPageSize), SyscallSucceeds());
|
||||
|
||||
// The file may not actually be updated until munmap is called.
|
||||
ASSERT_THAT(Unmap(), SyscallSucceeds());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user