Make unittest return exit code 1 on failure

This is to allow travis to catch test failures
fixed failing testcases

commit 011f190 changed the production code to use integer division, but
the testcases was kept verifying floating point division.
This commit changes so that the testcases verify the integer division
instead.