diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
commit | a374efce3a207b39514be3c52264091400ce297e (patch) | |
tree | 77bdf654b55826d4f59b53a5621310206bcaead1 /kbruch/testcases/primenumber_test.cpp | |
parent | f81a494f3957d5cf38c787973415597941934727 (diff) | |
download | tdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip |
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
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 c0e322fb..0a5ee2b6 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_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); + 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); } /** test the get_first() function */ void test_get_first() { - BOOST_REQUIRE(m_primenumber.get_first() == 2); + BOOST_RETQUIRE(m_primenumber.get_first() == 2); } /** test the move and get functions */ void test_move_get_func() { m_primenumber.move_first(); - BOOST_REQUIRE(m_primenumber.get_current() == 2); - BOOST_REQUIRE(m_primenumber.get_next() == 3); + BOOST_RETQUIRE(m_primenumber.get_current() == 2); + BOOST_RETQUIRE(m_primenumber.get_next() == 3); m_primenumber.move_forward(); - BOOST_REQUIRE(m_primenumber.get_current() == 5); + BOOST_RETQUIRE(m_primenumber.get_current() == 5); m_primenumber.move_back(); - BOOST_REQUIRE(m_primenumber.get_current() == 3); + BOOST_RETQUIRE(m_primenumber.get_current() == 3); unsigned int tmp = m_primenumber.get_last(); m_primenumber.move_last(); - BOOST_REQUIRE(m_primenumber.get_current() == tmp); + BOOST_RETQUIRE(m_primenumber.get_current() == tmp); m_primenumber.move_forward(); - BOOST_REQUIRE(m_primenumber.get_last() != tmp); + BOOST_RETQUIRE(m_primenumber.get_last() != tmp); } private: |