diff --git a/tests/run-dumper.c b/tests/run-dumper.c index 302b9b96..04c5beea 100644 --- a/tests/run-dumper.c +++ b/tests/run-dumper.c @@ -79,10 +79,12 @@ int copy_document(yaml_document_t *document_to, yaml_document_t *document_from) int compare_nodes(yaml_document_t *document1, int index1, yaml_document_t *document2, int index2, int level) { - if (level++ > 1000) return 0; - yaml_node_t *node1 = yaml_document_get_node(document1, index1); - yaml_node_t *node2 = yaml_document_get_node(document2, index2); int k; + yaml_node_t *node1; + yaml_node_t *node2; + if (level++ > 1000) return 0; + node1 = yaml_document_get_node(document1, index1); + node2 = yaml_document_get_node(document2, index2); assert(node1); assert(node2); diff --git a/tests/run-emitter-test-suite.c b/tests/run-emitter-test-suite.c index 6c599e85..f24bb09d 100644 --- a/tests/run-emitter-test-suite.c +++ b/tests/run-emitter-test-suite.c @@ -2,10 +2,9 @@ #include #include -#include #include -bool get_line(FILE * input, char *line); +int get_line(FILE * input, char *line); char *get_anchor(char sigil, char *line, char *anchor); char *get_tag(char *line, char *tag); void get_value(char *line, char *value, int *style); @@ -134,12 +133,12 @@ int main(int argc, char *argv[]) return 1; } -bool get_line(FILE * input, char *line) +int get_line(FILE * input, char *line) { char *newline; if (!fgets(line, 1024 - 1, input)) - return false; + return 0; if ((newline = strchr(line, '\n')) == NULL) { fprintf(stderr, "Line too long: '%s'", line); @@ -147,7 +146,7 @@ bool get_line(FILE * input, char *line) } *newline = '\0'; - return true; + return 1; } char *get_anchor(char sigil, char *line, char *anchor)