comparison UnitTestsSources/VersionsTests.cpp @ 2884:497a637366b4 db-changes

integration mainline->db-changes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 12 Oct 2018 15:18:10 +0200
parents 26eec77abc76
children 8341256c6941
comparison
equal deleted inserted replaced
1762:2b91363cc1d1 2884:497a637366b4
1 /** 1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store 2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium 4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium
5 * 6 *
6 * This program is free software: you can redistribute it and/or 7 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as 8 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, either version 3 of the 9 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version. 10 * License, or (at your option) any later version.
41 #include <curl/curl.h> 42 #include <curl/curl.h>
42 #include <boost/version.hpp> 43 #include <boost/version.hpp>
43 #include <sqlite3.h> 44 #include <sqlite3.h>
44 #include <lua.h> 45 #include <lua.h>
45 #include <jpeglib.h> 46 #include <jpeglib.h>
47 #include <iconv.h>
46 48
47 #if ORTHANC_SSL_ENABLED == 1 49 #if ORTHANC_ENABLE_SSL == 1
48 #include <openssl/opensslv.h> 50 #include <openssl/opensslv.h>
49 #endif 51 #endif
50 52
51 53
52 TEST(Versions, Zlib) 54 TEST(Versions, Zlib)
95 97
96 #if ORTHANC_STATIC == 1 98 #if ORTHANC_STATIC == 1
97 99
98 TEST(Versions, ZlibStatic) 100 TEST(Versions, ZlibStatic)
99 { 101 {
100 ASSERT_STREQ("1.2.7", zlibVersion()); 102 ASSERT_STREQ("1.2.11", zlibVersion());
101 } 103 }
102 104
103 TEST(Versions, BoostStatic) 105 TEST(Versions, BoostStatic)
104 { 106 {
105 ASSERT_STREQ("1_58", BOOST_LIB_VERSION); 107 ASSERT_STREQ("1_67", BOOST_LIB_VERSION);
106 } 108 }
107 109
108 TEST(Versions, CurlStatic) 110 TEST(Versions, CurlStatic)
109 { 111 {
110 curl_version_info_data* v = curl_version_info(CURLVERSION_NOW); 112 curl_version_info_data* v = curl_version_info(CURLVERSION_NOW);
111 ASSERT_STREQ("7.44.0", v->version); 113 ASSERT_STREQ("7.57.0", v->version);
112 } 114 }
113 115
114 TEST(Versions, PngStatic) 116 TEST(Versions, PngStatic)
115 { 117 {
116 ASSERT_EQ(10512, png_access_version_number()); 118 ASSERT_EQ(10512u, png_access_version_number());
117 ASSERT_STREQ("1.5.12", PNG_LIBPNG_VER_STRING); 119 ASSERT_STREQ("1.5.12", PNG_LIBPNG_VER_STRING);
118 } 120 }
119 121
120 TEST(Versions, JpegStatic) 122 TEST(Versions, JpegStatic)
121 { 123 {
128 curl_version_info_data * vinfo = curl_version_info(CURLVERSION_NOW); 130 curl_version_info_data * vinfo = curl_version_info(CURLVERSION_NOW);
129 131
130 // Check that SSL support is enabled when required 132 // Check that SSL support is enabled when required
131 bool curlSupportsSsl = (vinfo->features & CURL_VERSION_SSL) != 0; 133 bool curlSupportsSsl = (vinfo->features & CURL_VERSION_SSL) != 0;
132 134
133 #if ORTHANC_SSL_ENABLED == 0 135 #if ORTHANC_ENABLE_SSL == 0
134 ASSERT_FALSE(curlSupportsSsl); 136 ASSERT_FALSE(curlSupportsSsl);
135 #else 137 #else
136 ASSERT_TRUE(curlSupportsSsl); 138 ASSERT_TRUE(curlSupportsSsl);
137 #endif 139 #endif
138 } 140 }
140 TEST(Version, LuaStatic) 142 TEST(Version, LuaStatic)
141 { 143 {
142 ASSERT_STREQ("Lua 5.1.5", LUA_RELEASE); 144 ASSERT_STREQ("Lua 5.1.5", LUA_RELEASE);
143 } 145 }
144 146
147 TEST(Version, LibIconvStatic)
148 {
149 static const int major = 1;
150 static const int minor = 15;
151 ASSERT_EQ((major << 8) + minor, _LIBICONV_VERSION);
152 }
145 153
146 #if ORTHANC_SSL_ENABLED == 1 154
155 #if ORTHANC_ENABLE_SSL == 1
147 TEST(Version, OpenSslStatic) 156 TEST(Version, OpenSslStatic)
148 { 157 {
149 ASSERT_EQ(0x1000204fL /* openssl-1.0.2d */, OPENSSL_VERSION_NUMBER); 158 ASSERT_EQ(0x100020ffL /* openssl-1.0.2o */, OPENSSL_VERSION_NUMBER);
150 } 159 }
151 #endif 160 #endif
152 161
153 162
154 #include <json/version.h> 163 #include <json/version.h>
155 164
156 TEST(Version, JsonCpp) 165 TEST(Version, JsonCpp)
157 { 166 {
158 ASSERT_STREQ("0.10.5", JSONCPP_VERSION_STRING); 167 #if ORTHANC_LEGACY_JSONCPP == 1
168 ASSERT_STREQ("0.10.6", JSONCPP_VERSION_STRING);
169 #elif ORTHANC_LEGACY_JSONCPP == 0
170 ASSERT_STREQ("1.8.4", JSONCPP_VERSION_STRING);
171 #else
172 # error Macro ORTHANC_LEGACY_JSONCPP should be set
173 #endif
159 } 174 }
160 175
161 #endif 176 #endif