static int check_edits(trie_dict *t, string word, int edits, rb_tree *suggs){ if(edits > 0){ // DEBUG_PRINTF("checking %.*s (%d edits)\n",(int)word.len,word.str,edits); check_subs(t, word, edits, suggs); if(add_delete){ DEBUG_PRINTF("checking adds and deletes"); check_adds(t, word, edits, suggs); check_dels(t, word, edits, suggs); } } return 0; }
void test_subs(int matrix[HEIGHT][WIDTH], int expected_value) { test( check_subs(matrix) == expected_value ? "Pass" : "Fail" ); }