]> git.localhorst.tv Git - blobs.git/blob - tst/io/TokenTest.hpp
new glm version
[blobs.git] / tst / io / TokenTest.hpp
1 #ifndef BLOBS_TEST_IO_TOKENTEST_HPP
2 #define BLOBS_TEST_IO_TOKENTEST_HPP
3
4 #include "io/Token.hpp"
5 #include "io/Tokenizer.hpp"
6
7 #include <string>
8 #include <cppunit/extensions/HelperMacros.h>
9
10
11 namespace blobs {
12 namespace io {
13 namespace test {
14
15 class TokenTest
16 : public CppUnit::TestFixture {
17
18 CPPUNIT_TEST_SUITE(TokenTest);
19
20 CPPUNIT_TEST(testTypeIO);
21 CPPUNIT_TEST(testTokenIO);
22 CPPUNIT_TEST(testTokenizer);
23 CPPUNIT_TEST(testTokenizerBrokenComment);
24 CPPUNIT_TEST(testReader);
25 CPPUNIT_TEST(testReaderEmpty);
26 CPPUNIT_TEST(testReaderMalformed);
27
28 CPPUNIT_TEST_SUITE_END();
29
30 public:
31         void setUp();
32         void tearDown();
33
34         void testTypeIO();
35         void testTokenIO();
36         void testTokenizer();
37         void testTokenizerBrokenComment();
38
39         void testReader();
40         void testReaderEmpty();
41         void testReaderMalformed();
42
43         static void AssertStreamOutput(
44                 Token::Type, std::string expected);
45         static void AssertStreamOutput(
46                 const Token &, std::string expected);
47
48         static void AssertHasMore(Tokenizer &);
49         static void AssertToken(
50                 Token::Type expected_type, const Token &actual_token);
51         static void AssertToken(
52                 Token::Type expected_type, std::string expected_value,
53                 const Token &actual_token);
54
55 };
56
57 }
58 }
59 }
60
61 #endif