diff UnitTestsSources/ZipTests.cpp @ 1277:46bca019587e

primitives to add new content to existing ZIP files
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 26 Jan 2015 15:22:14 +0100
parents dfc076546821
children 6e7e5ed91c2d
line wrap: on
line diff
--- a/UnitTestsSources/ZipTests.cpp	Fri Jan 23 14:42:33 2015 +0100
+++ b/UnitTestsSources/ZipTests.cpp	Mon Jan 26 15:22:14 2015 +0100
@@ -72,6 +72,28 @@
 }
 
 
+TEST(ZipWriter, Append)
+{
+  {
+    Orthanc::ZipWriter w;
+    w.SetAppendToExisting(false);
+    w.SetOutputPath("UnitTestsResults/append.zip");
+    w.Open();
+    w.OpenFile("world/hello");
+    w.Write("Hello world 1");
+  }
+
+  {
+    Orthanc::ZipWriter w;
+    w.SetAppendToExisting(true);
+    w.SetOutputPath("UnitTestsResults/append.zip");
+    w.Open();
+    w.OpenFile("world/appended");
+    w.Write("Hello world 2");
+  }
+}
+
+