Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2014 Named Data Networking Project |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #include "face/face.hpp" |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 8 | #include "dummy-face.hpp" |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 9 | |
| 10 | #include <boost/test/unit_test.hpp> |
| 11 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 12 | namespace nfd { |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 13 | |
| 14 | BOOST_AUTO_TEST_SUITE(FaceFace) |
| 15 | |
Junxiao Shi | 32bfeb3 | 2014-01-25 18:22:02 -0700 | [diff] [blame] | 16 | BOOST_AUTO_TEST_CASE(Description) |
| 17 | { |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 18 | DummyFace face; |
Junxiao Shi | 32bfeb3 | 2014-01-25 18:22:02 -0700 | [diff] [blame] | 19 | face.setDescription("3pFsKrvWr"); |
| 20 | BOOST_CHECK_EQUAL(face.getDescription(), "3pFsKrvWr"); |
| 21 | } |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 22 | |
Junxiao Shi | 16b8bc9 | 2014-02-17 22:24:55 -0700 | [diff] [blame] | 23 | BOOST_AUTO_TEST_CASE(LocalControlHeaderEnabled) |
| 24 | { |
| 25 | DummyFace face; |
| 26 | |
| 27 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), false); |
| 28 | |
| 29 | face.setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID, true); |
| 30 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), true); |
| 31 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled( |
| 32 | LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID), true); |
| 33 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled( |
| 34 | LOCAL_CONTROL_HEADER_FEATURE_NEXTHOP_FACEID), false); |
| 35 | |
| 36 | face.setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID, false); |
| 37 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), false); |
| 38 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled( |
| 39 | LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID), false); |
| 40 | } |
| 41 | |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 42 | BOOST_AUTO_TEST_SUITE_END() |
| 43 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 44 | } // namespace nfd |