/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2014-2022  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/>.
 */

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

#include "tests/test-common.hpp"
#include "tests/io-fixture.hpp"           // optional, for IoFixture
//#include "tests/key-chain-fixture.hpp"  // optional, for KeyChainFixture

// Unit tests should go inside the ndn::tool_name::tests namespace.
namespace ndn::tool_name::tests {

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

// See https://redmine.named-data.net/projects/nfd/wiki/UnitTesting
// for a guide 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_71_0/libs/test/doc/html/boost_test/testing_tools/summary.html

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

// Use ClockFixture or IoFixture to mock clocks.
BOOST_FIXTURE_TEST_CASE(Test2, IoFixture)
{
  // advanceClocks() increments mock clocks.
  advanceClocks(500_ms);
}

BOOST_AUTO_TEST_SUITE_END() // TestSkeleton

} // namespace ndn::tool_name::tests
