From 9839d90e797dbd8f2d861be1aa52fbd8a32e2d45 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 24 Apr 2014 17:44:10 +0000 Subject: [PATCH] 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 --- .../org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java | 5 +++++ .../apache/poi/poifs/filesystem/TestNPOIFSFileSystem.java | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) 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(); -- 2.39.5