annotate UnitTests/Versions.cpp @ 533:09b836088f63

eclipse warning
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Sep 2013 15:54:24 +0200
parents b45bc565d82a
children 210c96710592
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 #include "gtest/gtest.h"
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 #include <stdint.h>
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 #include <math.h>
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 #include <png.h>
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 #include <ctype.h>
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 #include <zlib.h>
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 #include <curl/curl.h>
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
11 #include <lua.h>
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 TEST(Versions, Zlib)
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 ASSERT_STREQ(zlibVersion(), ZLIB_VERSION);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 TEST(Versions, Curl)
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 curl_version_info_data* v = curl_version_info(CURLVERSION_NOW);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 ASSERT_STREQ(LIBCURL_VERSION, v->version);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 TEST(Versions, Png)
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 ASSERT_EQ(PNG_LIBPNG_VER_MAJOR * 10000 + PNG_LIBPNG_VER_MINOR * 100 + PNG_LIBPNG_VER_RELEASE,
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 png_access_version_number());
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
382
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
44 TEST(Versions, Lua)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
45 {
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
46 // Ensure that the Lua version is above 5.1.0. This version has
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
47 // introduced some API changes.
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
48 ASSERT_GE(LUA_VERSION_NUM, 501);
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
49 }
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
50
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
51
63
f1d0470ff334 renaming unittests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 50
diff changeset
52 #if ORTHANC_STATIC == 1
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 TEST(Versions, ZlibStatic)
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 ASSERT_STREQ("1.2.7", zlibVersion());
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 TEST(Versions, BoostStatic)
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 {
8
3a584803783e build with visual studio
jodogne
parents: 0
diff changeset
60 ASSERT_STREQ("1_49", BOOST_LIB_VERSION);
0
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 TEST(Versions, CurlStatic)
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 curl_version_info_data* v = curl_version_info(CURLVERSION_NOW);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 ASSERT_STREQ("7.26.0", v->version);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 }
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 TEST(Versions, PngStatic)
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 {
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 ASSERT_EQ(10512, png_access_version_number());
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 ASSERT_STREQ("1.5.12", PNG_LIBPNG_VER_STRING);
3959d33612cc initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }
29
042ac60f5bf9 simplified build of curl
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 8
diff changeset
74
382
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
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
f1d0470ff334 renaming unittests
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 50
diff changeset
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
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
88
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
89 TEST(Version, LuaStatic)
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
90 {
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
91 ASSERT_STREQ("Lua 5.1.5", LUA_RELEASE);
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
92 }
37
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 29
diff changeset
93 #endif
382
b45bc565d82a cmake for lua
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 194
diff changeset
94