blob: 5ea900edd530cfdda7f976d161aa43bff76887a8 [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Alexander Afanasyeva06fdda2014-04-29 19:15:00 -07002/**
Alexander Afanasyevc169a812014-05-20 20:37:29 -04003 * Copyright (c) 2013-2014 Regents of the University of California.
Alexander Afanasyeva06fdda2014-04-29 19:15:00 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyeva06fdda2014-04-29 19:15:00 -07006 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -04007 * 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 Afanasyeva06fdda2014-04-29 19:15:00 -070020 */
21
22#include "version.hpp"
23
24#include "boost-test.hpp"
25#include <stdio.h>
26
27namespace ndn {
28namespace tests {
29
30BOOST_AUTO_TEST_SUITE(TestVersion)
31
32BOOST_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
39BOOST_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
49BOOST_AUTO_TEST_SUITE_END()
50
51} // namespace tests
52} // namespace ndn