Junxiao Shi | af8eeea | 2014-03-31 20:10:56 -0700 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (C) 2013 Regents of the University of California. |
| 3 | * See COPYING for copyright and distribution information. |
| 4 | */ |
| 5 | |
| 6 | #include "key-locator.hpp" |
| 7 | |
Alexander Afanasyev | b1db7c6 | 2014-04-03 14:57:25 -0700 | [diff] [blame^] | 8 | #include "boost-test.hpp" |
Junxiao Shi | af8eeea | 2014-03-31 20:10:56 -0700 | [diff] [blame] | 9 | |
| 10 | namespace ndn { |
| 11 | |
| 12 | BOOST_AUTO_TEST_SUITE(TestKeyLocator) |
| 13 | |
| 14 | BOOST_AUTO_TEST_CASE(Equality) |
| 15 | { |
| 16 | BOOST_CONCEPT_ASSERT((boost::EqualityComparable<KeyLocator>)); |
| 17 | |
| 18 | KeyLocator a; |
| 19 | KeyLocator b; |
| 20 | BOOST_CHECK_EQUAL(a == b, true); |
| 21 | BOOST_CHECK_EQUAL(a != b, false); |
| 22 | |
| 23 | a.setName("ndn:/A"); |
| 24 | BOOST_CHECK_EQUAL(a == b, false); |
| 25 | BOOST_CHECK_EQUAL(a != b, true); |
| 26 | |
| 27 | b.setName("ndn:/B"); |
| 28 | BOOST_CHECK_EQUAL(a == b, false); |
| 29 | BOOST_CHECK_EQUAL(a != b, true); |
| 30 | |
| 31 | b.setName("ndn:/A"); |
| 32 | BOOST_CHECK_EQUAL(a == b, true); |
| 33 | BOOST_CHECK_EQUAL(a != b, false); |
| 34 | } |
| 35 | |
| 36 | BOOST_AUTO_TEST_SUITE_END() |
| 37 | |
| 38 | } // namespace ndn |