Sorry for some error in previous email.
If we want to the syntax like " CPPUNIT_ASSERT_EQUAL( expectedMoney, =
money
);"=A3=ACwe should implement the friend operator << function for class =
money.
Details in below:
class Money
{
public:
friend std::ostream &operator <<( std::ostream &os, const
Money &money )
{
os << money.m_amount;
os << money.m_currency;
return os;
}
};
Then it will work.
-----=D3=CA=BC=FE=D4=AD=BC=FE-----
=B7=A2=BC=FE=C8=CB: arthur [mailto:ar...@us...]=20
=B7=A2=CB=CD=CA=B1=BC=E4: 2005=C4=EA7=D4=C214=C8=D5 14:14
=CA=D5=BC=FE=C8=CB: 'cpp...@li...'
=D6=F7=CC=E2: An error in document cppunit-1.10.2
I found an error in money_example.html. Below is the detail:
void=20
MoneyTest::testAdd()
{
...
// Check
CPPUNIT_ASSERT_EQUAL( expectedMoney =3D=3D money.getAmount() ); // =
+=3D
works
...
}
I think it should be=20
CPPUNIT_ASSERT_EQUAL( expectedMoney, money ); // +=3D works
And I check the sample code, it is:
CPPUNIT_ASSERT( expectedMoney =3D=3D money ); // add works
Both is ok.
Arthur Lee
ar...@us...
|