9 void test_convex_hull_case(struct isl_ctx *ctx, const char *name)
11 char filename[PATH_MAX];
14 struct isl_basic_set *bset1, *bset2;
17 n = snprintf(filename, sizeof(filename),
18 "%s/test_inputs/%s.polylib", srcdir, name);
19 assert(n < sizeof(filename));
20 input = fopen(filename, "r");
23 bset1 = isl_basic_set_read_from_file(ctx, input, ISL_FORMAT_POLYLIB);
24 bset2 = isl_basic_set_read_from_file(ctx, input, ISL_FORMAT_POLYLIB);
26 set = isl_basic_set_union(ctx, bset1, bset2);
27 bset1 = isl_set_convex_hull(ctx, set);
29 bset2 = isl_basic_set_read_from_file(ctx, input, ISL_FORMAT_POLYLIB);
31 assert(isl_basic_set_is_equal(ctx, bset1, bset2) == 1);
33 isl_basic_set_free(ctx, bset1);
34 isl_basic_set_free(ctx, bset2);
39 void test_convex_hull(struct isl_ctx *ctx)
41 test_convex_hull_case(ctx, "convex0");
42 test_convex_hull_case(ctx, "convex1");
43 test_convex_hull_case(ctx, "convex2");
44 test_convex_hull_case(ctx, "convex3");
45 test_convex_hull_case(ctx, "convex4");
46 test_convex_hull_case(ctx, "convex5");
47 test_convex_hull_case(ctx, "convex6");
48 test_convex_hull_case(ctx, "convex7");
55 srcdir = getenv("srcdir");
57 ctx = isl_ctx_alloc();
58 test_convex_hull(ctx);