30 {
31 BOOST_TEST_MESSAGE("Testing FXDominance...");
32
33
34 const char* expectedPairs[] = {
35 "EURUSD", "GBPUSD", "AUDUSD", "CADJPY", "AUDJPY", "EURNOK", "EURJPY", "EURSEK", "EURCHF", "EURNOK", "NOKJPY",
36 "NOKSEK", "DKKSEK", "CNYJPY", "JPYIDR",
37
38
39 "AUDCAD", "AUDCHF", "AUDJPY", "AUDNZD", "AUDUSD", "CADJPY", "CADMXN", "CADNOK", "CHFJPY", "EURAUD", "EURCAD",
40 "EURCHF", "EURCZK", "EURDKK", "EURGBP", "EURHUF", "EURJPY", "EURKRW", "EURMXN", "EURNOK", "EURNZD", "EURPLN",
41 "EURRUB", "EURSEK", "EURTRY", "EURUSD", "EURZAR", "GBPAUD", "GBPCAD", "GBPCHF", "GBPJPY", "GBPNOK", "GBPUSD",
42 "JPYKRW", "MXNJPY", "NOKSEK", "NZDCAD", "NZDCHF", "NZDJPY", "NZDUSD", "TRYJPY", "USDCAD", "USDCHF", "USDCNH",
43 "USDCZK", "USDDKK", "USDHKD", "USDHUF", "USDILS", "USDJPY", "USDMXN", "USDNOK", "USDOMR", "USDPLN", "USDRON",
44 "USDRUB", "USDSEK", "USDSGD", "USDTHB", "USDTRY", "USDZAR",
45
46
47 "XXXJPY", "EURXXX", "USDXXX",
48
49
50 "XAUUSD", "XAGUSD", "XPTUSD", "XPDUSD", "XAUEUR", "XAGEUR", "XPTAUD"};
51
52 for (unsigned i = 0; i < sizeof(expectedPairs) / sizeof(expectedPairs[0]); i++) {
53 string expectedPair = expectedPairs[i];
54 string s1 = expectedPair.substr(0, 3);
55 string s2 = expectedPair.substr(3);
56
57 BOOST_TEST_MESSAGE("Combining " << s1 << " and " << s2 << " expecting " << expectedPair);
59 BOOST_CHECK_EQUAL(pair, expectedPair);
60
61 BOOST_TEST_MESSAGE("Combining " << s2 << " and " << s1 << " expecting " << expectedPair);
63 BOOST_CHECK_EQUAL(pair, expectedPair);
64 }
65}
string fxDominance(const string &s1, const string &s2)
Convert FX pair to market standard dominance.