
Bruno Lalande wrote:
Hi John,
I have added the new undeterminate_result_error to the framework, used it in the pow function, and checked into the sandbox. Please could you tell me if all looks good to you?
Just one thing: "undeterminate" should be spelt "indeterminate" throughout. No one said English was going to be logical :-)
In test_error_handling.cpp, I noticed that not every policies were tested: ignore_error and errno_on_error were missing. I added some test for them with undeterminate_result_error, do you want me to do the same for the other types of error? It's pretty straight-forward now.
Please!
I haven't been able to add a test to the last part of test_policy_2.cpp, where you test different overloads of make_policy(). I wanted to add the same test as at line 103, it didn't pass. I reduced the line until I end up with this:
BOOST_CHECK(check_same( make_policy(undeterminate_result_error<ignore_error>()), policy<undeterminate_result_error<ignore_error> >() ));
But it still doesn't pass. I guess it's a problem with the way in which I integrated the new error in the normalise class but I'm a bit confused about what to do exactly...
It's because ignore_error is the default for indeterminate errors, so make_policy(undeterminate_result_error<ignore_error>() simply returns policy<>() and not policy<undeterminate_result_error<ignore_error> >(). Try it with an error action that's not the default and the test should pass. Also one small point, in pow_test you check for a special return value: "return T(123.456)", but since that's not exactly representable as a binary floating point number it may be susceptible to spurious failures due to rounding issues etc. Probably better to return an exact binary value like 123.25 or something just in case.
Also, test_tr1 doesn't pass for me but I guess it's not related to my modifications...?
Oh :-( What compiler/platform/errors? There are a small number of fixes to in the Trunk for that test as well that haven't been back-merged to the Sandbox yet: can you see if the Trunk version of that test passes for you? Thanks, John.