diff options
author | Sven Verdoolaege <skimo@kotnet.org> | 2008-08-17 16:33:02 +0200 |
---|---|---|
committer | Sven Verdoolaege <skimo@kotnet.org> | 2008-08-25 10:15:08 +0200 |
commit | 07463aa4448ef62ce9994c36411d23dbfdca294d (patch) | |
tree | 7d64ce334a4af8ba04099f0a415292a24bbd9047 /isl_test.c | |
parent | 6ee7c30d7fedfd81f6254fe15534a154ce7624a1 (diff) | |
download | isl-07463aa4448ef62ce9994c36411d23dbfdca294d.tar.gz isl-07463aa4448ef62ce9994c36411d23dbfdca294d.tar.bz2 isl-07463aa4448ef62ce9994c36411d23dbfdca294d.zip |
add trivial affine hull test
Diffstat (limited to 'isl_test.c')
-rw-r--r-- | isl_test.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -6,6 +6,32 @@ static char *srcdir; +void test_affine_hull(struct isl_ctx *ctx) +{ + char filename[PATH_MAX]; + FILE *input; + int n; + struct isl_basic_set *bset1, *bset2; + + n = snprintf(filename, sizeof(filename), + "%s/test_inputs/affine.polylib", srcdir); + assert(n < sizeof(filename)); + input = fopen(filename, "r"); + assert(input); + + bset1 = isl_basic_set_read_from_file(ctx, input, ISL_FORMAT_POLYLIB); + bset2 = isl_basic_set_read_from_file(ctx, input, ISL_FORMAT_POLYLIB); + + bset1 = isl_basic_set_affine_hull(ctx, bset1); + + assert(isl_basic_set_is_equal(ctx, bset1, bset2) == 1); + + isl_basic_set_free(ctx, bset1); + isl_basic_set_free(ctx, bset2); + + fclose(input); +} + void test_convex_hull_case(struct isl_ctx *ctx, const char *name) { char filename[PATH_MAX]; @@ -55,6 +81,7 @@ int main() srcdir = getenv("srcdir"); ctx = isl_ctx_alloc(); + test_affine_hull(ctx); test_convex_hull(ctx); isl_ctx_free(ctx); return 0; |