blob: 23d1593fa08ba172207146831f8df785839fb24a [file] [log] [blame]
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Junxiao Shiaf8eeea2014-03-31 20:10:56 -07002/**
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07003 * 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 Shiaf8eeea2014-03-31 20:10:56 -070011 */
12
13#include "key-locator.hpp"
14
Alexander Afanasyevb1db7c62014-04-03 14:57:25 -070015#include "boost-test.hpp"
Junxiao Shiaf8eeea2014-03-31 20:10:56 -070016
17namespace ndn {
18
19BOOST_AUTO_TEST_SUITE(TestKeyLocator)
20
21BOOST_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
43BOOST_AUTO_TEST_SUITE_END()
44
45} // namespace ndn