From: Nick Burch Date: Thu, 24 Apr 2014 17:44:10 +0000 (+0000) Subject: More NPOIFS write testing, and fix a problem with writing xbat details out X-Git-Tag: REL_3_11_BETA1~177 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9839d90e797dbd8f2d861be1aa52fbd8a32e2d45;p=poi.git More NPOIFS write testing, and fix a problem with writing xbat details out git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1589806 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java index 53cb4b3655..06b1fd19f7 100644 --- a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java +++ b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java @@ -729,6 +729,11 @@ public class NPOIFSFileSystem extends BlockStore ByteBuffer block = getBlockAt(bat.getOurBlockIndex()); BlockAllocationTableWriter.writeBlock(bat, block); } + // XBats + for(BATBlock bat : _xbat_blocks) { + ByteBuffer block = getBlockAt(bat.getOurBlockIndex()); + BlockAllocationTableWriter.writeBlock(bat, block); + } // SBATs _mini_store.syncWithDataSource(); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestNPOIFSFileSystem.java b/src/testcases/org/apache/poi/poifs/filesystem/TestNPOIFSFileSystem.java index 36ba94d88b..8e4391378a 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestNPOIFSFileSystem.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestNPOIFSFileSystem.java @@ -512,13 +512,10 @@ public final class TestNPOIFSFileSystem { ByteArrayOutputStream baos = new ByteArrayOutputStream(); fs.writeFilesystem(baos); - // TODO Correct this to work -if(1==2) { // Check that it is seen correctly fs = new NPOIFSFileSystem(new ByteArrayInputStream(baos.toByteArray())); assertBATCount(fs, 237, 2); // TODO Do some more checks -} // All done fs.close();