Skip to content

Commit 0122490

Browse files
committed
Undefine the NDEBUG directive for the test programs.
1 parent 071329a commit 0122490

File tree

7 files changed

+33
-3
lines changed

7 files changed

+33
-3
lines changed

tests/run-dumper.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
#include <stdlib.h>
44
#include <stdio.h>
5-
#include <assert.h>
65
#include <string.h>
76

7+
#ifdef NDEBUG
8+
#undef NDEBUG
9+
#endif
10+
#include <assert.h>
11+
812
#define BUFFER_SIZE 65536
913
#define MAX_DOCUMENTS 16
1014

@@ -114,7 +118,9 @@ int compare_nodes(yaml_document_t *document1, int index1,
114118
document2, node2->data.mapping.pairs.start[k].value)) return 0;
115119
}
116120
break;
117-
121+
default:
122+
assert(0);
123+
break;
118124
}
119125
return 1;
120126
}

tests/run-emitter.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
#include <stdlib.h>
44
#include <stdio.h>
5-
#include <assert.h>
65
#include <string.h>
76

7+
#ifdef NDEBUG
8+
#undef NDEBUG
9+
#endif
10+
#include <assert.h>
11+
812
#define BUFFER_SIZE 65536
913
#define MAX_EVENTS 1024
1014

tests/run-loader.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
#include <stdlib.h>
44
#include <stdio.h>
5+
6+
#ifdef NDEBUG
7+
#undef NDEBUG
8+
#endif
59
#include <assert.h>
610

711
int

tests/run-parser.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
#include <stdlib.h>
44
#include <stdio.h>
5+
6+
#ifdef NDEBUG
7+
#undef NDEBUG
8+
#endif
59
#include <assert.h>
610

711
int

tests/run-scanner.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
#include <stdlib.h>
44
#include <stdio.h>
5+
6+
#ifdef NDEBUG
7+
#undef NDEBUG
8+
#endif
59
#include <assert.h>
610

711
int

tests/test-reader.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length);
55

66
#include <stdlib.h>
77
#include <stdio.h>
8+
9+
#ifdef NDEBUG
10+
#undef NDEBUG
11+
#endif
812
#include <assert.h>
913

1014
/*

tests/test-version.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
#include <stdlib.h>
44
#include <stdio.h>
5+
6+
#ifdef NDEBUG
7+
#undef NDEBUG
8+
#endif
59
#include <assert.h>
610

711
int

0 commit comments

Comments
 (0)