1929: Small fixes in tests/win/.

https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Roland Levillain <roland@lrde.epita.fr> Small fixes in tests/win/. * tests/win/backdiag2d.cc, * tests/win/cube3d.cc, * tests/win/diag2d.cc, * tests/win/disk2d.cc, * tests/win/octagon2d.cc, * tests/win/rectangle2d.cc: Substitute some identifiers to have (more) sensible assertions. * tests/win/hline2d.cc, * tests/win/vline2d.cc: Likewise. Remove spurious parts of assertions. backdiag2d.cc | 2 +- cube3d.cc | 10 +++++----- diag2d.cc | 4 ++-- disk2d.cc | 2 +- hline2d.cc | 3 +-- octagon2d.cc | 4 ++-- rectangle2d.cc | 2 +- vline2d.cc | 5 ++--- 8 files changed, 15 insertions(+), 17 deletions(-) Index: tests/win/backdiag2d.cc --- tests/win/backdiag2d.cc (revision 1928) +++ tests/win/backdiag2d.cc (working copy) @@ -52,7 +52,7 @@ { mln_assertion(((abs(x) <= 4) && (abs(y) <= 4)) || !diag.has(dpoint2d(y, x))); - mln_assertion((x == y) == (diag.has(dpoint2d(y, x))) || + mln_assertion((x == y) == (diag.has(dpoint2d(x, y))) || abs(x) > 4 || abs(y) > 4); } Index: tests/win/disk2d.cc --- tests/win/disk2d.cc (revision 1928) +++ tests/win/disk2d.cc (working copy) @@ -54,7 +54,7 @@ mln_assertion(((abs(x) <= 27) && (abs(y) <= 27)) || !disk.has(dpoint2d(y, x))); mln_assertion(((x * x + y * y) <= static_cast<int>(l2)) == - (disk.has(dpoint2d(y, x))) || + (disk.has(dpoint2d(x, y))) || abs(x) > 27 || abs(y) > 27); } Index: tests/win/octagon2d.cc --- tests/win/octagon2d.cc (revision 1928) +++ tests/win/octagon2d.cc (working copy) @@ -51,9 +51,9 @@ for (int y = -16; y <= 16; ++y) { mln_assertion(((abs(x) <= 6) && (abs(y) <= 6)) || - !oct.has(dpoint2d(y, x))); + !oct.has(dpoint2d(x, y))); mln_assertion((abs(x) + abs(y) <= static_cast<int>(l / 2 + l / 6)) == - (oct.has(dpoint2d(y, x))) || + (oct.has(dpoint2d(x, y))) || abs(x) > 2 || abs(y) > 2); } Index: tests/win/vline2d.cc --- tests/win/vline2d.cc (revision 1928) +++ tests/win/vline2d.cc (working copy) @@ -52,9 +52,8 @@ { mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) || !vline.has(dpoint2d(x, y))); - mln_assertion((0 == x) == (vline.has(dpoint2d(y, x))) || - abs(x) > 2 || - abs(y) > 2); + mln_assertion((0 == y) == (vline.has(dpoint2d(x, y))) || + abs(x) > 2); } debug::println(convert::to_image(vline)); Index: tests/win/cube3d.cc --- tests/win/cube3d.cc (revision 1928) +++ tests/win/cube3d.cc (working copy) @@ -47,14 +47,14 @@ mln_assertion(cube.delta() == 2); + for (int s = -5; s <= 5; ++s) for (int x = -5; x <= 5; ++x) for (int y = -5; y <= 5; ++y) - for (int z = -5; z <= 5; ++z) { - mln_assertion(((abs(x) <= 2) && (abs(y) <= 2) && (abs(z) <= 2)) || - !cube.has(dpoint3d(z, y, x))); - mln_assertion((abs(x) <= 2 && abs(y) <= 2 && abs(z) <= 2) == - (cube.has(dpoint3d(z, y, x)))); + mln_assertion(((abs(x) <= 2) && (abs(y) <= 2) && (abs(s) <= 2)) || + !cube.has(dpoint3d(s, y, x))); + mln_assertion((abs(x) <= 2 && abs(y) <= 2 && abs(s) <= 2) == + (cube.has(dpoint3d(s, y, x)))); } debug::println(convert::to_image(cube)); Index: tests/win/hline2d.cc --- tests/win/hline2d.cc (revision 1928) +++ tests/win/hline2d.cc (working copy) @@ -52,8 +52,7 @@ { mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) || !hline.has(dpoint2d(x, y))); - mln_assertion((0 == y) == (hline.has(dpoint2d(y, x))) || - abs(x) > 2 || + mln_assertion((0 == x) == (hline.has(dpoint2d(x, y))) || abs(y) > 2); } Index: tests/win/rectangle2d.cc --- tests/win/rectangle2d.cc (revision 1928) +++ tests/win/rectangle2d.cc (working copy) @@ -55,7 +55,7 @@ for (int x = -5; x <= 5; ++x) for (int y = -5; y <= 5; ++y) { - mln_assertion((abs(y) <= 1 && abs(x) <= 2) == (rec.has(dpoint2d(y, x)))); + mln_assertion((abs(x) <= 1 && abs(y) <= 2) == (rec.has(dpoint2d(x, y)))); } debug::println(convert::to_image(rec)); Index: tests/win/diag2d.cc --- tests/win/diag2d.cc (revision 1928) +++ tests/win/diag2d.cc (working copy) @@ -51,7 +51,7 @@ for (int y = -5; y <= 5; ++y) { mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) || - !diag.has(dpoint2d(y, x))); + !diag.has(dpoint2d(x, y))); std::cout << "x = " << x << ", y = " @@ -60,7 +60,7 @@ << ((diag.has(dpoint2d(x, y))) ? "True" : "False") << std::endl; mln_assertion((x == -y) == - (diag.has(dpoint2d(y, x))) || abs(x) > 2 || abs(y) > 2); + (diag.has(dpoint2d(x, y))) || abs(x) > 2 || abs(y) > 2); } debug::println(convert::to_image(diag));
participants (1)
-
Roland Levillain