/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2014, Regents of the University of California.
 *
 * This file is part of NDNS (Named Data Networking Domain Name Service).
 * See AUTHORS.md for complete list of NDNS authors and contributors.
 *
 * NDNS 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.
 *
 * NDNS 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
 * NDNS, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "ndns-label.hpp"
#include "../boost-test.hpp"

namespace ndn {
namespace ndns {
namespace tests {

BOOST_AUTO_TEST_SUITE(NdnsLabel)

BOOST_AUTO_TEST_CASE(MatchInterest)
{
  using namespace label;
  Name hint("/att");
  Name zone("/net/ndnsim");

  Interest interest1("/att/%F0./net/ndnsim/NDNS/www/dsk-111/NS");
  Interest interest2("/att/%F0./net/ndnsim/NDNS/www/dsk-111/NS/%FD%00");

  MatchResult re;
  BOOST_CHECK_EQUAL(matchName(interest1, hint, zone, re), true);
  BOOST_CHECK_EQUAL(re.rrLabel, Name("/www/dsk-111"));
  BOOST_CHECK_EQUAL(re.rrType, name::Component("NS"));
  BOOST_CHECK_EQUAL(re.version, name::Component());

  BOOST_CHECK_EQUAL(matchName(interest2, hint, zone, re), true);
  BOOST_CHECK_EQUAL(re.rrLabel, Name("/www/dsk-111"));
  BOOST_CHECK_EQUAL(re.rrType, name::Component("NS"));
  BOOST_CHECK_EQUAL(re.version, name::Component::fromEscapedString("%FD%00"));
}

BOOST_AUTO_TEST_CASE(MatchData)
{
  using namespace label;
  Name hint("/att");
  Name zone("/net/ndnsim");

  Data data1("/att/%F0./net/ndnsim/NDNS/www/dsk-111/NS/%FD%00");

  MatchResult re;
  BOOST_CHECK_EQUAL(matchName(data1, hint, zone, re), true);
  BOOST_CHECK_EQUAL(re.rrLabel, Name("/www/dsk-111"));
  BOOST_CHECK_EQUAL(re.rrType, name::Component("NS"));
  BOOST_REQUIRE_NO_THROW(re.version.toVersion());
  BOOST_CHECK_EQUAL(re.version.toVersion(), 0);
}

BOOST_AUTO_TEST_SUITE_END()

} // namespace tests
} // namespace ndns
} // namespace ndn
