Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94ea3198 authored by Elliott Hughes's avatar Elliott Hughes Committed by android-build-merger
Browse files

Merge "libziparchive: use lseek directly."

am: 959aea7e

Change-Id: Iede0bfefff72b1a86a0717796cba2400da59b783
parents eea968e5 959aea7e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ TEST(ziparchive, EntryLargerThan32K) {
  // Read the file back to a buffer and make sure the contents are
  // the same as the memory buffer we extracted directly to.
  std::vector<uint8_t> file_contents(kAbUncompressedSize);
  ASSERT_EQ(0, lseek64(tmp_output_file.fd, 0, SEEK_SET));
  ASSERT_EQ(0, lseek(tmp_output_file.fd, 0, SEEK_SET));
  ASSERT_TRUE(android::base::ReadFully(tmp_output_file.fd, &file_contents[0], file_contents.size()));
  ASSERT_EQ(file_contents, buffer);

@@ -392,7 +392,7 @@ TEST(ziparchive, ExtractToFile) {

  // Assert that the first 8 bytes of the file haven't been clobbered.
  uint8_t read_buffer[data_size];
  ASSERT_EQ(0, lseek64(tmp_file.fd, 0, SEEK_SET));
  ASSERT_EQ(0, lseek(tmp_file.fd, 0, SEEK_SET));
  ASSERT_TRUE(android::base::ReadFully(tmp_file.fd, read_buffer, data_size));
  ASSERT_EQ(0, memcmp(read_buffer, data, data_size));

@@ -404,7 +404,7 @@ TEST(ziparchive, ExtractToFile) {

  // Assert that the total length of the file is sane
  ASSERT_EQ(static_cast<ssize_t>(data_size + kATxtContents.size()),
            lseek64(tmp_file.fd, 0, SEEK_END));
            lseek(tmp_file.fd, 0, SEEK_END));
}

#if !defined(_WIN32)