diff --git a/test/syscalls/linux/mmap.cc b/test/syscalls/linux/mmap.cc index e9892e5dc..b07c3e4a3 100644 --- a/test/syscalls/linux/mmap.cc +++ b/test/syscalls/linux/mmap.cc @@ -1211,16 +1211,14 @@ TEST_F(MMapFileTest, WriteSharedTruncateUp) { std::string first(kPageSize / 2, 'A'); memcpy(reinterpret_cast(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(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());