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 | |
| 8 | #include <boost/test/unit_test.hpp> |
| 9 | #include <boost/concept_check.hpp> |
| 10 | |
| 11 | namespace ndn { |
| 12 | |
| 13 | BOOST_AUTO_TEST_SUITE(TestKeyLocator) |
| 14 | |
| 15 | BOOST_AUTO_TEST_CASE(Equality) |
| 16 | { |
| 17 | BOOST_CONCEPT_ASSERT((boost::EqualityComparable<KeyLocator>)); |
| 18 | |
| 19 | KeyLocator a; |
| 20 | KeyLocator b; |
| 21 | BOOST_CHECK_EQUAL(a == b, true); |
| 22 | BOOST_CHECK_EQUAL(a != b, false); |
| 23 | |
| 24 | a.setName("ndn:/A"); |
| 25 | BOOST_CHECK_EQUAL(a == b, false); |
| 26 | BOOST_CHECK_EQUAL(a != b, true); |
| 27 | |
| 28 | b.setName("ndn:/B"); |
| 29 | BOOST_CHECK_EQUAL(a == b, false); |
| 30 | BOOST_CHECK_EQUAL(a != b, true); |
| 31 | |
| 32 | b.setName("ndn:/A"); |
| 33 | BOOST_CHECK_EQUAL(a == b, true); |
| 34 | BOOST_CHECK_EQUAL(a != b, false); |
| 35 | } |
| 36 | |
| 37 | BOOST_AUTO_TEST_SUITE_END() |
| 38 | |
| 39 | } // namespace ndn |