Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame^] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
Junxiao Shi | af8eeea | 2014-03-31 20:10:56 -0700 | [diff] [blame] | 2 | /** |
Alexander Afanasyev | dfa52c4 | 2014-04-24 21:10:11 -0700 | [diff] [blame^] | 3 | * Copyright (c) 2013-2014, Regents of the University of California. |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). |
| 7 | * See AUTHORS.md for complete list of ndn-cxx authors and contributors. |
| 8 | * |
| 9 | * This file licensed under New BSD License. See COPYING for detailed information about |
| 10 | * ndn-cxx library copyright, permissions, and redistribution restrictions. |
Junxiao Shi | af8eeea | 2014-03-31 20:10:56 -0700 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #include "key-locator.hpp" |
| 14 | |
Alexander Afanasyev | b1db7c6 | 2014-04-03 14:57:25 -0700 | [diff] [blame] | 15 | #include "boost-test.hpp" |
Junxiao Shi | af8eeea | 2014-03-31 20:10:56 -0700 | [diff] [blame] | 16 | |
| 17 | namespace ndn { |
| 18 | |
| 19 | BOOST_AUTO_TEST_SUITE(TestKeyLocator) |
| 20 | |
| 21 | BOOST_AUTO_TEST_CASE(Equality) |
| 22 | { |
| 23 | BOOST_CONCEPT_ASSERT((boost::EqualityComparable<KeyLocator>)); |
| 24 | |
| 25 | KeyLocator a; |
| 26 | KeyLocator b; |
| 27 | BOOST_CHECK_EQUAL(a == b, true); |
| 28 | BOOST_CHECK_EQUAL(a != b, false); |
| 29 | |
| 30 | a.setName("ndn:/A"); |
| 31 | BOOST_CHECK_EQUAL(a == b, false); |
| 32 | BOOST_CHECK_EQUAL(a != b, true); |
| 33 | |
| 34 | b.setName("ndn:/B"); |
| 35 | BOOST_CHECK_EQUAL(a == b, false); |
| 36 | BOOST_CHECK_EQUAL(a != b, true); |
| 37 | |
| 38 | b.setName("ndn:/A"); |
| 39 | BOOST_CHECK_EQUAL(a == b, true); |
| 40 | BOOST_CHECK_EQUAL(a != b, false); |
| 41 | } |
| 42 | |
| 43 | BOOST_AUTO_TEST_SUITE_END() |
| 44 | |
| 45 | } // namespace ndn |