Mercurial > hg > orthanc
annotate UnitTestsSources/Versions.cpp @ 927:ff1812962f30 mac
fix DOS EOL
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 16 Apr 2014 16:53:25 +0200 |
parents | 17815b9d4280 |
children | de9763f63510 |
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> | |
181
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
10 #include <sqlite3.h> |
382 | 11 #include <lua.h> |
0 | 12 |
13 | |
14 TEST(Versions, Zlib) | |
15 { | |
16 ASSERT_STREQ(zlibVersion(), ZLIB_VERSION); | |
17 } | |
18 | |
19 TEST(Versions, Curl) | |
20 { | |
21 curl_version_info_data* v = curl_version_info(CURLVERSION_NOW); | |
22 ASSERT_STREQ(LIBCURL_VERSION, v->version); | |
23 } | |
24 | |
25 TEST(Versions, Png) | |
26 { | |
27 ASSERT_EQ(PNG_LIBPNG_VER_MAJOR * 10000 + PNG_LIBPNG_VER_MINOR * 100 + PNG_LIBPNG_VER_RELEASE, | |
28 png_access_version_number()); | |
29 } | |
30 | |
181
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
31 TEST(Versions, SQLite) |
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
32 { |
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
33 // http://www.sqlite.org/capi3ref.html#sqlite3_libversion |
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
34 assert(sqlite3_libversion_number() == SQLITE_VERSION_NUMBER ); |
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
35 assert(strcmp(sqlite3_sourceid(), SQLITE_SOURCE_ID) == 0); |
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
36 assert(strcmp(sqlite3_libversion(), SQLITE_VERSION) == 0); |
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
37 |
194
0186ac92810c
fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
38 // Ensure that the SQLite version is above 3.7.0. |
0186ac92810c
fixes for Ubuntu 10.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
181
diff
changeset
|
39 // "sqlite3_create_function_v2" is not defined in previous versions. |
181
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
40 ASSERT_GE(SQLITE_VERSION_NUMBER, 3007000); |
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
41 } |
2dece1526c06
simplifying db schema
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
63
diff
changeset
|
42 |
0 | 43 |
382 | 44 TEST(Versions, Lua) |
45 { | |
46 // Ensure that the Lua version is above 5.1.0. This version has | |
47 // introduced some API changes. | |
48 ASSERT_GE(LUA_VERSION_NUM, 501); | |
49 } | |
50 | |
51 | |
63 | 52 #if ORTHANC_STATIC == 1 |
0 | 53 TEST(Versions, ZlibStatic) |
54 { | |
55 ASSERT_STREQ("1.2.7", zlibVersion()); | |
56 } | |
57 | |
58 TEST(Versions, BoostStatic) | |
59 { | |
552
938d8461cf8f
revert to boost 1.54.0, use ZIP instead of TGZ because of bad directory in package
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
551
diff
changeset
|
60 ASSERT_STREQ("1_54", BOOST_LIB_VERSION); |
0 | 61 } |
62 | |
63 TEST(Versions, CurlStatic) | |
64 { | |
65 curl_version_info_data* v = curl_version_info(CURLVERSION_NOW); | |
66 ASSERT_STREQ("7.26.0", v->version); | |
67 } | |
68 | |
69 TEST(Versions, PngStatic) | |
70 { | |
71 ASSERT_EQ(10512, png_access_version_number()); | |
72 ASSERT_STREQ("1.5.12", PNG_LIBPNG_VER_STRING); | |
73 } | |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
74 |
382 | 75 TEST(Versions, CurlSslStatic) |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
76 { |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
77 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
|
78 |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
79 // Check that SSL support is enabled when required |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
80 bool curlSupportsSsl = vinfo->features & CURL_VERSION_SSL; |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
81 |
63 | 82 #if ORTHANC_SSL_ENABLED == 0 |
29
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
83 ASSERT_FALSE(curlSupportsSsl); |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
84 #else |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
85 ASSERT_TRUE(curlSupportsSsl); |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
86 #endif |
042ac60f5bf9
simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
8
diff
changeset
|
87 } |
382 | 88 |
89 TEST(Version, LuaStatic) | |
90 { | |
91 ASSERT_STREQ("Lua 5.1.5", LUA_RELEASE); | |
92 } | |
37 | 93 #endif |
382 | 94 |