tests: respect naming conventions and improve nesting of some test suites
Change-Id: I255c27b552b32570871a9d5f8bda814ba8723c80
Refs: #2497
diff --git a/tests/unit-tests/version.t.cpp b/tests/unit-tests/version.t.cpp
index 9dbcc6d..5cb6622 100644
--- a/tests/unit-tests/version.t.cpp
+++ b/tests/unit-tests/version.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2015 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -20,8 +20,10 @@
*/
#include "version.hpp"
+#include "common.hpp"
#include "boost-test.hpp"
+
#include <stdio.h>
namespace ndn {
@@ -29,8 +31,10 @@
BOOST_AUTO_TEST_SUITE(TestVersion)
-BOOST_AUTO_TEST_CASE(Version)
+BOOST_AUTO_TEST_CASE(VersionNumber)
{
+ BOOST_TEST_MESSAGE("NDN_CXX_VERSION = " + to_string(NDN_CXX_VERSION));
+
BOOST_CHECK_EQUAL(NDN_CXX_VERSION, NDN_CXX_VERSION_MAJOR * 1000000 +
NDN_CXX_VERSION_MINOR * 1000 +
NDN_CXX_VERSION_PATCH);
@@ -38,15 +42,19 @@
BOOST_AUTO_TEST_CASE(VersionString)
{
- BOOST_STATIC_ASSERT(NDN_CXX_VERSION_MAJOR < 1000);
- char buf[20];
- snprintf(buf, sizeof(buf), "%d.%d.%d",
- NDN_CXX_VERSION_MAJOR, NDN_CXX_VERSION_MINOR, NDN_CXX_VERSION_PATCH);
+ BOOST_TEST_MESSAGE("NDN_CXX_VERSION_STRING = " NDN_CXX_VERSION_STRING);
- BOOST_CHECK_EQUAL(std::string(NDN_CXX_VERSION_STRING), std::string(buf));
+ BOOST_STATIC_ASSERT(NDN_CXX_VERSION_MAJOR < 1000);
+ BOOST_STATIC_ASSERT(NDN_CXX_VERSION_MINOR < 1000);
+ BOOST_STATIC_ASSERT(NDN_CXX_VERSION_PATCH < 1000);
+ char buf[12];
+ ::snprintf(buf, sizeof(buf), "%d.%d.%d",
+ NDN_CXX_VERSION_MAJOR, NDN_CXX_VERSION_MINOR, NDN_CXX_VERSION_PATCH);
+
+ BOOST_CHECK_EQUAL(NDN_CXX_VERSION_STRING, buf);
}
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestVersion
} // namespace tests
} // namespace ndn