last-svn-commit-969-gf6b3eed tests/estim/font_boldness.cc: Make the test deterministic.

--- scribo/ChangeLog | 4 ++++ scribo/tests/estim/font_boldness.cc | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 060bd2a..d667e43 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,3 +1,7 @@ +2011-09-07 Guillaume Lazzara <z@lrde.epita.fr> + + * tests/estim/font_boldness.cc: Make the test deterministic. + 2011-09-06 Guillaume Lazzara <z@lrde.epita.fr> * tests/img/several_objects.pgm: Add a new test image. diff --git a/scribo/tests/estim/font_boldness.cc b/scribo/tests/estim/font_boldness.cc index 9e85795..bc42054 100644 --- a/scribo/tests/estim/font_boldness.cc +++ b/scribo/tests/estim/font_boldness.cc @@ -38,9 +38,11 @@ int main() image2d<bool> input; io::pbm::load(input, SCRIBO_IMG_DIR "/phillip.pbm"); - float val = scribo::estim::font_boldness(input); + volatile float val = scribo::estim::font_boldness(input); + val = ((int)(val * 100) / 100.f); - mln_assertion(((int)(val * 100) / 100.f) == 18.44f); + volatile float ref = 18.44f; + mln_assertion(val == ref); return 0; } -- 1.7.2.5
participants (1)
-
Guillaume Lazzara