Mercurial > hg > orthanc
annotate UnitTestsSources/FileStorage.cpp @ 632:17815b9d4280
rename the UnitTests directory to avoid clashes in filenames
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 28 Oct 2013 16:26:51 +0100 |
parents | UnitTests/FileStorage.cpp@7c1faef915a4 |
children | 9e3f21441903 |
rev | line source |
---|---|
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 #include "gtest/gtest.h" |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 #include <ctype.h> |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 #include <glog/logging.h> |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 |
234 | 6 #include "../Core/FileStorage/FileStorage.h" |
224
4eb0c7ce86c9
refactoring for store
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
223
diff
changeset
|
7 #include "../OrthancServer/ServerIndex.h" |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 #include "../Core/Toolbox.h" |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 #include "../Core/OrthancException.h" |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 #include "../Core/Uuid.h" |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 #include "../Core/HttpServer/FilesystemHttpSender.h" |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 #include "../Core/HttpServer/BufferHttpSender.h" |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 #include "../Core/FileStorage/FileStorageAccessor.h" |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 #include "../Core/FileStorage/CompressedFileStorageAccessor.h" |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 using namespace Orthanc; |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 TEST(FileStorage, Basic) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 { |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 FileStorage s("FileStorageUnitTests"); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 std::string data = Toolbox::GenerateUuid(); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 std::string uid = s.Create(data); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 std::string d; |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 s.ReadFile(d, uid); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 ASSERT_EQ(d.size(), data.size()); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 ASSERT_FALSE(memcmp(&d[0], &data[0], data.size())); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 } |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 TEST(FileStorage, EndToEnd) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 { |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 FileStorage s("FileStorageUnitTests"); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 s.Clear(); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 std::list<std::string> u; |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 for (unsigned int i = 0; i < 10; i++) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 { |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 u.push_back(s.Create(Toolbox::GenerateUuid())); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 } |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 std::set<std::string> ss; |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 s.ListAllFiles(ss); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 ASSERT_EQ(10u, ss.size()); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 unsigned int c = 0; |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 for (std::list<std::string>::iterator |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 i = u.begin(); i != u.end(); i++, c++) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 { |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 ASSERT_TRUE(ss.find(*i) != ss.end()); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 if (c < 5) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 s.Remove(*i); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 } |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 s.ListAllFiles(ss); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 ASSERT_EQ(5u, ss.size()); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 s.Clear(); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 s.ListAllFiles(ss); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 ASSERT_EQ(0u, ss.size()); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 } |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 TEST(FileStorageAccessor, Simple) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 { |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 FileStorage s("FileStorageUnitTests"); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 FileStorageAccessor accessor(s); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 std::string data = "Hello world"; |
233 | 69 FileInfo info = accessor.Write(data, FileContentType_Dicom); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 std::string r; |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
72 accessor.Read(r, info.GetUuid()); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 ASSERT_EQ(data, r); |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
75 ASSERT_EQ(CompressionType_None, info.GetCompressionType()); |
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
76 ASSERT_EQ(11u, info.GetUncompressedSize()); |
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
77 ASSERT_EQ(11u, info.GetCompressedSize()); |
233 | 78 ASSERT_EQ(FileContentType_Dicom, info.GetContentType()); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 } |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 TEST(FileStorageAccessor, NoCompression) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 { |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 FileStorage s("FileStorageUnitTests"); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 CompressedFileStorageAccessor accessor(s); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 accessor.SetCompressionForNextOperations(CompressionType_None); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 std::string data = "Hello world"; |
233 | 89 FileInfo info = accessor.Write(data, FileContentType_Dicom); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 std::string r; |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
92 accessor.Read(r, info.GetUuid()); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 ASSERT_EQ(data, r); |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
95 ASSERT_EQ(CompressionType_None, info.GetCompressionType()); |
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
96 ASSERT_EQ(11u, info.GetUncompressedSize()); |
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
97 ASSERT_EQ(11u, info.GetCompressedSize()); |
233 | 98 ASSERT_EQ(FileContentType_Dicom, info.GetContentType()); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 } |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 TEST(FileStorageAccessor, Compression) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 { |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 FileStorage s("FileStorageUnitTests"); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 CompressedFileStorageAccessor accessor(s); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 accessor.SetCompressionForNextOperations(CompressionType_Zlib); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 std::string data = "Hello world"; |
233 | 109 FileInfo info = accessor.Write(data, FileContentType_Dicom); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 std::string r; |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
112 accessor.Read(r, info.GetUuid()); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 ASSERT_EQ(data, r); |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
115 ASSERT_EQ(CompressionType_Zlib, info.GetCompressionType()); |
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
116 ASSERT_EQ(11u, info.GetUncompressedSize()); |
233 | 117 ASSERT_EQ(FileContentType_Dicom, info.GetContentType()); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 } |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 TEST(FileStorageAccessor, Mix) |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 { |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 FileStorage s("FileStorageUnitTests"); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 CompressedFileStorageAccessor accessor(s); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 std::string r; |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 std::string compressedData = "Hello"; |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 std::string uncompressedData = "HelloWorld"; |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 accessor.SetCompressionForNextOperations(CompressionType_Zlib); |
233 | 131 FileInfo compressedInfo = accessor.Write(compressedData, FileContentType_Dicom); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 accessor.SetCompressionForNextOperations(CompressionType_None); |
233 | 134 FileInfo uncompressedInfo = accessor.Write(uncompressedData, FileContentType_Dicom); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 accessor.SetCompressionForNextOperations(CompressionType_Zlib); |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
137 accessor.Read(r, compressedInfo.GetUuid()); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 ASSERT_EQ(compressedData, r); |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 |
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 accessor.SetCompressionForNextOperations(CompressionType_None); |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
141 accessor.Read(r, compressedInfo.GetUuid()); |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 ASSERT_NE(compressedData, r); |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
143 |
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
144 /* |
224
4eb0c7ce86c9
refactoring for store
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
223
diff
changeset
|
145 // This test is too slow on Windows |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 accessor.SetCompressionForNextOperations(CompressionType_Zlib); |
232
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
147 ASSERT_THROW(accessor.Read(r, uncompressedInfo.GetUuid()), OrthancException); |
5368bbe813cf
refactoring of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
224
diff
changeset
|
148 */ |
222
bd934af46ba4
unit test of storagearea in separate file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 } |