Line data Source code
1 : // Copyright (c) 2011-2021 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // Project: https://snapwebsites.org/project/libaddr
4 : //
5 : // Permission is hereby granted, free of charge, to any
6 : // person obtaining a copy of this software and
7 : // associated documentation files (the "Software"), to
8 : // deal in the Software without restriction, including
9 : // without limitation the rights to use, copy, modify,
10 : // merge, publish, distribute, sublicense, and/or sell
11 : // copies of the Software, and to permit persons to whom
12 : // the Software is furnished to do so, subject to the
13 : // following conditions:
14 : //
15 : // The above copyright notice and this permission notice
16 : // shall be included in all copies or substantial
17 : // portions of the Software.
18 : //
19 : // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
20 : // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
21 : // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
22 : // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
23 : // EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 : // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25 : // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 : // ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 : // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 : // SOFTWARE.
29 :
30 :
31 : /** \file
32 : * \brief Check the global functions.
33 : *
34 : * This test file includes test that checks the global functions.
35 : *
36 : * At this time, the only global functions we check here are the
37 : * version functions.
38 : *
39 : * The address_match_ranges() function is checked in the IPv4
40 : * and IPv6 tests along with other address tests.
41 : */
42 :
43 : // self
44 : //
45 : #include "catch_main.h"
46 :
47 :
48 : // addr lib
49 : //
50 : #include <libaddr/addr.h>
51 : #include <libaddr/version.h>
52 :
53 :
54 : // last include
55 : //
56 : #include <snapdev/poison.h>
57 :
58 :
59 :
60 :
61 :
62 3 : CATCH_TEST_CASE( "version", "[global]" )
63 : {
64 1 : CATCH_REQUIRE(addr::get_version_major() == LIBADDR_VERSION_MAJOR);
65 1 : CATCH_REQUIRE(addr::get_version_minor() == LIBADDR_VERSION_MINOR);
66 1 : CATCH_REQUIRE(addr::get_version_patch() == LIBADDR_VERSION_PATCH);
67 1 : CATCH_REQUIRE(std::string(addr::get_version_string()) == std::string(LIBADDR_VERSION_STRING));
68 7 : }
69 :
70 :
71 : // vim: ts=4 sw=4 et
|