Files
NLSR/tests/test-tokenizer.cpp
T
Ashlesh Gawande eb582eb919 tests: Adding unit tests.
The purpose of this commit is to start pushing unit test I am writing. I will add more unit tests in each patch

Refs: #1496

Change-Id: Ic132adddfa06a95780712eba63966d3bab4743af
2014-05-01 14:47:06 -05:00

35 lines
781 B
C++

/**
* Copyright (C) 2014 Regents of the University of Memphis.
* See COPYING for copyright and distribution information.
*/
#include "utility/tokenizer.hpp"
#include <boost/test/unit_test.hpp>
namespace nlsr {
namespace test {
BOOST_AUTO_TEST_SUITE(TestTokenizer)
BOOST_AUTO_TEST_CASE(TokenizerBasic)
{
Tokenizer token1("/ndn/memphis.edu/cs", "/");
Tokenizer token2("/ndn/memphis.edu/cs", "/");
Tokenizer token3("/test/hello");
BOOST_CHECK(token1.getFirstToken() == token2.getFirstToken());
BOOST_CHECK_EQUAL(token1.getRestOfLine(), token2.getRestOfLine());
BOOST_CHECK(token1.getFirstToken() != token3.getFirstToken());
BOOST_CHECK(token1.getRestOfLine() != token3.getRestOfLine());
}
BOOST_AUTO_TEST_SUITE_END()
} //namespace test
} //namespace nlsr