comparison UnitTestsSources/Zip.cpp @ 803:4689e400e0fa

directory to store the results of the unit tests
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 07 May 2014 09:29:11 +0200
parents eb5a0b21d05e
children 3d6f9b7d0add
comparison
equal deleted inserted replaced
802:82b07ab959f4 803:4689e400e0fa
9 using namespace Orthanc; 9 using namespace Orthanc;
10 10
11 TEST(ZipWriter, Basic) 11 TEST(ZipWriter, Basic)
12 { 12 {
13 Orthanc::ZipWriter w; 13 Orthanc::ZipWriter w;
14 w.SetOutputPath("hello.zip"); 14 w.SetOutputPath("UnitTestsResults/hello.zip");
15 w.Open(); 15 w.Open();
16 w.OpenFile("world/hello"); 16 w.OpenFile("world/hello");
17 w.Write("Hello world"); 17 w.Write("Hello world");
18 } 18 }
19 19
20 20
21 TEST(ZipWriter, Basic64) 21 TEST(ZipWriter, Basic64)
22 { 22 {
23 Orthanc::ZipWriter w; 23 Orthanc::ZipWriter w;
24 w.SetOutputPath("hello64.zip"); 24 w.SetOutputPath("UnitTestsResults/hello64.zip");
25 w.SetZip64(true); 25 w.SetZip64(true);
26 w.Open(); 26 w.Open();
27 w.OpenFile("world/hello"); 27 w.OpenFile("world/hello");
28 w.Write("Hello world"); 28 w.Write("Hello world");
29 } 29 }
31 31
32 TEST(ZipWriter, Exceptions) 32 TEST(ZipWriter, Exceptions)
33 { 33 {
34 Orthanc::ZipWriter w; 34 Orthanc::ZipWriter w;
35 ASSERT_THROW(w.Open(), Orthanc::OrthancException); 35 ASSERT_THROW(w.Open(), Orthanc::OrthancException);
36 w.SetOutputPath("hello3.zip"); 36 w.SetOutputPath("UnitTestsResults/hello3.zip");
37 w.Open(); 37 w.Open();
38 ASSERT_THROW(w.Write("hello world"), Orthanc::OrthancException); 38 ASSERT_THROW(w.Write("hello world"), Orthanc::OrthancException);
39 } 39 }
40 40
41 41
89 89
90 TEST(HierarchicalZipWriter, Basic) 90 TEST(HierarchicalZipWriter, Basic)
91 { 91 {
92 static const std::string SPACES = " "; 92 static const std::string SPACES = " ";
93 93
94 HierarchicalZipWriter w("hello2.zip"); 94 HierarchicalZipWriter w("UnitTestsResults/hello2.zip");
95 95
96 w.SetCompressionLevel(0); 96 w.SetCompressionLevel(0);
97 97
98 // Inside "/" 98 // Inside "/"
99 w.OpenFile("hello"); 99 w.OpenFile("hello");