[PPL-devel] [GIT] ppl/ppl(devel): Empty expression statements avoided.
Roberto Bagnara
roberto.bagnara at bugseng.com
Sat Aug 8 18:35:21 CEST 2020
Module: ppl/ppl
Branch: devel
Commit: 726b6e3fbbd7e95689ec15273dc0567c8baf9292
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=726b6e3fbbd7e95689ec15273dc0567c8baf9292
Author: Roberto Bagnara <roberto.bagnara at bugseng.com>
Date: Sat Aug 8 18:35:14 2020 +0200
Empty expression statements avoided.
---
tests/BD_Shape/boundedaffinepreimage1.cc | 2 +-
tests/Grid/congruences2.cc | 2 +-
tests/Grid/fromgrid1.cc | 4 ++--
tests/Grid/grid2.cc | 2 +-
tests/Octagonal_Shape/generalizedaffineimage4.cc | 2 +-
tests/Polyhedron/constrains1.cc | 20 ++++++++++++--------
tests/Polyhedron/memory2.cc | 12 +++++++-----
tests/Powerset/relationwith1.cc | 4 ++--
8 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/tests/BD_Shape/boundedaffinepreimage1.cc b/tests/BD_Shape/boundedaffinepreimage1.cc
index 62527722c..12b7ab39c 100644
--- a/tests/BD_Shape/boundedaffinepreimage1.cc
+++ b/tests/BD_Shape/boundedaffinepreimage1.cc
@@ -270,7 +270,7 @@ test09() {
bds.add_constraint(A - B <= 2);
bds.add_constraint(A - B >= -2);
- print_constraints(bds, "*** bds ***");;
+ print_constraints(bds, "*** bds ***");
BD_Shape<mpq_class> known_result(2);
known_result.add_constraint(4*A >= -5);
diff --git a/tests/Grid/congruences2.cc b/tests/Grid/congruences2.cc
index b8453e864..78a206d8c 100644
--- a/tests/Grid/congruences2.cc
+++ b/tests/Grid/congruences2.cc
@@ -60,7 +60,7 @@ test01() {
ok &= !(cgs2 == cgs0) && !(cgs2 == cgs1);
print_congruences(cgs2, "*** cgs2((A - 3*B %= 5) / 2) ***");
- };
+ }
return ok;
}
diff --git a/tests/Grid/fromgrid1.cc b/tests/Grid/fromgrid1.cc
index 4767b314d..d5c73d307 100644
--- a/tests/Grid/fromgrid1.cc
+++ b/tests/Grid/fromgrid1.cc
@@ -56,7 +56,7 @@ test01() {
ok &= (gr_copy == known_gr);
print_generators(gr_copy, "*** gr_copy ***");
}
- };
+ }
return ok;
}
@@ -89,7 +89,7 @@ test02() {
ok &= (gr_copy == known_gr);
print_generators(gr_copy, "*** gr_copy ***");
}
- };
+ }
return ok;
}
diff --git a/tests/Grid/grid2.cc b/tests/Grid/grid2.cc
index 7d422ca7b..24848dd7d 100644
--- a/tests/Grid/grid2.cc
+++ b/tests/Grid/grid2.cc
@@ -589,7 +589,7 @@ test21() {
bool
test22() {
Variable A(0);
- Variable B(1);;
+ Variable B(1);
Congruence_System cgs1(0*A == 0);
cgs1.insert(0*B == 0);
diff --git a/tests/Octagonal_Shape/generalizedaffineimage4.cc b/tests/Octagonal_Shape/generalizedaffineimage4.cc
index 58b92a6dd..4b17e5e95 100644
--- a/tests/Octagonal_Shape/generalizedaffineimage4.cc
+++ b/tests/Octagonal_Shape/generalizedaffineimage4.cc
@@ -176,7 +176,7 @@ test06() {
print_constraints(oct, "*** oct ***");
Octagonal_Shape<mpq_class> known_result(3);
- known_result.add_constraint(A <= 1);;
+ known_result.add_constraint(A <= 1);
oct.generalized_affine_image(e1, LESS_OR_EQUAL, e2);
diff --git a/tests/Polyhedron/constrains1.cc b/tests/Polyhedron/constrains1.cc
index afdb580f3..8ae1f5acc 100644
--- a/tests/Polyhedron/constrains1.cc
+++ b/tests/Polyhedron/constrains1.cc
@@ -24,16 +24,20 @@ site: http://bugseng.com/products/ppl/ . */
#include "ppl_test.hh"
#define TEST_PREDICATE_TRUE(pred) \
- if (!pred) { \
- nout << "!" #pred << endl; \
- ok = false; \
- }
+ do { \
+ if (!pred) { \
+ nout << "!" #pred << endl; \
+ ok = false; \
+ } \
+ } while (false)
#define TEST_PREDICATE_FALSE(pred) \
- if (pred) { \
- nout << #pred << endl; \
- ok = false; \
- }
+ do { \
+ if (pred) { \
+ nout << #pred << endl; \
+ ok = false; \
+ } \
+ } while (false)
namespace {
diff --git a/tests/Polyhedron/memory2.cc b/tests/Polyhedron/memory2.cc
index 1970d5ce8..7994dd3c2 100644
--- a/tests/Polyhedron/memory2.cc
+++ b/tests/Polyhedron/memory2.cc
@@ -226,11 +226,13 @@ test3() {
} // namespace
#define IGNORE_OVERFLOWS(fun) \
- try { \
- fun; \
- } \
- catch (const std::overflow_error&) { \
- }
+ do { \
+ try { \
+ fun; \
+ } \
+ catch (const std::overflow_error&) { \
+ } \
+ } while (false)
extern "C" void
ppl_set_GMP_memory_allocation_functions() {
diff --git a/tests/Powerset/relationwith1.cc b/tests/Powerset/relationwith1.cc
index 7d55ba26a..837043c19 100644
--- a/tests/Powerset/relationwith1.cc
+++ b/tests/Powerset/relationwith1.cc
@@ -39,7 +39,7 @@ test01() {
Poly_Con_Relation known_rel = Poly_Con_Relation::saturates()
&& Poly_Con_Relation::is_included();
- bool ok = (rel == known_rel);;
+ bool ok = (rel == known_rel);
return ok && ps.OK();
}
@@ -132,7 +132,7 @@ test05() {
Poly_Con_Relation known_rel = Poly_Con_Relation::saturates()
&& Poly_Con_Relation::is_included();
- bool ok = (rel == known_rel);;
+ bool ok = (rel == known_rel);
return ok && ps.OK();
}
More information about the PPL-devel
mailing list