Skip to content

Commit

Permalink
Migrated lookbackoptions.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsky committed Nov 7, 2023
1 parent 4ce7939 commit 7ef6b4a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 70 deletions.
1 change: 0 additions & 1 deletion test-suite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ set(QL_TEST_SOURCES
)

set(QL_TEST_HEADERS
lookbackoptions.hpp
lowdiscrepancysequences.hpp
margrabeoption.hpp
marketmodel.hpp
Expand Down
1 change: 0 additions & 1 deletion test-suite/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ QL_TEST_SRCS = \
zerocouponswap.cpp

QL_TEST_HDRS = \
lookbackoptions.hpp \
lowdiscrepancysequences.hpp \
margrabeoption.hpp \
marketmodel.hpp \
Expand Down
34 changes: 12 additions & 22 deletions test-suite/lookbackoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
FOR A PARTICULAR PURPOSE. See the license for more details.
*/

#include "lookbackoptions.hpp"
#include "speedlevel.hpp"
#include "toplevelfixture.hpp"
#include "utilities.hpp"
#include <ql/time/daycounters/actual360.hpp>
#include <ql/instruments/lookbackoption.hpp>
Expand Down Expand Up @@ -106,8 +107,11 @@ namespace {

}

BOOST_FIXTURE_TEST_SUITE(QuantLibTest, TopLevelFixture)

void LookbackOptionTest::testAnalyticContinuousFloatingLookback() {
BOOST_AUTO_TEST_SUITE(LookbackOptionTest)

BOOST_AUTO_TEST_CASE(testAnalyticContinuousFloatingLookback) {

BOOST_TEST_MESSAGE(
"Testing analytic continuous floating-strike lookback options...");
Expand Down Expand Up @@ -178,8 +182,7 @@ void LookbackOptionTest::testAnalyticContinuousFloatingLookback() {
}
}


void LookbackOptionTest::testAnalyticContinuousFixedLookback() {
BOOST_AUTO_TEST_CASE(testAnalyticContinuousFixedLookback) {

BOOST_TEST_MESSAGE(
"Testing analytic continuous fixed-strike lookback options...");
Expand Down Expand Up @@ -272,7 +275,7 @@ void LookbackOptionTest::testAnalyticContinuousFixedLookback() {
}
}

void LookbackOptionTest::testAnalyticContinuousPartialFloatingLookback() {
BOOST_AUTO_TEST_CASE(testAnalyticContinuousPartialFloatingLookback) {

BOOST_TEST_MESSAGE(
"Testing analytic continuous partial floating-strike lookback options...");
Expand Down Expand Up @@ -380,7 +383,7 @@ void LookbackOptionTest::testAnalyticContinuousPartialFloatingLookback() {
}
}

void LookbackOptionTest::testAnalyticContinuousPartialFixedLookback() {
BOOST_AUTO_TEST_CASE(testAnalyticContinuousPartialFixedLookback) {

BOOST_TEST_MESSAGE(
"Testing analytic continuous fixed-strike lookback options...");
Expand Down Expand Up @@ -485,7 +488,7 @@ void LookbackOptionTest::testAnalyticContinuousPartialFixedLookback() {
}
}

void LookbackOptionTest::testMonteCarloLookback() {
BOOST_AUTO_TEST_CASE(testMonteCarloLookback, *precondition(if_speed(Slow))) {
BOOST_TEST_MESSAGE("Testing Monte Carlo engines for lookback options...");

Real tolerance = 0.1;
Expand Down Expand Up @@ -657,19 +660,6 @@ void LookbackOptionTest::testMonteCarloLookback() {
}
}

BOOST_AUTO_TEST_SUITE_END()

test_suite* LookbackOptionTest::suite(SpeedLevel speed) {
auto* suite = BOOST_TEST_SUITE("Lookback option tests");

suite->add(QUANTLIB_TEST_CASE(&LookbackOptionTest::testAnalyticContinuousFloatingLookback));
suite->add(QUANTLIB_TEST_CASE(&LookbackOptionTest::testAnalyticContinuousFixedLookback));
suite->add(QUANTLIB_TEST_CASE(&LookbackOptionTest::testAnalyticContinuousPartialFloatingLookback));
suite->add(QUANTLIB_TEST_CASE(&LookbackOptionTest::testAnalyticContinuousPartialFixedLookback));

if (speed == Slow) {
suite->add(QUANTLIB_TEST_CASE(&LookbackOptionTest::testMonteCarloLookback));
}

return suite;
}

BOOST_AUTO_TEST_SUITE_END()
40 changes: 0 additions & 40 deletions test-suite/lookbackoptions.hpp

This file was deleted.

2 changes: 0 additions & 2 deletions test-suite/quantlibtestsuite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
# include <ql/auto_link.hpp>
#endif

#include "lookbackoptions.hpp"
#include "lowdiscrepancysequences.hpp"
#include "margrabeoption.hpp"
#include "marketmodel.hpp"
Expand Down Expand Up @@ -146,7 +145,6 @@ test_suite* init_unit_test_suite(int, char* []) {

auto* test = BOOST_TEST_SUITE("QuantLib test suite");

test->add(LookbackOptionTest::suite(speed));
test->add(LowDiscrepancyTest::suite());
test->add(MargrabeOptionTest::suite());
test->add(MarketModelTest::suite(speed));
Expand Down
1 change: 0 additions & 1 deletion test-suite/testsuite.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@
<ClCompile Include="quantlibtestsuite.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="lookbackoptions.hpp" />
<ClInclude Include="lowdiscrepancysequences.hpp" />
<ClInclude Include="margrabeoption.hpp" />
<ClInclude Include="marketmodel.hpp" />
Expand Down
3 changes: 0 additions & 3 deletions test-suite/testsuite.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,6 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="lookbackoptions.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="lowdiscrepancysequences.hpp">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down

0 comments on commit 7ef6b4a

Please sign in to comment.