1 /*
2 ** Copyright 2011-2013 Centreon
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 **     http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 **
16 ** For more information : contact@centreon.com
17 */
18 
19 #include <iostream>
20 #include "com/centreon/clib/version.hh"
21 
22 using namespace com::centreon::clib;
23 
24 /**
25  *  Check that the version patch returned by the library matches the
26  *  header.
27  *
28  *  @return 0 on success.
29  */
main()30 int main() {
31   // Check.
32   int retval((version::get_patch() != version::patch) ||
33              (version::patch != CENTREON_CLIB_VERSION_PATCH));
34 
35   // Message.
36   if (retval)
37     std::cout << "Version patch mismatch" << std::endl
38               << "  library returned " << version::get_patch() << std::endl
39               << "  header returned  " << version::patch << std::endl
40               << "  macro returned   " << CENTREON_CLIB_VERSION_PATCH
41               << std::endl;
42   else
43     std::cout << "Version patch is consistent (" << version::patch << ")"
44               << std::endl;
45 
46   // Return check result.
47   return (retval);
48 }
49