+/* Assumes json_error_t error */
+#define check_error(text_, source_, line_, column_, position_) \
+ do { \
+ if(strcmp(error.text, text_) != 0) { \
+ failhdr; \
+ fprintf(stderr, "text: \"%s\" != \"%s\"\n", error.text, text_); \
+ exit(1); \
+ } \
+ if(strcmp(error.source, source_) != 0) { \
+ failhdr; \
+ \
+ fprintf(stderr, "source: \"%s\" != \"%s\"\n", error.source, source_); \
+ exit(1); \
+ } \
+ if(error.line != line_) { \
+ failhdr; \
+ fprintf(stderr, "line: %d != %d\n", error.line, line_); \
+ exit(1); \
+ } \
+ if(error.column != column_) { \
+ failhdr; \
+ fprintf(stderr, "column: %d != %d\n", error.column, column_); \
+ exit(1); \
+ } \
+ if(error.position != position_) { \
+ failhdr; \
+ fprintf(stderr, "position: %d != %d\n", error.position, position_); \
+ exit(1); \
+ } \
+ } while(0)
+