/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2014-2016,  Arizona Board of Regents.
 *
 * This file is part of ndn-tools (Named Data Networking Essential Tools).
 * See AUTHORS.md for complete list of ndn-tools authors and contributors.
 *
 * ndn-tools is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * ndn-tools, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 */

// #include "unit-under-test.hpp"
// Unit being tested MUST be included first, to ensure header compiles on its own.
// For further information about test naming conventions, see
// http://redmine.named-data.net/projects/nfd/wiki/UnitTesting

#include "tests/test-common.hpp"

namespace ndn {
namespace tool_name {
namespace tests {
// Unit tests SHOULD go inside ndn::tool_name::tests namespace.

// Common fixtures in ndn::tests can be imported.
using namespace ndn::tests;

// See http://redmine.named-data.net/projects/nfd/wiki/UnitTesting on how to name a test suite.
BOOST_AUTO_TEST_SUITE(TestSkeleton)

BOOST_AUTO_TEST_CASE(Test1)
{
  int i = 0;

  // For reference of available Boost.Test macros, see
  // https://www.boost.org/doc/libs/1_58_0/libs/test/doc/html/utf/testing-tools/reference.html

  BOOST_REQUIRE_NO_THROW(i = 1);
  BOOST_REQUIRE_EQUAL(i, 1);
}

// Use UnitTestTimeFixture to mock clocks.
BOOST_FIXTURE_TEST_CASE(Test2, UnitTestTimeFixture)
{
  // this->advanceClocks increments mock clocks.
  boost::asio::io_service io;
  this->advanceClocks(io, time::milliseconds(500));
}

BOOST_AUTO_TEST_SUITE_END()

} // namespace tests
} // namespace tool_name
} // namespace ndn
