Browse Source

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
Spandan Das 10 months ago
parent
commit
ce7cbbe788
1 changed files with 3 additions and 1 deletions
  1. 3 1
      third_party/zip/android_test.go

+ 3 - 1
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)
 	}