]> source.dussan.org Git - poi.git/commitdiff
More NPOIFS write testing, and fix a problem with writing xbat details out
authorNick Burch <nick@apache.org>
Thu, 24 Apr 2014 17:44:10 +0000 (17:44 +0000)
committerNick Burch <nick@apache.org>
Thu, 24 Apr 2014 17:44:10 +0000 (17:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1589806 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java
src/testcases/org/apache/poi/poifs/filesystem/TestNPOIFSFileSystem.java

index 53cb4b365544bd9da00fc252b09415b6b36746fd..06b1fd19f77068d72dd977b1349d5c137d3807ab 100644 (file)
@@ -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();
index 36ba94d88bf06e6ab55d4eb7b7d8057e4e0d1662..8e4391378a5562974530ae6284fb54e9a2fd7034 100644 (file)
@@ -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();