Unit testing in 3.2/4.0 - Help?
- Posted by Jeremy Cowgar <jeremy at cowgar?co?> Apr 23, 2008
- 587 views
Can someone who has SVN access look at the unit testing in the current SVN trunk? I'm running into problems such as: [jeremy at jdesk tests]$ exu all.ex math.e: failed: deg2rad() #2. expected: 3.490658504 but got: 3.490658504 failed: deg2rad() #3. expected: {0.01745329252,3.385938749} but got: {0.01745329252,3.385938749} failed: rad2deg() #1. expected: 0.9998113525 but got: 0.9998113525 failed: rad2deg() #3. expected: {0.9998113525,28.64788976} but got: {0.9998113525,28.64788976} failed: exp() #2. expected: 9.974183 but got: 9.97418 254 tests run, 249 passed, 5 failed, 98% success It has to do, I think, with long decimals. I've used printf() to print these computed numbers: printf(1, "%.100f", {num}) .. and it seems the precision goes to the 50th decimal point. Plugging in the value into the unit test to the 50th value solved some of the mis-fires on failed tests, but not all of them. How include/unittest.e determines if they are equal is not is by using the equal() function. Nothing fancy. To run the unit tests, simply change to the tests directory and run exu all.ex (on unix) or exwc.exe all.ex on windows. Of course, have your euphoria environment setup to use the new 3.2/4.0 instead of the production 3.1. Thanks for any help with this. -- Jeremy Cowgar http://jeremy.cowgar.com