comparison 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
comparison
equal deleted inserted replaced
1276:6164f7200c43 1277:46bca019587e
67 Orthanc::ZipWriter w; 67 Orthanc::ZipWriter w;
68 ASSERT_THROW(w.Open(), Orthanc::OrthancException); 68 ASSERT_THROW(w.Open(), Orthanc::OrthancException);
69 w.SetOutputPath("UnitTestsResults/hello3.zip"); 69 w.SetOutputPath("UnitTestsResults/hello3.zip");
70 w.Open(); 70 w.Open();
71 ASSERT_THROW(w.Write("hello world"), Orthanc::OrthancException); 71 ASSERT_THROW(w.Write("hello world"), Orthanc::OrthancException);
72 }
73
74
75 TEST(ZipWriter, Append)
76 {
77 {
78 Orthanc::ZipWriter w;
79 w.SetAppendToExisting(false);
80 w.SetOutputPath("UnitTestsResults/append.zip");
81 w.Open();
82 w.OpenFile("world/hello");
83 w.Write("Hello world 1");
84 }
85
86 {
87 Orthanc::ZipWriter w;
88 w.SetAppendToExisting(true);
89 w.SetOutputPath("UnitTestsResults/append.zip");
90 w.Open();
91 w.OpenFile("world/appended");
92 w.Write("Hello world 2");
93 }
72 } 94 }
73 95
74 96
75 97
76 98