don't skip tests on compile failure anymore
This commit is contained in:
parent
932c9717d7
commit
d3fd0da7b7
1 changed files with 22 additions and 7 deletions
|
|
@ -90,7 +90,8 @@
|
||||||
#define g_check_parse_failed(parser, backend, input, inp_len) do { \
|
#define g_check_parse_failed(parser, backend, input, inp_len) do { \
|
||||||
int skip = h_compile((HParser *)(parser), (HParserBackend)backend, NULL); \
|
int skip = h_compile((HParser *)(parser), (HParserBackend)backend, NULL); \
|
||||||
if(skip != 0) { \
|
if(skip != 0) { \
|
||||||
g_test_message("Backend not applicable, skipping test"); \
|
g_test_message("Compile failed"); \
|
||||||
|
g_test_fail(); \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
const HParseResult *result = h_parse(parser, (const uint8_t*)input, inp_len); \
|
const HParseResult *result = h_parse(parser, (const uint8_t*)input, inp_len); \
|
||||||
|
|
@ -103,7 +104,8 @@
|
||||||
#define g_check_parse_ok(parser, backend, input, inp_len) do { \
|
#define g_check_parse_ok(parser, backend, input, inp_len) do { \
|
||||||
int skip = h_compile((HParser *)(parser), (HParserBackend) backend, NULL); \
|
int skip = h_compile((HParser *)(parser), (HParserBackend) backend, NULL); \
|
||||||
if(skip) { \
|
if(skip) { \
|
||||||
g_test_message("Backend not applicable, skipping test"); \
|
g_test_message("Compile failed"); \
|
||||||
|
g_test_fail(); \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
HParseResult *res = h_parse(parser, (const uint8_t*)input, inp_len); \
|
HParseResult *res = h_parse(parser, (const uint8_t*)input, inp_len); \
|
||||||
|
|
@ -124,7 +126,8 @@
|
||||||
#define g_check_parse_match(parser, backend, input, inp_len, result) do { \
|
#define g_check_parse_match(parser, backend, input, inp_len, result) do { \
|
||||||
int skip = h_compile((HParser *)(parser), (HParserBackend) backend, NULL); \
|
int skip = h_compile((HParser *)(parser), (HParserBackend) backend, NULL); \
|
||||||
if(skip) { \
|
if(skip) { \
|
||||||
g_test_message("Backend not applicable, skipping test"); \
|
g_test_message("Compile failed"); \
|
||||||
|
g_test_fail(); \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
HParseResult *res = h_parse(parser, (const uint8_t*)input, inp_len); \
|
HParseResult *res = h_parse(parser, (const uint8_t*)input, inp_len); \
|
||||||
|
|
@ -147,9 +150,15 @@
|
||||||
|
|
||||||
#define g_check_parse_chunks_failed(parser, backend, chunk1, c1_len, chunk2, c2_len) do { \
|
#define g_check_parse_chunks_failed(parser, backend, chunk1, c1_len, chunk2, c2_len) do { \
|
||||||
int skip = h_compile((HParser *)(parser), (HParserBackend)backend, NULL); \
|
int skip = h_compile((HParser *)(parser), (HParserBackend)backend, NULL); \
|
||||||
|
if(skip) { \
|
||||||
|
g_test_message("Compile failed"); \
|
||||||
|
g_test_fail(); \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
HSuspendedParser *s = h_parse_start(parser); \
|
HSuspendedParser *s = h_parse_start(parser); \
|
||||||
if(skip || !s) { \
|
if(!s) { \
|
||||||
g_test_message("Backend not applicable, skipping test"); \
|
g_test_message("Chunk-wise parsing not available"); \
|
||||||
|
g_test_fail(); \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
h_parse_chunk(s, (const uint8_t*)chunk1, c1_len); \
|
h_parse_chunk(s, (const uint8_t*)chunk1, c1_len); \
|
||||||
|
|
@ -163,9 +172,15 @@
|
||||||
|
|
||||||
#define g_check_parse_chunks_match(parser, backend, chunk1, c1_len, chunk2, c2_len, result) do { \
|
#define g_check_parse_chunks_match(parser, backend, chunk1, c1_len, chunk2, c2_len, result) do { \
|
||||||
int skip = h_compile((HParser *)(parser), (HParserBackend) backend, NULL); \
|
int skip = h_compile((HParser *)(parser), (HParserBackend) backend, NULL); \
|
||||||
|
if(skip) { \
|
||||||
|
g_test_message("Compile failed"); \
|
||||||
|
g_test_fail(); \
|
||||||
|
break; \
|
||||||
|
} \
|
||||||
HSuspendedParser *s = h_parse_start(parser); \
|
HSuspendedParser *s = h_parse_start(parser); \
|
||||||
if(skip || !s) { \
|
if(!s) { \
|
||||||
g_test_message("Backend not applicable, skipping test"); \
|
g_test_message("Chunk-wise parsing not available"); \
|
||||||
|
g_test_fail(); \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
h_parse_chunk(s, (const uint8_t*)chunk1, c1_len); \
|
h_parse_chunk(s, (const uint8_t*)chunk1, c1_len); \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue