8015728: (zipfs) demo/zipfs/basic.sh failing
Summary: to return the correct loc entry size from wirteLOC();
Reviewed-by: alanb
--- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Fri Jun 07 14:13:40 2013 -0400
+++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java Fri Jun 07 13:49:37 2013 -0700
@@ -1940,7 +1940,6 @@
if (elen64 != 0) {
elen64 += 4; // header and data sz 4 bytes
}
-
while (eoff + 4 < elen) {
int tag = SH(extra, eoff);
int sz = SH(extra, eoff + 2);
@@ -1995,7 +1994,6 @@
writeLong(os, locoff);
}
if (elenNTFS != 0) {
- // System.out.println("writing NTFS:" + elenNTFS);
writeShort(os, EXTID_NTFS);
writeShort(os, elenNTFS - 4);
writeInt(os, 0); // reserved
@@ -2197,7 +2195,7 @@
if (extra != null) {
writeBytes(os, extra);
}
- return LOCHDR + name.length + elen + elen64 + elenEXTT;
+ return LOCHDR + name.length + elen + elen64 + elenNTFS + elenEXTT;
}
// Data Descriptior
--- a/jdk/test/demo/zipfs/ZipFSTester.java Fri Jun 07 14:13:40 2013 -0400
+++ b/jdk/test/demo/zipfs/ZipFSTester.java Fri Jun 07 13:49:37 2013 -0700
@@ -341,6 +341,9 @@
// test file stamp
static void testTime(Path src) throws Exception {
+ BasicFileAttributes attrs = Files
+ .getFileAttributeView(src, BasicFileAttributeView.class)
+ .readAttributes();
// create a new filesystem, copy this file into it
Map<String, Object> env = new HashMap<String, Object>();
env.put("create", "true");
@@ -352,10 +355,6 @@
Path dst = getPathWithParents(fs, "me");
Files.copy(src, dst, COPY_ATTRIBUTES);
checkEqual(src, dst);
-
- BasicFileAttributes attrs = Files
- .getFileAttributeView(src, BasicFileAttributeView.class)
- .readAttributes();
System.out.println("mtime: " + attrs.lastModifiedTime());
System.out.println("ctime: " + attrs.creationTime());
System.out.println("atime: " + attrs.lastAccessTime());
--- a/jdk/test/demo/zipfs/basic.sh Fri Jun 07 14:13:40 2013 -0400
+++ b/jdk/test/demo/zipfs/basic.sh Fri Jun 07 13:49:37 2013 -0700
@@ -22,7 +22,7 @@
#
# @test
# @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596
-# 7157656 8002390 7012868 7012856
+# 7157656 8002390 7012868 7012856 8015728
# @summary Test ZipFileSystem demo
# @build Basic PathOps ZipFSTester
# @run shell basic.sh