blob: c396b6be506e2751944f95011bbf8bd441a50d2d [file] [log] [blame]
Shock Jiang6cce21a2014-09-07 10:14:12 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2014, Regents of the University of California.
4 *
5 * This file is part of NDNS (Named Data Networking Domain Name Service).
6 * See AUTHORS.md for complete list of NDNS authors and contributors.
7 *
8 * NDNS 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 * NDNS 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 * NDNS, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include "ndns-enum.hpp"
21#include "../boost-test.hpp"
22
23namespace ndn {
24namespace ndns {
25namespace tests {
26
27BOOST_AUTO_TEST_SUITE(NdnsEnum)
28
29BOOST_AUTO_TEST_CASE(NdnsTypeToString)
30{
31 BOOST_CHECK_EQUAL(toString(NDNS_RESP), "NDNS-Resp");
32 BOOST_CHECK_EQUAL(toString(NDNS_AUTH), "NDNS-Auth");
33 BOOST_CHECK_EQUAL(toString(NDNS_NACK), "NDNS-Nack");
34 BOOST_CHECK_EQUAL(toString(NDNS_NULL), "NDNS-Null");
35
36 BOOST_CHECK_EQUAL(toString(static_cast<NdnsType>(254)), "UNKNOWN");
37 BOOST_CHECK_EQUAL(toString(static_cast<NdnsType>(255)), "UNKNOWN");
38 BOOST_CHECK_EQUAL(toString(static_cast<NdnsType>(256)), "UNKNOWN");
39}
40
41BOOST_AUTO_TEST_SUITE_END()
42
43} // namespace tests
44} // namespace ndns
45} // namespace ndn