Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame^] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (c) 2014-2015, Arizona Board of Regents. |
| 4 | * |
| 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 | |
| 27 | namespace ndn { |
| 28 | namespace tool_name { |
| 29 | namespace tests { |
| 30 | // Unit tests SHOULD go inside ndn::tool_name::tests namespace. |
| 31 | |
| 32 | // Common fixtures in ndn::tests can be imported. |
| 33 | using namespace ndn::tests; |
| 34 | |
| 35 | // See http://redmine.named-data.net/projects/nfd/wiki/UnitTesting on how to name a test suite. |
| 36 | BOOST_AUTO_TEST_SUITE(TestSkeleton) |
| 37 | |
| 38 | BOOST_AUTO_TEST_CASE(Test1) |
| 39 | { |
| 40 | int i = 0; |
| 41 | |
| 42 | // For reference of available Boost.Test macros, see |
| 43 | // http://www.boost.org/doc/libs/1_48_0/libs/test/doc/html/utf/testing-tools/reference.html |
| 44 | |
| 45 | BOOST_REQUIRE_NO_THROW(i = 1); |
| 46 | BOOST_REQUIRE_EQUAL(i, 1); |
| 47 | } |
| 48 | |
| 49 | // Use UnitTestTimeFixture to mock clocks. |
| 50 | BOOST_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 | |
| 57 | BOOST_AUTO_TEST_SUITE_END() |
| 58 | |
| 59 | } // namespace tests |
| 60 | } // namespace tool_name |
| 61 | } // namespace ndn |