diff options
author | Matthew Hoops | 2011-08-26 22:44:17 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-08-26 22:44:17 -0400 |
commit | 4a69dc13d92e82fff85dc5a3a923b74ced259ffa (patch) | |
tree | 8945cd3745fd65f28b043caf7b1beddbbce2b2a1 /test/common/math.h | |
parent | ad293b249e74dd1cfbdbd721d02145efbdaf9eca (diff) | |
parent | 5e174cbfe466dbbe8e5470b0a00de1481b986181 (diff) | |
download | scummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.tar.gz scummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.tar.bz2 scummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.zip |
Merge remote branch 'upstream/master' into pegasus
Diffstat (limited to 'test/common/math.h')
-rw-r--r-- | test/common/math.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/common/math.h b/test/common/math.h new file mode 100644 index 0000000000..5da0410e8e --- /dev/null +++ b/test/common/math.h @@ -0,0 +1,18 @@ +#include <cxxtest/TestSuite.h> + +#include "common/math.h" + +class MathTestSuite : public CxxTest::TestSuite +{ + public: + void test_intLog2() { + // Test special case for 0 + TS_ASSERT_EQUALS(Common::intLog2(0), -1); + + // intLog2 should round the result towards 0 + TS_ASSERT_EQUALS(Common::intLog2(7), 2); + + // Some simple test for 2^10 + TS_ASSERT_EQUALS(Common::intLog2(1024), 10); + } +}; |