From: Sven Verdoolaege Date: Sun, 24 Jan 2010 13:23:06 +0000 (+0100) Subject: isl_test: use isl_set_read_from_str X-Git-Tag: isl-0.02~146 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3b67481ffc3d191c46e8af05feb55bf5b8b763f;p=platform%2Fupstream%2Fisl.git isl_test: use isl_set_read_from_str --- diff --git a/isl_test.c b/isl_test.c index 2823e2d..58f5e3a 100644 --- a/isl_test.c +++ b/isl_test.c @@ -506,80 +506,76 @@ void test_gist(struct isl_ctx *ctx) test_gist_case(ctx, "gist1"); } -static struct isl_set *s_union(struct isl_ctx *ctx, - const char *s1, const char *s2) -{ - struct isl_basic_set *bset1; - struct isl_basic_set *bset2; - struct isl_set *set1, *set2; - - bset1 = isl_basic_set_read_from_str(ctx, s1, 0); - bset2 = isl_basic_set_read_from_str(ctx, s2, 0); - set1 = isl_set_from_basic_set(bset1); - set2 = isl_set_from_basic_set(bset2); - return isl_set_union(set1, set2); -} - void test_coalesce(struct isl_ctx *ctx) { struct isl_set *set; - set = s_union(ctx, "{[x,y]: x >= 0 & x <= 10 & y >= 0 & y <= 10}", - "{[x,y]: y >= x & x >= 2 & 5 >= y}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: x >= 0 & x <= 10 & y >= 0 & y <= 10 or " + "y >= x & x >= 2 & 5 >= y }", -1); set = isl_set_coalesce(set); assert(set && set->n == 1); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & 2x + y <= 30 & y <= 10 & x >= 0}", - "{[x,y]: x + y >= 10 & y <= x & x + y <= 20 & y >= 0}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & 2x + y <= 30 & y <= 10 & x >= 0 or " + "x + y >= 10 & y <= x & x + y <= 20 & y >= 0}", -1); set = isl_set_coalesce(set); assert(set && set->n == 1); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & 2x + y <= 30 & y <= 10 & x >= 0}", - "{[x,y]: x + y >= 10 & y <= x & x + y <= 19 & y >= 0}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & 2x + y <= 30 & y <= 10 & x >= 0 or " + "x + y >= 10 & y <= x & x + y <= 19 & y >= 0}", -1); set = isl_set_coalesce(set); assert(set && set->n == 2); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & x <= 5 & y <= x}", - "{[x,y]: y >= 0 & x >= 6 & x <= 10 & y <= x}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & x <= 5 & y <= x or " + "y >= 0 & x >= 6 & x <= 10 & y <= x}", -1); set = isl_set_coalesce(set); assert(set && set->n == 1); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & x <= 5 & y <= x}", - "{[x,y]: y >= 0 & x >= 7 & x <= 10 & y <= x}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & x <= 5 & y <= x or " + "y >= 0 & x >= 7 & x <= 10 & y <= x}", -1); set = isl_set_coalesce(set); assert(set && set->n == 2); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & x <= 5 & y <= x}", - "{[x,y]: y >= 0 & x >= 6 & x <= 10 & y + 1 <= x}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & x <= 5 & y <= x or " + "y >= 0 & x >= 6 & x <= 10 & y + 1 <= x}", -1); set = isl_set_coalesce(set); assert(set && set->n == 2); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & x <= 5 & y <= x}", - "{[x,y]: y >= 0 & x = 6 & y <= 6}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & x <= 5 & y <= x or " + "y >= 0 & x = 6 & y <= 6}", -1); set = isl_set_coalesce(set); assert(set && set->n == 1); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & x <= 5 & y <= x}", - "{[x,y]: y >= 0 & x = 7 & y <= 6}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & x <= 5 & y <= x or " + "y >= 0 & x = 7 & y <= 6}", -1); set = isl_set_coalesce(set); assert(set && set->n == 2); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & x <= 5 & y <= x}", - "{[x,y]: y >= 0 & x = 6 & y <= 5}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & x <= 5 & y <= x or " + "y >= 0 & x = 6 & y <= 5}", -1); set = isl_set_coalesce(set); assert(set && set->n == 2); isl_set_free(set); - set = s_union(ctx, "{[x,y]: y >= 0 & x <= 5 & y <= x}", - "{[x,y]: y >= 0 & x = 6 & y <= 7}"); + set = isl_set_read_from_str(ctx, + "{[x,y]: y >= 0 & x <= 5 & y <= x or " + "y >= 0 & x = 6 & y <= 7}", -1); set = isl_set_coalesce(set); assert(set && set->n == 2); isl_set_free(set);