diff options
Diffstat (limited to 'kbruch/testcases/primenumber_test.cpp')
-rw-r--r-- | kbruch/testcases/primenumber_test.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/kbruch/testcases/primenumber_test.cpp b/kbruch/testcases/primenumber_test.cpp index 0a5ee2b6..c0e322fb 100644 --- a/kbruch/testcases/primenumber_test.cpp +++ b/kbruch/testcases/primenumber_test.cpp @@ -36,52 +36,52 @@ class primenumber_test /** test the prime number algorithm */ void test_isPrimeNumber() { - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(0) == 0); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(2) == 1); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(3) == 1); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(4) == 0); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(5) == 1); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(6) == 0); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(7) == 1); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(8) == 0); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(9) == 0); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(23) == 1); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(9) == 0); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(9) == 0); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(6) == 0); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(101) == 1); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(323) == 0); // 17 * 19 - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(1001) == 0); // 7 * 143 - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(1002) == 0); // 2 * 501 - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(3) == 1); - BOOST_RETQUIRE(m_primenumber.isPrimeNumber(2) == 1); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(0) == 0); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(2) == 1); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(3) == 1); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(4) == 0); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(5) == 1); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(6) == 0); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(7) == 1); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(8) == 0); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(9) == 0); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(23) == 1); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(9) == 0); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(9) == 0); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(6) == 0); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(101) == 1); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(323) == 0); // 17 * 19 + BOOST_REQUIRE(m_primenumber.isPrimeNumber(1001) == 0); // 7 * 143 + BOOST_REQUIRE(m_primenumber.isPrimeNumber(1002) == 0); // 2 * 501 + BOOST_REQUIRE(m_primenumber.isPrimeNumber(3) == 1); + BOOST_REQUIRE(m_primenumber.isPrimeNumber(2) == 1); } /** test the get_first() function */ void test_get_first() { - BOOST_RETQUIRE(m_primenumber.get_first() == 2); + BOOST_REQUIRE(m_primenumber.get_first() == 2); } /** test the move and get functions */ void test_move_get_func() { m_primenumber.move_first(); - BOOST_RETQUIRE(m_primenumber.get_current() == 2); - BOOST_RETQUIRE(m_primenumber.get_next() == 3); + BOOST_REQUIRE(m_primenumber.get_current() == 2); + BOOST_REQUIRE(m_primenumber.get_next() == 3); m_primenumber.move_forward(); - BOOST_RETQUIRE(m_primenumber.get_current() == 5); + BOOST_REQUIRE(m_primenumber.get_current() == 5); m_primenumber.move_back(); - BOOST_RETQUIRE(m_primenumber.get_current() == 3); + BOOST_REQUIRE(m_primenumber.get_current() == 3); unsigned int tmp = m_primenumber.get_last(); m_primenumber.move_last(); - BOOST_RETQUIRE(m_primenumber.get_current() == tmp); + BOOST_REQUIRE(m_primenumber.get_current() == tmp); m_primenumber.move_forward(); - BOOST_RETQUIRE(m_primenumber.get_last() != tmp); + BOOST_REQUIRE(m_primenumber.get_last() != tmp); } private: |