Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame^] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Alexander Afanasyev | a06fdda | 2014-04-29 19:15:00 -0700 | [diff] [blame] | 2 | /** |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame^] | 3 | * Copyright (c) 2013-2014 Regents of the University of California. |
Alexander Afanasyev | a06fdda | 2014-04-29 19:15:00 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
Alexander Afanasyev | a06fdda | 2014-04-29 19:15:00 -0700 | [diff] [blame] | 6 | * |
Alexander Afanasyev | c169a81 | 2014-05-20 20:37:29 -0400 | [diff] [blame^] | 7 | * ndn-cxx library is free software: you can redistribute it and/or modify it under the |
| 8 | * terms of the GNU Lesser General Public License as published by the Free Software |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY |
| 12 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 13 | * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received copies of the GNU General Public License and GNU Lesser |
| 16 | * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see |
| 17 | * <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
Alexander Afanasyev | a06fdda | 2014-04-29 19:15:00 -0700 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #include "version.hpp" |
| 23 | |
| 24 | #include "boost-test.hpp" |
| 25 | #include <stdio.h> |
| 26 | |
| 27 | namespace ndn { |
| 28 | namespace tests { |
| 29 | |
| 30 | BOOST_AUTO_TEST_SUITE(TestVersion) |
| 31 | |
| 32 | BOOST_AUTO_TEST_CASE(Version) |
| 33 | { |
| 34 | BOOST_CHECK_EQUAL(NDN_CXX_VERSION, NDN_CXX_VERSION_MAJOR * 1000000 + |
| 35 | NDN_CXX_VERSION_MINOR * 1000 + |
| 36 | NDN_CXX_VERSION_PATCH); |
| 37 | } |
| 38 | |
| 39 | BOOST_AUTO_TEST_CASE(VersionString) |
| 40 | { |
| 41 | BOOST_STATIC_ASSERT(NDN_CXX_VERSION_MAJOR < 1000); |
| 42 | char buf[20]; |
| 43 | snprintf(buf, sizeof(buf), "%d.%d.%d", |
| 44 | NDN_CXX_VERSION_MAJOR, NDN_CXX_VERSION_MINOR, NDN_CXX_VERSION_PATCH); |
| 45 | |
| 46 | BOOST_CHECK_EQUAL(std::string(NDN_CXX_VERSION_STRING), std::string(buf)); |
| 47 | } |
| 48 | |
| 49 | BOOST_AUTO_TEST_SUITE_END() |
| 50 | |
| 51 | } // namespace tests |
| 52 | } // namespace ndn |