X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=tst%2Fio%2FTokenTest.hpp;fp=tst%2Fio%2FTokenTest.hpp;h=3f50050b93b501a60c570a3379333459f4a33217;hb=34e833025f0616ab4b86b808d0ce1cc49cecce5d;hp=0000000000000000000000000000000000000000;hpb=698d8120797383886d1386d3a8ac4b5fc1ca7f16;p=blobs.git diff --git a/tst/io/TokenTest.hpp b/tst/io/TokenTest.hpp new file mode 100644 index 0000000..3f50050 --- /dev/null +++ b/tst/io/TokenTest.hpp @@ -0,0 +1,61 @@ +#ifndef BLOBS_TEST_IO_TOKENTEST_HPP +#define BLOBS_TEST_IO_TOKENTEST_HPP + +#include "io/Token.hpp" +#include "io/Tokenizer.hpp" + +#include +#include + + +namespace blobs { +namespace io { +namespace test { + +class TokenTest +: public CppUnit::TestFixture { + +CPPUNIT_TEST_SUITE(TokenTest); + +CPPUNIT_TEST(testTypeIO); +CPPUNIT_TEST(testTokenIO); +CPPUNIT_TEST(testTokenizer); +CPPUNIT_TEST(testTokenizerBrokenComment); +CPPUNIT_TEST(testReader); +CPPUNIT_TEST(testReaderEmpty); +CPPUNIT_TEST(testReaderMalformed); + +CPPUNIT_TEST_SUITE_END(); + +public: + void setUp(); + void tearDown(); + + void testTypeIO(); + void testTokenIO(); + void testTokenizer(); + void testTokenizerBrokenComment(); + + void testReader(); + void testReaderEmpty(); + void testReaderMalformed(); + + static void AssertStreamOutput( + Token::Type, std::string expected); + static void AssertStreamOutput( + const Token &, std::string expected); + + static void AssertHasMore(Tokenizer &); + static void AssertToken( + Token::Type expected_type, const Token &actual_token); + static void AssertToken( + Token::Type expected_type, std::string expected_value, + const Token &actual_token); + +}; + +} +} +} + +#endif