blob: 00f4ff9bbe1a4a49c388a7eabe3a721b42988bde [file] [log] [blame]
Junxiao Shiaf8eeea2014-03-31 20:10:56 -07001/**
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
11namespace ndn {
12
13BOOST_AUTO_TEST_SUITE(TestKeyLocator)
14
15BOOST_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
37BOOST_AUTO_TEST_SUITE_END()
38
39} // namespace ndn