Mercurial > hg > orthanc
annotate UnitTests/Versions.cpp @ 57:4bc019d2f969 orthanc-renaming
renaming
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 16 Sep 2012 09:22:48 +0200 |
parents | a15e90e5d6fc |
children | f1d0470ff334 |
rev | line source |
---|---|
0 | 1 #include "gtest/gtest.h" |
2 | |
3 #include <stdint.h> | |
4 #include <math.h> | |
5 #include <png.h> | |
6 #include <ctype.h> | |
7 #include <zlib.h> | |
8 #include <curl/curl.h> | |
9 #include <boost/version.hpp> | |
10 | |
11 | |
12 TEST(Versions, Zlib) | |
13 { | |
14 ASSERT_STREQ(zlibVersion(), ZLIB_VERSION); | |
15 } | |
16 | |
17 TEST(Versions, Curl) | |
18 { | |
19 curl_version_info_data* v = curl_version_info(CURLVERSION_NOW); | |
20 ASSERT_STREQ(LIBCURL_VERSION, v->version); | |
21 } | |
22 | |
23 TEST(Versions, Png) | |
24 { | |
25 ASSERT_EQ(PNG_LIBPNG_VER_MAJOR * 10000 + PNG_LIBPNG_VER_MINOR * 100 + PNG_LIBPNG_VER_RELEASE, | |
26 png_access_version_number()); | |
27 } | |
28 | |
29 | |
50 | 30 #if PALANTHIR_STATIC == 1 |
0 | 31 TEST(Versions, ZlibStatic) |
32 { | |
33 ASSERT_STREQ("1.2.7", zlibVersion()); | |
34 } | |
35 | |
36 TEST(Versions, BoostStatic) | |
37 { | |
8 | 38 ASSERT_STREQ("1_49", BOOST_LIB_VERSION); |
0 | 39 } |
40 | |
41 TEST(Versions, CurlStatic) | |
42 { | |
43 curl_version_info_data* v = curl_version_info(CURLVERSION_NOW); | |
44 ASSERT_STREQ("7.26.0", v->version); | |
45 } | |
46 | |
47 TEST(Versions, PngStatic) | |
48 { | |
49 ASSERT_EQ(10512, png_access_version_number()); | |
50 ASSERT_STREQ("1.5.12", PNG_LIBPNG_VER_STRING); | |
51 } | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
52 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
53 TEST(Versions, CurlSsl) |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
54 { |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
55 curl_version_info_data * vinfo = curl_version_info(CURLVERSION_NOW); |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
56 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
57 // Check that SSL support is enabled when required |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
58 bool curlSupportsSsl = vinfo->features & CURL_VERSION_SSL; |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
59 |
50 | 60 #if PALANTHIR_SSL_ENABLED == 0 |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
61 ASSERT_FALSE(curlSupportsSsl); |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
62 #else |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
63 ASSERT_TRUE(curlSupportsSsl); |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
64 #endif |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
65 } |
37 | 66 #endif |