END_TEST START_TEST (test_line_parallel) { float nan = 0; line_destroy (m); // lol misusing test fixtures :( m = line_create (7234.0, 725.23, 0.0003, -12.6); nan = line_findIntersection (m, l, LINE_SETINTERSECTION); fail_unless ( line_countTvals (m) == 0 && line_countTvals (l) == 0, "Parallel lines do not intersect; they must not create intersection points on either line." ); fail_unless ( nan != nan, "Functions which return a t value for intersection must return NaN when lines do not intersect."); }
/* void line_list_delete(line_list_t *list) { dlink_t *link; line_t *line; assert(list); for (link = list->tail->next; link != list->head; link = link->next) { line = (line_t *)link->object; line_(line); } } */ void line_list_destroy(line_list_t *list) { dlink_t *link; assert(list); if (line_list_get_ref(list) <= 0) { while (line_list_get_count(list) > 0) { link = dlist_pop((dlist_t *)list); line_destroy((line_t *)link->object); dlink_destroy(link); } dlist_destroy((dlist_t *)list); } else { line_list_dec_ref(list); } }
void intersect_teardown (void) { line_destroy (l); line_destroy (m); l = m = NULL; }
void lengthen_teardown (void) { line_destroy (j); j = NULL; }
void base_teardown (void) { line_destroy (l); l = NULL; }