[PPL-devel] [GIT] ppl/ppl(master): Make the test trivially succeed when coefficients are not large enough.

Roberto Bagnara bagnara at cs.unipr.it
Tue Feb 16 15:36:27 CET 2010


Module: ppl/ppl
Branch: master
Commit: 1789a22b13784e38555109169a7216d9c05cd4d8
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=1789a22b13784e38555109169a7216d9c05cd4d8

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Tue Feb 16 15:35:38 2010 +0100

Make the test trivially succeed when coefficients are not large enough.

---

 interfaces/C/tests/pip_test.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/interfaces/C/tests/pip_test.c b/interfaces/C/tests/pip_test.c
index 93b6233..42cd3a4 100644
--- a/interfaces/C/tests/pip_test.c
+++ b/interfaces/C/tests/pip_test.c
@@ -203,13 +203,21 @@ main(int argc, char **argv) {
   if (ppl_set_error_handler(error_handler) < 0)
     fatal("cannot install the custom error handler");
 
+  mpz_init(mpc);
+
+  /* At least 32-bit coefficients are needed. */
+  if (ppl_Coefficient_max(mpc) > 0 && mpz_fits_sshort_p(mpc)) {
+    mpz_clear(mpc);
+    ppl_finalize();
+    return 0;
+  }
+
   for (i = 0; i < N_PARAMETERS; ++i)
     parameter_dim[i] = i + N_VARS;
 
   ppl_new_PIP_Problem_from_space_dimension(&pip, N_VARS+N_PARAMETERS);
   ppl_PIP_Problem_add_to_parameter_space_dimensions(pip, parameter_dim,
                                                     N_PARAMETERS);
-  mpz_init(mpc);
   ppl_new_Coefficient(&c);
   for (i = 0; i < N_CONSTRAINTS; ++i) {
     ppl_new_Linear_Expression(&le);




More information about the PPL-devel mailing list