blob: 77d22c126c95f71dccafa6c1d84bf14ac52fbd8e [file] [log] [blame]
Junxiao Shi2713a3b2015-06-22 16:19:05 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Davide Pesavento52401ce2016-05-03 18:16:59 +02003 * Copyright (c) 2014-2016, Arizona Board of Regents.
Junxiao Shi2713a3b2015-06-22 16:19:05 -07004 *
5 * This file is part of ndn-tools (Named Data Networking Essential Tools).
6 * See AUTHORS.md for complete list of ndn-tools authors and contributors.
7 *
8 * ndn-tools is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20// #include "unit-under-test.hpp"
21// Unit being tested MUST be included first, to ensure header compiles on its own.
22// For further information about test naming conventions, see
23// http://redmine.named-data.net/projects/nfd/wiki/UnitTesting
24
25#include "tests/test-common.hpp"
26
27namespace ndn {
28namespace tool_name {
29namespace tests {
30// Unit tests SHOULD go inside ndn::tool_name::tests namespace.
31
32// Common fixtures in ndn::tests can be imported.
33using namespace ndn::tests;
34
35// See http://redmine.named-data.net/projects/nfd/wiki/UnitTesting on how to name a test suite.
36BOOST_AUTO_TEST_SUITE(TestSkeleton)
37
38BOOST_AUTO_TEST_CASE(Test1)
39{
40 int i = 0;
41
42 // For reference of available Boost.Test macros, see
Davide Pesavento26ea1ac2018-05-10 20:20:03 -040043 // https://www.boost.org/doc/libs/1_58_0/libs/test/doc/html/utf/testing-tools/reference.html
Junxiao Shi2713a3b2015-06-22 16:19:05 -070044
45 BOOST_REQUIRE_NO_THROW(i = 1);
46 BOOST_REQUIRE_EQUAL(i, 1);
47}
48
49// Use UnitTestTimeFixture to mock clocks.
50BOOST_FIXTURE_TEST_CASE(Test2, UnitTestTimeFixture)
51{
52 // this->advanceClocks increments mock clocks.
53 boost::asio::io_service io;
54 this->advanceClocks(io, time::milliseconds(500));
55}
56
57BOOST_AUTO_TEST_SUITE_END()
58
59} // namespace tests
60} // namespace tool_name
61} // namespace ndn