Merge pull request #919 from wineway:fix_posix_test

PiperOrigin-RevId: 420644954
This commit is contained in:
Victor Costan 2022-01-10 02:29:08 +00:00
commit 8f5aa6375e

View File

@ -243,8 +243,8 @@ TEST_F(EnvPosixTest, TestCloseOnExecRandomAccessFile) {
// Exhaust the RandomAccessFile mmap limit. This way, the test // Exhaust the RandomAccessFile mmap limit. This way, the test
// RandomAccessFile instance below is backed by a file descriptor, not by an // RandomAccessFile instance below is backed by a file descriptor, not by an
// mmap region. // mmap region.
leveldb::RandomAccessFile* mmapped_files[kReadOnlyFileLimit] = {nullptr}; leveldb::RandomAccessFile* mmapped_files[kMMapLimit];
for (int i = 0; i < kReadOnlyFileLimit; i++) { for (int i = 0; i < kMMapLimit; i++) {
ASSERT_LEVELDB_OK(env_->NewRandomAccessFile(file_path, &mmapped_files[i])); ASSERT_LEVELDB_OK(env_->NewRandomAccessFile(file_path, &mmapped_files[i]));
} }
@ -253,7 +253,7 @@ TEST_F(EnvPosixTest, TestCloseOnExecRandomAccessFile) {
CheckCloseOnExecDoesNotLeakFDs(open_fds); CheckCloseOnExecDoesNotLeakFDs(open_fds);
delete file; delete file;
for (int i = 0; i < kReadOnlyFileLimit; i++) { for (int i = 0; i < kMMapLimit; i++) {
delete mmapped_files[i]; delete mmapped_files[i];
} }
ASSERT_LEVELDB_OK(env_->RemoveFile(file_path)); ASSERT_LEVELDB_OK(env_->RemoveFile(file_path));