From ce7cbbe788bab17ff80bbb316c40fcb5625d9dca Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Thu, 22 Jun 2023 03:18:16 +0000 Subject: [PATCH] Update directorySize check in TestZip64P7ZipRecords With ag/20611145, the dir size is not uint32max by default. Update the value in the test accordingly. (The test was not discovered in CI because gotestrunner runs the tests using `-test.short` flag, and skips this test) Test: go test ./third_party/zip -run TestZip64P7ZipRecords Change-Id: I47885f23fe32ff5ed30c44d52561cd11d59020ec --- third_party/zip/android_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/third_party/zip/android_test.go b/third_party/zip/android_test.go index 46588d463..3911dd48d 100644 --- a/third_party/zip/android_test.go +++ b/third_party/zip/android_test.go @@ -190,7 +190,9 @@ func TestZip64P7ZipRecords(t *testing.T) { t.Errorf("wanted directoryRecords %d, got %d", w, g) } - if g, w := d.directorySize, uint64(uint32max); g != w { + zip64ExtraBuf := 48 // 4x uint16 + 5x uint64 + expectedDirSize := directoryHeaderLen + zip64ExtraBuf + len("large") // name of header + if g, w := d.directorySize, uint64(expectedDirSize); g != w { t.Errorf("wanted directorySize %d, got %d", w, g) }