comparison UnitTests/Zip.cpp @ 81:0ec5e2e327b1

zip writer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 24 Sep 2012 10:33:41 +0200
parents
children c9b3ba0fd140
comparison
equal deleted inserted replaced
80:6212bf978584 81:0ec5e2e327b1
1 #include "gtest/gtest.h"
2
3 #include "../Core/OrthancException.h"
4 #include "../Core/Compression/ZipWriter.h"
5
6
7 TEST(ZipWriter, Basic)
8 {
9 Orthanc::ZipWriter w;
10 w.SetOutputPath("hello.zip");
11 w.Open();
12 w.CreateFileInZip("world/hello");
13 w.Write("Hello world");
14 }
15
16
17 TEST(ZipWriter, Exceptions)
18 {
19 Orthanc::ZipWriter w;
20 ASSERT_THROW(w.Open(), Orthanc::OrthancException);
21 w.SetOutputPath("hello.zip");
22 w.Open();
23 ASSERT_THROW(w.Write("hello world"), Orthanc::OrthancException);
24 }