
[Please do not mail me a copy of your followup] boost-users@lists.boost.org spake the secret code <4EC71EEB.6000206@providere-consulting.com> thusly:
BOOST_AUTO_TEST_CASE(test_f) { BOOST_CHECK_EQUAL(f(0), 0); BOOST_CHECK_EQUAL(f(1), 1); BOOST_CHECK_EQUAL(f(2), 1); BOOST_CHECK_EQUAL(f(6), 8); BOOST_CHECK_EQUAL(f(15), 610); BOOST_CHECK_EQUAL(f(47), 2971215073); }
IMO, this is poor test design because its testing a whole bunch of different scenarios in a single test.
BOOST_AUTO_TEST_CASE(test_C) { C c1(1, 2); C c2(3, 4); C c3 = c1 * c2;
BOOST_CHECK_EQUAL(c3.real(), -5); BOOST_CHECK_EQUAL(c3.imag(), 10); }
In this case the problem is that you're testing equality by pieces instead of by the whole. Again, all my opinion, but I find the above tests poorly written. -- "The Direct3D Graphics Pipeline" -- DirectX 9 version available for download http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/ Legalize Adulthood! http://legalizeadulthood.wordpress.com