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