void integrity(long num) { long* x1; long* x2; long i; bpt* b; b = bpt_new(NULL); assert("creation failed:" && b); x1 = malloc(sizeof(long) * num); x2 = malloc(sizeof(long) * num); for (i = 1; i <= num; i++) { x1[i - 1] = i * 2; x2[i - 1] = (i * 2) + 1; } shuffle(x1, num); shuffle(x2, num); bpt_insert_check(b, x1, num); bpt_insert_check(b, x2, num); bpt_size_check(b, num * 2); bpt_query_check(b, x1, num); bpt_query_check(b, x2, num); // printf("insert1 pass\n"); shuffle(x1, num); bpt_delete_check(b, x1, num); bpt_size_check(b, num); bpt_query_check(b, x2, num); // printf("delete1 pass\n"); /* shuffle(x1, num); bpt_insert_check(b, x1, num); bpt_size_check(b, num * 2); bpt_query_check(b, x1, num); bpt_query_check(b, x2, num); printf("insert2 pass\n"); shuffle(x1, num); shuffle(x2, num); bpt_delete_check(b, x1, num); bpt_delete_check(b, x2, num); bpt_empty_check(b); printf("delete2 pass\n"); */ bpt_destroy(b); free(x1); free(x2); // printf("integrity check passed\n"); }
void pdf_obj_free() { pdf_map * m = parser_inst->map;//&a_pdf_map; pdf_map *i = m; if (!parser_inst && !parser_inst->map) return; for (; i != 0; i = i->next) { /* delete obj tree nodes */ bpt_delete_node(i->head, (leaf_action)pdf_obj_delete); } i = m; for (; i!=0; i=i->next) { /* delete obj tree */ bpt_destroy(i->head); pdf_free(i->head); } }