29 #include <tqmetaobject.h>
35 SlotTester::SlotTester(
const char *name) : Tester(name)
37 m_resultsList.setAutoDelete(
true);
41 void SlotTester::invokeMember(
const TQString &str)
43 TQString slotname = TQString::number(TQ_SLOT_CODE) + str;
44 connect(
this, TQ_SIGNAL(invoke()),
this, slotname.ascii());
46 disconnect(
this, TQ_SIGNAL(invoke()),
this, slotname.ascii());
49 void SlotTester::allTests()
51 TQStrList allSlots = metaObject()->slotNames();
53 if ( allSlots.contains(
"setUp()") > 0 ) invokeMember(
"setUp()");
55 for (
char *sl = allSlots.first(); sl; sl = allSlots.next() )
59 if ( str.startsWith(
"test") )
61 m_results = results(sl);
64 cout <<
"KUnitTest_Debug_BeginSlot[" << sl <<
"]" << endl;
66 cout <<
"KUnitTest_Debug_EndSlot[" << sl <<
"]" << endl;
70 if ( allSlots.contains(
"tearDown()") > 0 ) invokeMember(
"tearDown()");
77 if ( m_resultsList.find(sl) == 0L ) m_resultsList.insert(sl,
new TestResults());
79 return m_resultsList[sl];
83 TQTextStream& operator<<( TQTextStream& str,
const TQRect& r ) {
84 str <<
"[" << r.x() <<
"," << r.y() <<
" - " << r.width() <<
"x" << r.height() <<
"]";
88 TQTextStream& operator<<( TQTextStream& str,
const TQPoint& r ) {
89 str <<
"(" << r.x() <<
"," << r.y() <<
")";
93 TQTextStream& operator<<( TQTextStream& str,
const TQSize& r ) {
94 str <<
"[" << r.width() <<
"x" << r.height() <<
"]";
Namespace for Unit testing classes.