Alexander Afanasyev | a06fdda | 2014-04-29 19:15:00 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /** |
| 3 | * Copyright (c) 2013-2014, Regents of the University of California. |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 7 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 8 | * |
| 9 | * This file licensed under New BSD License. See COPYING for detailed information about |
| 10 | * ndn-cxx library copyright, permissions, and redistribution restrictions. |
| 11 | */ |
| 12 | |
| 13 | #include "version.hpp" |
| 14 | |
| 15 | #include "boost-test.hpp" |
| 16 | #include <stdio.h> |
| 17 | |
| 18 | namespace ndn { |
| 19 | namespace tests { |
| 20 | |
| 21 | BOOST_AUTO_TEST_SUITE(TestVersion) |
| 22 | |
| 23 | BOOST_AUTO_TEST_CASE(Version) |
| 24 | { |
| 25 | BOOST_CHECK_EQUAL(NDN_CXX_VERSION, NDN_CXX_VERSION_MAJOR * 1000000 + |
| 26 | NDN_CXX_VERSION_MINOR * 1000 + |
| 27 | NDN_CXX_VERSION_PATCH); |
| 28 | } |
| 29 | |
| 30 | BOOST_AUTO_TEST_CASE(VersionString) |
| 31 | { |
| 32 | BOOST_STATIC_ASSERT(NDN_CXX_VERSION_MAJOR < 1000); |
| 33 | char buf[20]; |
| 34 | snprintf(buf, sizeof(buf), "%d.%d.%d", |
| 35 | NDN_CXX_VERSION_MAJOR, NDN_CXX_VERSION_MINOR, NDN_CXX_VERSION_PATCH); |
| 36 | |
| 37 | BOOST_CHECK_EQUAL(std::string(NDN_CXX_VERSION_STRING), std::string(buf)); |
| 38 | } |
| 39 | |
| 40 | BOOST_AUTO_TEST_SUITE_END() |
| 41 | |
| 42 | } // namespace tests |
| 43 | } // namespace ndn |