Ashlesh Gawande | eb582eb | 2014-05-01 14:25:20 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (C) 2014 Regents of the University of Memphis. |
| 3 | * See COPYING for copyright and distribution information. |
| 4 | */ |
| 5 | |
| 6 | #include "utility/tokenizer.hpp" |
| 7 | #include <boost/test/unit_test.hpp> |
| 8 | |
| 9 | namespace nlsr { |
| 10 | |
| 11 | namespace test { |
| 12 | |
| 13 | BOOST_AUTO_TEST_SUITE(TestTokenizer) |
| 14 | |
| 15 | BOOST_AUTO_TEST_CASE(TokenizerBasic) |
| 16 | { |
| 17 | Tokenizer token1("/ndn/memphis.edu/cs", "/"); |
| 18 | Tokenizer token2("/ndn/memphis.edu/cs", "/"); |
| 19 | |
| 20 | Tokenizer token3("/test/hello"); |
| 21 | |
| 22 | BOOST_CHECK(token1.getFirstToken() == token2.getFirstToken()); |
| 23 | |
| 24 | BOOST_CHECK_EQUAL(token1.getRestOfLine(), token2.getRestOfLine()); |
| 25 | |
| 26 | BOOST_CHECK(token1.getFirstToken() != token3.getFirstToken()); |
| 27 | |
| 28 | BOOST_CHECK(token1.getRestOfLine() != token3.getRestOfLine()); |
| 29 | } |
| 30 | |
| 31 | BOOST_AUTO_TEST_SUITE_END() |
| 32 | |
| 33 | } //namespace test |
| 34 | } //namespace nlsr |