some failing tests

This commit is contained in:
Enno Rehling 2018-10-02 19:02:22 +02:00
parent e6b93ce79a
commit b439e48a22
1 changed files with 24 additions and 3 deletions

View File

@ -36,31 +36,52 @@ static void test_parse_orders(CuTest *tc) {
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello World", 11, 1));
CuAssertStrEquals(tc, "Hello World", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello World\n", 12, 1));
CuAssertStrEquals(tc, "Hello World", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello\\\n World", 13, 1));
CuAssertStrEquals(tc, "Hello World", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello;World", 11, 1));
CuAssertStrEquals(tc, "Hello", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello\\World", 11, 1));
CuAssertStrEquals(tc, "Hello\\World", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello ", 6, 0));
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "World", 5, 1));
CuAssertStrEquals(tc, "Hello World", lastline);
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, ";Hello \\", 8, 0));
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "\nWorld\n", 7, 1));
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Enno", 4, 1));
CuAssertStrEquals(tc, "Enno", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, ";Hello", 6, 0));
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "World\n", 6, 1));
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Enno", 4, 1));
CuAssertStrEquals(tc, "Enno", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello\\World \\", 14, 1));
CuAssertStrEquals(tc, "Hello\\World ", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello\n", 6, 0));
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "World\n", 6, 1));
CuAssertStrEquals(tc, "World", lastline);
OP_ParserReset(parser);
lastline[0] = 0;
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "Hello \\", 7, 0));
CuAssertIntEquals(tc, OP_STATUS_OK, OP_Parse(parser, "\nWorld", 6, 1));