Revision ccdb5257 src/tcp/test/parserTester.cpp
| b/src/tcp/test/parserTester.cpp | ||
|---|---|---|
| 6 | 6 |
#include "tcp/parser.h" |
| 7 | 7 |
#include "mapMsg.h" |
| 8 | 8 |
|
| 9 |
#include <cpptest.h> |
|
| 10 | 9 |
|
| 11 | 10 |
class ParserTester |
| 12 |
: public Test::Suite |
|
| 13 | 11 |
{
|
| 14 | 12 |
public: |
| 15 | 13 |
ParserTester(char** argv) |
| 16 | 14 |
: arg(argv[1]) |
| 17 | 15 |
{
|
| 18 |
TEST_ADD(ParserTester::tokenize_test) |
|
| 19 |
// TEST_ADD(ParserTester::stringify_test) |
|
| 20 |
// TEST_ADD(ParserTester::roundtrip_test) |
|
| 16 |
tokenize_test(); |
|
| 21 | 17 |
} |
| 22 | 18 |
|
| 23 | 19 |
|
| ... | ... | |
| 33 | 29 |
{
|
| 34 | 30 |
std::string str = "init: it=103945 mystring=\"\\\"bar you\\\"\" Hellotab=1.1 2.2 "; |
| 35 | 31 |
MapMsg mymap; |
| 36 |
TEST_ASSERT(Parser::tokenize(str, mymap));
|
|
| 32 |
assert(Parser::tokenize(str, mymap));
|
|
| 37 | 33 |
} |
| 38 | 34 |
|
| 39 | 35 |
|
| ... | ... | |
| 46 | 42 |
// std::string str = "init: it=103945 mystring=\"\\\"bar you\\\"\" Hellotab=1.1"; |
| 47 | 43 |
|
| 48 | 44 |
MapMsg mymap; |
| 49 |
TEST_ASSERT(Parser::tokenize(arg, mymap));
|
|
| 45 |
assert(Parser::tokenize(arg, mymap));
|
|
| 50 | 46 |
|
| 51 | 47 |
std::string out; |
| 52 |
TEST_ASSERT(Parser::stringify(mymap, out));
|
|
| 48 |
assert(Parser::stringify(mymap, out));
|
|
| 53 | 49 |
LOG_DEBUG(out); |
| 54 | 50 |
} |
| 55 | 51 |
|
| ... | ... | |
| 59 | 55 |
if (argc < 2) |
| 60 | 56 |
return -1; |
| 61 | 57 |
ParserTester pt(argv); |
| 62 |
Test::TextOutput output(Test::TextOutput::Verbose); |
|
| 63 |
return pt.run(output, false); |
|
| 64 | 58 |
} |
| 65 | 59 |
|
| 66 | 60 |
|
Also available in: Unified diff