Mercurial > hg > orthanc
annotate UnitTests/main.cpp @ 279:eb5fb5501569
the REST API sample can now be built with the MinGWToolchain.cmake
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 10 Dec 2012 11:07:10 +0100 |
parents | c9b3ba0fd140 |
children | 4eea080e6e7a |
rev | line source |
---|---|
0 | 1 #include "gtest/gtest.h" |
2 | |
3 #include <ctype.h> | |
4 | |
5 #include "../Core/Compression/ZlibCompressor.h" | |
6 #include "../Core/DicomFormat/DicomTag.h" | |
63 | 7 #include "../OrthancCppClient/HttpClient.h" |
0 | 8 #include "../Core/HttpServer/HttpHandler.h" |
63 | 9 #include "../Core/OrthancException.h" |
0 | 10 #include "../Core/Toolbox.h" |
11 #include "../Core/Uuid.h" | |
63 | 12 #include "../OrthancServer/FromDcmtkBridge.h" |
13 #include "../OrthancServer/OrthancInitialization.h" | |
0 | 14 |
63 | 15 using namespace Orthanc; |
0 | 16 |
17 | |
18 TEST(Uuid, Generation) | |
19 { | |
20 for (int i = 0; i < 10; i++) | |
21 { | |
22 std::string s = Toolbox::GenerateUuid(); | |
23 ASSERT_TRUE(Toolbox::IsUuid(s)); | |
24 } | |
25 } | |
26 | |
27 TEST(Uuid, Test) | |
28 { | |
29 ASSERT_FALSE(Toolbox::IsUuid("")); | |
30 ASSERT_FALSE(Toolbox::IsUuid("012345678901234567890123456789012345")); | |
31 ASSERT_TRUE(Toolbox::IsUuid("550e8400-e29b-41d4-a716-446655440000")); | |
32 } | |
33 | |
34 TEST(Zlib, Basic) | |
35 { | |
36 std::string s = Toolbox::GenerateUuid(); | |
37 s = s + s + s + s; | |
38 | |
39 std::string compressed; | |
40 ZlibCompressor c; | |
41 c.Compress(compressed, s); | |
42 | |
43 std::string uncompressed; | |
44 c.Uncompress(uncompressed, compressed); | |
45 | |
46 ASSERT_EQ(s.size(), uncompressed.size()); | |
47 ASSERT_EQ(0, memcmp(&s[0], &uncompressed[0], s.size())); | |
48 } | |
49 | |
50 TEST(Zlib, Empty) | |
51 { | |
52 std::string s = ""; | |
53 | |
54 std::string compressed; | |
55 ZlibCompressor c; | |
56 c.Compress(compressed, s); | |
57 | |
58 std::string uncompressed; | |
59 c.Uncompress(uncompressed, compressed); | |
60 | |
61 ASSERT_EQ(0u, uncompressed.size()); | |
62 } | |
63 | |
64 TEST(ParseGetQuery, Basic) | |
65 { | |
66 HttpHandler::Arguments a; | |
67 HttpHandler::ParseGetQuery(a, "aaa=baaa&bb=a&aa=c"); | |
68 ASSERT_EQ(3u, a.size()); | |
69 ASSERT_EQ(a["aaa"], "baaa"); | |
70 ASSERT_EQ(a["bb"], "a"); | |
71 ASSERT_EQ(a["aa"], "c"); | |
72 } | |
73 | |
74 TEST(ParseGetQuery, BasicEmpty) | |
75 { | |
76 HttpHandler::Arguments a; | |
77 HttpHandler::ParseGetQuery(a, "aaa&bb=aa&aa"); | |
78 ASSERT_EQ(3u, a.size()); | |
79 ASSERT_EQ(a["aaa"], ""); | |
80 ASSERT_EQ(a["bb"], "aa"); | |
81 ASSERT_EQ(a["aa"], ""); | |
82 } | |
83 | |
84 TEST(ParseGetQuery, Single) | |
85 { | |
86 HttpHandler::Arguments a; | |
87 HttpHandler::ParseGetQuery(a, "aaa=baaa"); | |
88 ASSERT_EQ(1u, a.size()); | |
89 ASSERT_EQ(a["aaa"], "baaa"); | |
90 } | |
91 | |
92 TEST(ParseGetQuery, SingleEmpty) | |
93 { | |
94 HttpHandler::Arguments a; | |
95 HttpHandler::ParseGetQuery(a, "aaa"); | |
96 ASSERT_EQ(1u, a.size()); | |
97 ASSERT_EQ(a["aaa"], ""); | |
98 } | |
99 | |
100 TEST(DicomFormat, Tag) | |
101 { | |
102 ASSERT_EQ("PatientName", FromDcmtkBridge::GetName(DicomTag(0x0010, 0x0010))); | |
103 | |
104 DicomTag t = FromDcmtkBridge::FindTag("SeriesDescription"); | |
105 ASSERT_EQ(0x0008, t.GetGroup()); | |
106 ASSERT_EQ(0x103E, t.GetElement()); | |
107 } | |
108 | |
109 | |
110 TEST(Uri, SplitUriComponents) | |
111 { | |
112 UriComponents c; | |
113 Toolbox::SplitUriComponents(c, "/cou/hello/world"); | |
114 ASSERT_EQ(3u, c.size()); | |
115 ASSERT_EQ("cou", c[0]); | |
116 ASSERT_EQ("hello", c[1]); | |
117 ASSERT_EQ("world", c[2]); | |
118 | |
119 Toolbox::SplitUriComponents(c, "/cou/hello/world/"); | |
120 ASSERT_EQ(3u, c.size()); | |
121 ASSERT_EQ("cou", c[0]); | |
122 ASSERT_EQ("hello", c[1]); | |
123 ASSERT_EQ("world", c[2]); | |
124 | |
125 Toolbox::SplitUriComponents(c, "/cou/hello/world/a"); | |
126 ASSERT_EQ(4u, c.size()); | |
127 ASSERT_EQ("cou", c[0]); | |
128 ASSERT_EQ("hello", c[1]); | |
129 ASSERT_EQ("world", c[2]); | |
130 ASSERT_EQ("a", c[3]); | |
131 | |
132 Toolbox::SplitUriComponents(c, "/"); | |
133 ASSERT_EQ(0u, c.size()); | |
134 | |
135 Toolbox::SplitUriComponents(c, "/hello"); | |
136 ASSERT_EQ(1u, c.size()); | |
137 ASSERT_EQ("hello", c[0]); | |
138 | |
139 Toolbox::SplitUriComponents(c, "/hello/"); | |
140 ASSERT_EQ(1u, c.size()); | |
141 ASSERT_EQ("hello", c[0]); | |
142 | |
63 | 143 ASSERT_THROW(Toolbox::SplitUriComponents(c, ""), OrthancException); |
144 ASSERT_THROW(Toolbox::SplitUriComponents(c, "a"), OrthancException); | |
207 | 145 ASSERT_THROW(Toolbox::SplitUriComponents(c, "/coucou//coucou"), OrthancException); |
0 | 146 } |
147 | |
148 | |
149 TEST(Uri, Child) | |
150 { | |
151 UriComponents c1; Toolbox::SplitUriComponents(c1, "/hello/world"); | |
152 UriComponents c2; Toolbox::SplitUriComponents(c2, "/hello/hello"); | |
153 UriComponents c3; Toolbox::SplitUriComponents(c3, "/hello"); | |
154 UriComponents c4; Toolbox::SplitUriComponents(c4, "/world"); | |
155 UriComponents c5; Toolbox::SplitUriComponents(c5, "/"); | |
156 | |
157 ASSERT_TRUE(Toolbox::IsChildUri(c1, c1)); | |
158 ASSERT_FALSE(Toolbox::IsChildUri(c1, c2)); | |
159 ASSERT_FALSE(Toolbox::IsChildUri(c1, c3)); | |
160 ASSERT_FALSE(Toolbox::IsChildUri(c1, c4)); | |
161 ASSERT_FALSE(Toolbox::IsChildUri(c1, c5)); | |
162 | |
163 ASSERT_FALSE(Toolbox::IsChildUri(c2, c1)); | |
164 ASSERT_TRUE(Toolbox::IsChildUri(c2, c2)); | |
165 ASSERT_FALSE(Toolbox::IsChildUri(c2, c3)); | |
166 ASSERT_FALSE(Toolbox::IsChildUri(c2, c4)); | |
167 ASSERT_FALSE(Toolbox::IsChildUri(c2, c5)); | |
168 | |
169 ASSERT_TRUE(Toolbox::IsChildUri(c3, c1)); | |
170 ASSERT_TRUE(Toolbox::IsChildUri(c3, c2)); | |
171 ASSERT_TRUE(Toolbox::IsChildUri(c3, c3)); | |
172 ASSERT_FALSE(Toolbox::IsChildUri(c3, c4)); | |
173 ASSERT_FALSE(Toolbox::IsChildUri(c3, c5)); | |
174 | |
175 ASSERT_FALSE(Toolbox::IsChildUri(c4, c1)); | |
176 ASSERT_FALSE(Toolbox::IsChildUri(c4, c2)); | |
177 ASSERT_FALSE(Toolbox::IsChildUri(c4, c3)); | |
178 ASSERT_TRUE(Toolbox::IsChildUri(c4, c4)); | |
179 ASSERT_FALSE(Toolbox::IsChildUri(c4, c5)); | |
180 | |
181 ASSERT_TRUE(Toolbox::IsChildUri(c5, c1)); | |
182 ASSERT_TRUE(Toolbox::IsChildUri(c5, c2)); | |
183 ASSERT_TRUE(Toolbox::IsChildUri(c5, c3)); | |
184 ASSERT_TRUE(Toolbox::IsChildUri(c5, c4)); | |
185 ASSERT_TRUE(Toolbox::IsChildUri(c5, c5)); | |
186 } | |
187 | |
188 TEST(Uri, AutodetectMimeType) | |
189 { | |
190 ASSERT_EQ("", Toolbox::AutodetectMimeType("../NOTES")); | |
191 ASSERT_EQ("", Toolbox::AutodetectMimeType("")); | |
192 ASSERT_EQ("", Toolbox::AutodetectMimeType("/")); | |
193 ASSERT_EQ("", Toolbox::AutodetectMimeType("a/a")); | |
194 | |
195 ASSERT_EQ("text/plain", Toolbox::AutodetectMimeType("../NOTES.txt")); | |
196 ASSERT_EQ("text/plain", Toolbox::AutodetectMimeType("../coucou.xml/NOTES.txt")); | |
197 ASSERT_EQ("text/xml", Toolbox::AutodetectMimeType("../.xml")); | |
198 | |
199 ASSERT_EQ("application/javascript", Toolbox::AutodetectMimeType("NOTES.js")); | |
200 ASSERT_EQ("application/json", Toolbox::AutodetectMimeType("NOTES.json")); | |
201 ASSERT_EQ("application/pdf", Toolbox::AutodetectMimeType("NOTES.pdf")); | |
202 ASSERT_EQ("text/css", Toolbox::AutodetectMimeType("NOTES.css")); | |
203 ASSERT_EQ("text/html", Toolbox::AutodetectMimeType("NOTES.html")); | |
204 ASSERT_EQ("text/plain", Toolbox::AutodetectMimeType("NOTES.txt")); | |
205 ASSERT_EQ("text/xml", Toolbox::AutodetectMimeType("NOTES.xml")); | |
206 ASSERT_EQ("image/gif", Toolbox::AutodetectMimeType("NOTES.gif")); | |
207 ASSERT_EQ("image/jpeg", Toolbox::AutodetectMimeType("NOTES.jpg")); | |
208 ASSERT_EQ("image/jpeg", Toolbox::AutodetectMimeType("NOTES.jpeg")); | |
209 ASSERT_EQ("image/png", Toolbox::AutodetectMimeType("NOTES.png")); | |
210 } | |
211 | |
22 | 212 TEST(Toolbox, ComputeMD5) |
213 { | |
214 std::string s; | |
215 | |
216 // # echo -n "Hello" | md5sum | |
217 | |
218 Toolbox::ComputeMD5(s, "Hello"); | |
219 ASSERT_EQ("8b1a9953c4611296a827abf8c47804d7", s); | |
220 Toolbox::ComputeMD5(s, ""); | |
221 ASSERT_EQ("d41d8cd98f00b204e9800998ecf8427e", s); | |
222 } | |
223 | |
177 | 224 TEST(Toolbox, ComputeSHA1) |
225 { | |
226 std::string s; | |
227 | |
228 Toolbox::ComputeSHA1(s, "The quick brown fox jumps over the lazy dog"); | |
229 ASSERT_EQ("2fd4e1c6-7a2d28fc-ed849ee1-bb76e739-1b93eb12", s); | |
230 Toolbox::ComputeSHA1(s, ""); | |
231 ASSERT_EQ("da39a3ee-5e6b4b0d-3255bfef-95601890-afd80709", s); | |
232 } | |
233 | |
234 | |
24 | 235 TEST(Toolbox, Base64) |
236 { | |
237 ASSERT_EQ("", Toolbox::EncodeBase64("")); | |
238 ASSERT_EQ("YQ==", Toolbox::EncodeBase64("a")); | |
239 ASSERT_EQ("SGVsbG8gd29ybGQ=", Toolbox::EncodeBase64("Hello world")); | |
240 } | |
241 | |
87
8517e2c44283
path to configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
242 TEST(Toolbox, PathToExecutable) |
8517e2c44283
path to configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
243 { |
8517e2c44283
path to configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
244 printf("[%s]\n", Toolbox::GetPathToExecutable().c_str()); |
8517e2c44283
path to configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
245 printf("[%s]\n", Toolbox::GetDirectoryOfExecutable().c_str()); |
8517e2c44283
path to configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
246 } |
8517e2c44283
path to configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
247 |
247
c9b3ba0fd140
path management in zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
235
diff
changeset
|
248 TEST(Toolbox, StripSpaces) |
c9b3ba0fd140
path management in zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
235
diff
changeset
|
249 { |
c9b3ba0fd140
path management in zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
235
diff
changeset
|
250 ASSERT_EQ("", Toolbox::StripSpaces(" \t \r \n ")); |
c9b3ba0fd140
path management in zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
235
diff
changeset
|
251 ASSERT_EQ("coucou", Toolbox::StripSpaces(" coucou \t \r \n ")); |
c9b3ba0fd140
path management in zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
235
diff
changeset
|
252 ASSERT_EQ("cou cou", Toolbox::StripSpaces(" cou cou \n ")); |
c9b3ba0fd140
path management in zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
235
diff
changeset
|
253 ASSERT_EQ("c", Toolbox::StripSpaces(" \n\t c\r \n ")); |
c9b3ba0fd140
path management in zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
235
diff
changeset
|
254 } |
100
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
255 |
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
256 |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
257 #include <glog/logging.h> |
100
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
258 |
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
259 TEST(Logger, Basic) |
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
260 { |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
261 LOG(INFO) << "I say hello"; |
100
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
262 } |
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
263 |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
264 TEST(Toolbox, ConvertFromLatin1) |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
265 { |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
266 // This is a Latin-1 test string |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
267 const unsigned char data[10] = { 0xe0, 0xe9, 0xea, 0xe7, 0x26, 0xc6, 0x61, 0x62, 0x63, 0x00 }; |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
268 |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
269 /*FILE* f = fopen("/tmp/tutu", "w"); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
270 fwrite(&data[0], 9, 1, f); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
271 fclose(f);*/ |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
272 |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
273 std::string s((char*) &data[0], 10); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
274 ASSERT_EQ("&abc", Toolbox::ConvertToAscii(s)); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
275 |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
276 // Open in Emacs, then save with UTF-8 encoding, then "hexdump -C" |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
277 std::string utf8 = Toolbox::ConvertToUtf8(s, "ISO-8859-1"); |
235 | 278 ASSERT_EQ(15u, utf8.size()); |
107
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
279 ASSERT_EQ(0xc3, static_cast<unsigned char>(utf8[0])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
280 ASSERT_EQ(0xa0, static_cast<unsigned char>(utf8[1])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
281 ASSERT_EQ(0xc3, static_cast<unsigned char>(utf8[2])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
282 ASSERT_EQ(0xa9, static_cast<unsigned char>(utf8[3])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
283 ASSERT_EQ(0xc3, static_cast<unsigned char>(utf8[4])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
284 ASSERT_EQ(0xaa, static_cast<unsigned char>(utf8[5])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
285 ASSERT_EQ(0xc3, static_cast<unsigned char>(utf8[6])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
286 ASSERT_EQ(0xa7, static_cast<unsigned char>(utf8[7])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
287 ASSERT_EQ(0x26, static_cast<unsigned char>(utf8[8])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
288 ASSERT_EQ(0xc3, static_cast<unsigned char>(utf8[9])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
289 ASSERT_EQ(0x86, static_cast<unsigned char>(utf8[10])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
290 ASSERT_EQ(0x61, static_cast<unsigned char>(utf8[11])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
291 ASSERT_EQ(0x62, static_cast<unsigned char>(utf8[12])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
292 ASSERT_EQ(0x63, static_cast<unsigned char>(utf8[13])); |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
293 ASSERT_EQ(0x00, static_cast<unsigned char>(utf8[14])); // Null-terminated string |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
294 } |
3b45473c0a73
replace boost::locale with iconv for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
295 |
100
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
296 |
0 | 297 int main(int argc, char **argv) |
298 { | |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
299 // Initialize Google's logging library. |
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
300 FLAGS_logtostderr = true; |
137
0e97abc7b950
fix of a bug in older versions of sqlite
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
107
diff
changeset
|
301 FLAGS_minloglevel = 0; |
159
c08fbad40ddd
less verbosity in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
137
diff
changeset
|
302 |
c08fbad40ddd
less verbosity in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
137
diff
changeset
|
303 // Go to trace-level verbosity |
c08fbad40ddd
less verbosity in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
137
diff
changeset
|
304 //FLAGS_v = 1; |
c08fbad40ddd
less verbosity in unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
137
diff
changeset
|
305 |
102
7593b57dc1bf
switch to google log
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
101
diff
changeset
|
306 google::InitGoogleLogging("Orthanc"); |
100
27dc762e3dc8
getting rid of static dcmtk for debian
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
87
diff
changeset
|
307 |
63 | 308 OrthancInitialize(); |
0 | 309 ::testing::InitGoogleTest(&argc, argv); |
310 int result = RUN_ALL_TESTS(); | |
63 | 311 OrthancFinalize(); |
0 | 312 return result; |
313 } |