Try native*non-native too.

This commit is contained in:
JoelKatz
2012-12-12 21:53:13 -08:00
parent d7fcb5c7ba
commit 93e4e4780a

View File

@@ -1439,12 +1439,22 @@ static void mulTest(int a, int b)
BOOST_FAIL("product is native"); BOOST_FAIL("product is native");
STAmount prod2(CURRENCY_ONE, ACCOUNT_ONE, a * b); STAmount prod2(CURRENCY_ONE, ACCOUNT_ONE, a * b);
if (prod1 == prod2) if (prod1 != prod2)
return; {
Log(lsWARNING) << "(" << aa.getFullText() << " * " << bb.getFullText() << ") = " << prod1.getFullText() Log(lsWARNING) << "nn(" << aa.getFullText() << " * " << bb.getFullText() << ") = " << prod1.getFullText()
<< " not " << prod2.getFullText(); << " not " << prod2.getFullText();
BOOST_FAIL("Multiplication result is not exact"); BOOST_FAIL("Multiplication result is not exact");
} }
aa = a;
prod1 = STAmount::multiply(aa, bb, CURRENCY_ONE, ACCOUNT_ONE);
if (prod1 != prod2)
{
Log(lsWARNING) << "n(" << aa.getFullText() << " * " << bb.getFullText() << ") = " << prod1.getFullText()
<< " not " << prod2.getFullText();
BOOST_FAIL("Multiplication result is not exact");
}
}
BOOST_AUTO_TEST_CASE( CurrencyMulDivTests ) BOOST_AUTO_TEST_CASE( CurrencyMulDivTests )
{ {