Skip to content
Snippets Groups Projects
Commit e7f804a5 authored by Toby Murray's avatar Toby Murray
Browse files

tweaks trying to maximise coverage in fuzzer generated test corpus

parent 9088064a
No related branches found
No related tags found
No related merge requests found
#ifndef _DEBUG_H_
#define _DEBUG_H_
#ifndef NDEBUG
#include <stdio.h>
#define debug_printf(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug_printf(...)
#endif
#endif
......@@ -298,7 +298,7 @@ nodeptr_list_t list_dequeue(nodeptr_list_t lst, const node_t **out){
}
}
#ifdef UNUSED_FUNCTIONS
nodeptr_list_t list_destroy(nodeptr_list_t lst){
while (lst.head != NULL){
lst = list_pop(lst,NULL);
......@@ -325,7 +325,7 @@ void list_print_rev(nodeptr_list_t lst){
}
printf("End list reverse print.\n\n");
}
#endif
/* in order traversal to print out nodes in sorted order */
void print_inorder(const node_t *p){
......@@ -483,7 +483,7 @@ static int run(FILE *f){
}
if (inst[MAX_LINE_LENGTH] != '\0'){
if (!(inst[MAX_LINE_LENGTH] == '\n' && inst[MAX_LINE_LENGTH+1] == '\0')){
debug_printf("Line %d exceeds maximum length (%d)\n",instructionCount+1,MAX_LINE_LENGTH);
fprintf(stderr,"Line %d exceeds maximum length (%d)\n",instructionCount+1,MAX_LINE_LENGTH);
debug_printf("(Expected at array index %d to find NUL but found '%c' (%d))\n",MAX_LINE_LENGTH,inst[MAX_LINE_LENGTH],inst[MAX_LINE_LENGTH]);
fclose(f);
return -1;
......@@ -518,7 +518,7 @@ static int run(FILE *f){
char c;
int res = fread(&c,1,1,f);
if (res == 1){
debug_printf("Number of instructions (lines) in file exceeds max (%d)\n",MAX_INSTRUCTIONS);
fprintf(stderr,"Number of instructions (lines) in file exceeds max (%d)\n",MAX_INSTRUCTIONS);
fclose(f);
return -1;
}else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment