|
From: Simon I. <Sim...@st...> - 2008-03-11 17:15:57
|
Hi, I think I've found a bug - the test suite is generating errors on my PC under the debug build (but not under release). I checked-out (in a new directory) the QuantLib trunk. I compiled it then ran the test suite. I'm getting the following errors from the test suite:- Testing bond implied value against asset-swap fair price with null spread... 10>unknown location(0): fatal error in "AssetSwapTest::testImpliedValue": std::exception: stdDev (-1.#IND) must be non-negative 10>Testing relationship between market asset swap and par asset swap... 10>unknown location(0): fatal error in "AssetSwapTest::testMarketASWSpread": std::exception: stdDev (-1.#IND) must be non-negative 10>Testing clean and dirty price with null Z-spread against theoretical prices... 10>unknown location(0): fatal error in "AssetSwapTest::testZSpread": std::exception: stdDev (-1.#IND) must be non-negative 10>Testing generic bond implied value against asset-swap fair price with null spread... 10>unknown location(0): fatal error in "AssetSwapTest::testGenericBondImplied": std::exception: stdDev (-1.#IND) must be non-negative 10>Testing market asset swap against par asset swap with generic bond... 10>unknown location(0): fatal error in "AssetSwapTest::testMASWWithGenericBond": std::exception: stdDev (-1.#IND) must be non-negative 10>Testing clean and dirty price with null Z-spread against theoretical prices... 10>unknown location(0): fatal error in "AssetSwapTest::testZSpreadWithGenericBond": std::exception: stdDev (-1.#IND) must be non-negative 10>Testing clean and dirty prices for specialized bond against equivalent generic bond... 10>unknown location(0): fatal error in "AssetSwapTest::testSpecializedBondVsGenericBond": std::exception: stdDev (-1.#IND) must be non-negative 10>Testing asset-swap prices and spreads for specialized bond against equivalent generic bond... 10>unknown location(0): fatal error in "AssetSwapTest::testSpecializedBondVsGenericBondUsingAsw": std::exception: stdDev (-1.#IND) must be non-negative Are these expected? I've tracked them down to a code point in the test file assetswap.cpp, where the code is determining the floor on a CMS bond rate and the SmileSection class is not initializing the exerciseTime_ member variable. Line 53 of conundrumpricer.cpp gets a smile section for use from... Line 78 of swaptionconstantvol.cpp creates a FlatSmileSection using a valid referenceDate. Line 50 of smilesection.cpp defines isFloating_ (false in this case). Line 59 of conundrumpricer.cpp calls the variance of the smile section which has an invalid exerciseTime_ member variable. I don't see why this would be desired behaviour but I can't find any mention (on QuantLib) of the test suite producing deliberate unhandled errors either. Also, this doesn't happen (or it isn't picked up) under the release build. Can anyone enlighten me? Simon Simon Ibbotson Head of Quantitative Analytics Capital Markets Straumur |