Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/tests/mymoneyexception-test.cpp
Context not available. | |||||
31 | 31 | | |||
---|---|---|---|---|---|
32 | void MyMoneyExceptionTest::testDefaultConstructor() | 32 | void MyMoneyExceptionTest::testDefaultConstructor() | ||
33 | { | 33 | { | ||
34 | const MyMoneyException &e = MYMONEYEXCEPTION("Message"); | 34 | const MyMoneyException &e = MYMONEYEXCEPTION_CSTRING("Message"); | ||
35 | QVERIFY(e.what() == "Message"); | 35 | QVERIFY(e.what().startsWith("Message")); | ||
36 | QVERIFY(e.line() == __LINE__ - 2); | 36 | QVERIFY(QString::fromLatin1(e.what()).contains(QString::number(__LINE__ - 2))); | ||
37 | QVERIFY(e.file() == __FILE__); | 37 | QVERIFY(QString::fromLatin1(e.what()).contains(QString::fromLatin1(__FILE__))); | ||
38 | } | | |||
39 | | ||||
40 | void MyMoneyExceptionTest::testConstructor() | | |||
41 | { | | |||
42 | MyMoneyException e("New message", "Joe's file", 1234); | | |||
43 | QVERIFY(e.what() == "New message"); | | |||
44 | QVERIFY(e.line() == 1234); | | |||
45 | QVERIFY(e.file() == "Joe's file"); | | |||
46 | } | 38 | } | ||
Context not available. |