/* -*- 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
  // http://www.boost.org/doc/libs/1_54_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
