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" |
Alexander Afanasyev | bd220a0 | 2014-02-20 00:29:56 -0800 | [diff] [blame] | 8 | #include "face/local-face.hpp" |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 9 | #include "dummy-face.hpp" |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 10 | |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 11 | #include "tests/test-common.hpp" |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 12 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 13 | namespace nfd { |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 14 | namespace tests { |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 15 | |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 16 | BOOST_FIXTURE_TEST_SUITE(FaceFace, BaseFixture) |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 17 | |
Junxiao Shi | 32bfeb3 | 2014-01-25 18:22:02 -0700 | [diff] [blame] | 18 | BOOST_AUTO_TEST_CASE(Description) |
| 19 | { |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 20 | DummyFace face; |
Junxiao Shi | 32bfeb3 | 2014-01-25 18:22:02 -0700 | [diff] [blame] | 21 | face.setDescription("3pFsKrvWr"); |
| 22 | BOOST_CHECK_EQUAL(face.getDescription(), "3pFsKrvWr"); |
| 23 | } |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 24 | |
Junxiao Shi | 16b8bc9 | 2014-02-17 22:24:55 -0700 | [diff] [blame] | 25 | BOOST_AUTO_TEST_CASE(LocalControlHeaderEnabled) |
| 26 | { |
Alexander Afanasyev | bd220a0 | 2014-02-20 00:29:56 -0800 | [diff] [blame] | 27 | DummyLocalFace face; |
Junxiao Shi | 16b8bc9 | 2014-02-17 22:24:55 -0700 | [diff] [blame] | 28 | |
| 29 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), false); |
| 30 | |
| 31 | face.setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID, true); |
| 32 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), true); |
| 33 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled( |
| 34 | LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID), true); |
| 35 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled( |
| 36 | LOCAL_CONTROL_HEADER_FEATURE_NEXTHOP_FACEID), false); |
| 37 | |
| 38 | face.setLocalControlHeaderFeature(LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID, false); |
| 39 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled(), false); |
| 40 | BOOST_CHECK_EQUAL(face.isLocalControlHeaderEnabled( |
| 41 | LOCAL_CONTROL_HEADER_FEATURE_IN_FACEID), false); |
| 42 | } |
| 43 | |
Junxiao Shi | 7860d48 | 2014-02-21 23:57:20 -0700 | [diff] [blame] | 44 | BOOST_AUTO_TEST_CASE(Counters) |
| 45 | { |
| 46 | DummyFace face; |
| 47 | const FaceCounters& counters = face.getCounters(); |
| 48 | BOOST_CHECK_EQUAL(counters.getInInterest() , 0); |
| 49 | BOOST_CHECK_EQUAL(counters.getInData() , 0); |
| 50 | BOOST_CHECK_EQUAL(counters.getOutInterest(), 0); |
| 51 | BOOST_CHECK_EQUAL(counters.getOutData() , 0); |
| 52 | } |
| 53 | |
Junxiao Shi | 2c29f3a | 2014-01-24 19:59:00 -0700 | [diff] [blame] | 54 | BOOST_AUTO_TEST_SUITE_END() |
| 55 | |
Junxiao Shi | d9ee45c | 2014-02-27 15:38:11 -0700 | [diff] [blame] | 56 | } // namespace tests |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 57 | } // namespace nfd |