Posted by
Luigi Ballabio on
Jul 29, 2011; 3:36pm
URL: http://quantlib.414.s1.nabble.com/test-suite-fails-when-run-in-debug-mode-but-is-successful-when-run-in-release-mode-tp13557p13560.html
On Tue, 2011-07-19 at 21:31 +0100, Rahul Reddy Kanchi wrote:
> It enters a debugger and prompts for continue/break/ignore. But the
> same exception is thrown several times(may be in hundreds). Looks like
> the exception is thrown in checkRange() function. Time variable is -ve
> but we are checking it through QL_REQUIRE(t>0) and thus exception is
> thrown.
Yes, the exception is expected. Although we might have written the
thing as:
if (d >= discountCurve->referenceDate())
results_.startDiscounts[i] = discountCurve_->discount(d);
else
results_.startDiscounts[i] = Null<DiscountFactor>();
instead of:
try {
results_.startDiscounts[i] = discountCurve_->discount(d);
} catch (...) {
results_.startDiscounts[i] = Null<DiscountFactor>();
}
If you want to make the change and check that the test suite still
works, by all means do (and send me the patch afterwards.)
> Test suite execution in release mode took more than an hour. Is this a
> normal behavior?
It takes around half an hour on my machine (I have two 1.83GHz cores,
but the test suite only uses one.) I'm using gcc on Linux, but I think
the times on a comparable Windows machine were about the same...
Luigi
--
When you break the big laws, you do not get liberty; you do not
even get anarchy. You get the small laws.
-- G.K. Chesterton
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev