20#include <boost/test/unit_test.hpp>
21#include <ql/currencies/all.hpp>
22#include <ql/currency.hpp>
31using namespace boost::unit_test_framework;
43static CcyTestData currencyData[] = {
45 { TNDCurrency(),
"Tunisian dinar",
"TND", 788 },
46 { EGPCurrency(),
"Egyptian pound",
"EGP", 818 },
47 { MADCurrency(),
"Moroccan dirham",
"MAD", 504 },
49 { MXVCurrency(),
"Mexican Unidad de Inversion",
"MXV", 979 },
50 { CLFCurrency(),
"Unidad de Fomento (funds code)",
"CLF", 990 },
51 { UYUCurrency(),
"Uruguayan peso",
"UYU", 858 },
53 { KZTCurrency(),
"Kazakstanti Tenge",
"KZT", 398 },
54 { QARCurrency(),
"Qatari riyal",
"QAR", 634 },
55 { BHDCurrency(),
"Bahraini dinar",
"BHD", 48 },
56 { OMRCurrency(),
"Omani rial",
"OMR", 512 },
57 { AEDCurrency(),
"United Arab Emirates dirham",
"AED", 784 },
58 { PHPCurrency(),
"Philippine peso",
"PHP", 608 },
59 {
XAUCurrency(),
"Troy Ounce of Gold",
"XAU", 959 },
60 {
XAGCurrency(),
"Troy Ounce of Silver",
"XAG", 961 },
61 {
XPDCurrency(),
"Troy Ounce of Palladium",
"XPD", 964 },
62 {
XPTCurrency(),
"Troy Ounce of Platinum",
"XPT", 962 },
63 { AOACurrency(),
"Angolan kwanza",
"AOA", 973 },
64 { ETBCurrency(),
"Ethiopian birr",
"ETB", 230 },
65 { XOFCurrency(),
"West African CFA franc",
"XOF", 952 },
67 { GELCurrency(),
"Georgian lari",
"GEL", 981 }
73BOOST_AUTO_TEST_SUITE(CurrencyTest)
77 BOOST_TEST_MESSAGE(
"Testing QuantExt currencies");
79 Size size =
sizeof(currencyData) /
sizeof(currencyData[0]);
81 for (Size i = 0; i < size; i++) {
82 BOOST_CHECK_EQUAL(currencyData[i].ccy.name(), currencyData[i].name);
83 BOOST_CHECK_EQUAL(currencyData[i].ccy.code(), currencyData[i].code);
84 BOOST_CHECK_EQUAL(currencyData[i].ccy.numericCode(), currencyData[i].numCode);
88BOOST_AUTO_TEST_SUITE_END()
90BOOST_AUTO_TEST_SUITE_END()
Extend QuantLib African currencies.
Extend QuantLib American currencies.
Extend QuantLib Asian currencies.
BOOST_AUTO_TEST_CASE(testCurrency)
Extend QuantLib European currencies.
Fixture that can be used at top level.