summaryrefslogtreecommitdiffstats
path: root/kunittest
diff options
context:
space:
mode:
Diffstat (limited to 'kunittest')
-rw-r--r--kunittest/dcopinterface.h6
-rw-r--r--kunittest/example/module/sampleextra.cpp2
-rw-r--r--kunittest/example/module/samplemodule2.cpp8
-rw-r--r--kunittest/example/module/sampletests.cpp12
-rw-r--r--kunittest/example/module/sampletests.h2
-rw-r--r--kunittest/example/simple/sampletest.cpp8
-rw-r--r--kunittest/runnergui.cpp122
-rw-r--r--kunittest/runnergui.h18
-rw-r--r--kunittest/testerwidget.ui.h12
9 files changed, 95 insertions, 95 deletions
diff --git a/kunittest/dcopinterface.h b/kunittest/dcopinterface.h
index e18c0d5a..50f15d3d 100644
--- a/kunittest/dcopinterface.h
+++ b/kunittest/dcopinterface.h
@@ -21,7 +21,7 @@
#define KUNITTEST_DCOPINTERFACE_H
#include <dcopobject.h>
-#include <qstring.h>
+#include <tqstring.h>
namespace KUnitTest
{
@@ -30,8 +30,8 @@ namespace KUnitTest
K_DCOP
k_dcop:
- virtual bool addDebugInfo(const QString &name, const QString &info) = 0;
- virtual bool addSlotDebugInfo(const QString &name, const QString &slt, const QString &info) = 0;
+ virtual bool addDebugInfo(const TQString &name, const TQString &info) = 0;
+ virtual bool addSlotDebugInfo(const TQString &name, const TQString &slt, const TQString &info) = 0;
};
}
diff --git a/kunittest/example/module/sampleextra.cpp b/kunittest/example/module/sampleextra.cpp
index 38c49448..fa17aa6c 100644
--- a/kunittest/example/module/sampleextra.cpp
+++ b/kunittest/example/module/sampleextra.cpp
@@ -33,5 +33,5 @@ void SomeExtraTester::allTests()
{
kdDebug() << "Debug output belonging to SomeExtraTester." << endl;
- CHECK( QString("Extra") , QString("Extra") );
+ CHECK( TQString("Extra") , TQString("Extra") );
}
diff --git a/kunittest/example/module/samplemodule2.cpp b/kunittest/example/module/samplemodule2.cpp
index 87efde28..672ec08a 100644
--- a/kunittest/example/module/samplemodule2.cpp
+++ b/kunittest/example/module/samplemodule2.cpp
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <kdebug.h>
#include <kunittest/runner.h>
@@ -40,7 +40,7 @@ KUNITTEST_MODULE_REGISTER_TESTER( SomeSampleTester )
void SimpleSampleTester::allTests()
{
kdDebug() << "Debug output belonging to SimpleSampleTester." << endl;
- CHECK( QString("SimpleSample") , QString("SimpleSample") );
+ CHECK( TQString("SimpleSample") , TQString("SimpleSample") );
// operator == is used, so this can't work...
//XFAIL( "SimpleSample" , "SampleSimple" );
@@ -55,7 +55,7 @@ void SomeSampleTester::allTests()
kdDebug() << "Checking operator precedences." << endl;
CHECK( 2.0 * 3.0 / 2.0 * 4.0 / 2.0 , 6.0 );
- QStringList testList;
+ TQStringList testList;
testList << "one" << "two";
- CHECK( testList.count() , (QStringList::size_type) 2 );
+ CHECK( testList.count() , (TQStringList::size_type) 2 );
}
diff --git a/kunittest/example/module/sampletests.cpp b/kunittest/example/module/sampletests.cpp
index 3b253e55..89e7516a 100644
--- a/kunittest/example/module/sampletests.cpp
+++ b/kunittest/example/module/sampletests.cpp
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <kdebug.h>
#include <kunittest/runner.h>
@@ -35,7 +35,7 @@
void SlotSampleTester::setUp()
{
kdDebug() << "setUp" << endl;
- m_str = new QString("setUp str");
+ m_str = new TQString("setUp str");
}
void SlotSampleTester::tearDown()
@@ -56,7 +56,7 @@ void SlotSampleTester::testSlot()
CHECK( test() , true);
CHECK( "test" , "test");
kdDebug() << "Checking if m_str is initialized correctly." << endl;
- CHECK( *m_str , QString("setUp str") );
+ CHECK( *m_str , TQString("setUp str") );
}
void SlotSampleTester::testSlot2()
@@ -72,10 +72,10 @@ void SomeSampleTester::allTests()
kdDebug() << "Checking operator precedences." << endl;
CHECK( 2.0 * 3.0 / 2.0 * 4.0 / 2.0 , 6.0 );
- QStringList testList;
+ TQStringList testList;
testList << "one" << "two";
- CHECK( testList.count() , (QStringList::size_type) 2 );
- CHECK( testList.count()*2 , (QStringList::size_type) 4 );
+ CHECK( testList.count() , (TQStringList::size_type) 2 );
+ CHECK( testList.count()*2 , (TQStringList::size_type) 4 );
}
#include "sampletests.moc"
diff --git a/kunittest/example/module/sampletests.h b/kunittest/example/module/sampletests.h
index 63ff6e44..3cd30211 100644
--- a/kunittest/example/module/sampletests.h
+++ b/kunittest/example/module/sampletests.h
@@ -41,7 +41,7 @@ public slots:
private:
bool test();
- QString *m_str;
+ TQString *m_str;
};
class SomeSampleTester : public KUnitTest::Tester
diff --git a/kunittest/example/simple/sampletest.cpp b/kunittest/example/simple/sampletest.cpp
index 32d97703..846d514f 100644
--- a/kunittest/example/simple/sampletest.cpp
+++ b/kunittest/example/simple/sampletest.cpp
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <kdebug.h>
#include <kunittest/runner.h>
@@ -39,7 +39,7 @@ KUNITTEST_REGISTER_TESTER(SomeSampleTester);
void SimpleSampleTester::allTests()
{
kdDebug() << "Debug output belonging to SimpleSampleTester." << endl;
- CHECK( QString("SimpleSample") , QString("SimpleSample") );
+ CHECK( TQString("SimpleSample") , TQString("SimpleSample") );
SKIP("Just curious how this 'skipping' works.");
}
@@ -49,7 +49,7 @@ void SomeSampleTester::allTests()
kdDebug() << "Checking operator precedences." << endl;
CHECK( 2.0 * 3.0 / 2.0 * 4.0 / 2.0 , 6.0 );
- QStringList testList;
+ TQStringList testList;
testList << "one" << "two";
- CHECK( testList.count() , (QStringList::size_type) 2 );
+ CHECK( testList.count() , (TQStringList::size_type) 2 );
}
diff --git a/kunittest/runnergui.cpp b/kunittest/runnergui.cpp
index ef5afe98..ded28e57 100644
--- a/kunittest/runnergui.cpp
+++ b/kunittest/runnergui.cpp
@@ -23,13 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <qmetaobject.h>
-#include <qregexp.h>
-#include <qpushbutton.h>
-#include <qtextedit.h>
-#include <qlabel.h>
-#include <qprogressbar.h>
-#include <qcombobox.h>
+#include <tqmetaobject.h>
+#include <tqregexp.h>
+#include <tqpushbutton.h>
+#include <tqtextedit.h>
+#include <tqlabel.h>
+#include <tqprogressbar.h>
+#include <tqcombobox.h>
#include <dcopclient.h>
#include <dcopobject.h>
@@ -68,7 +68,7 @@ namespace KUnitTest
* @param name The name of the test.
* @param info The debug info.
*/
- bool addDebugInfo(const QString &name, const QString &info)
+ bool addDebugInfo(const TQString &name, const TQString &info)
{
Tester *tester = Runner::self()->registry().find(name.local8Bit());
if ( tester == 0L ) return false;
@@ -78,7 +78,7 @@ namespace KUnitTest
return true;
}
- bool addSlotDebugInfo(const QString &name, const QString &slt, const QString &info)
+ bool addSlotDebugInfo(const TQString &name, const TQString &slt, const TQString &info)
{
Tester *tester = Runner::self()->registry().find(name.local8Bit());
@@ -95,7 +95,7 @@ namespace KUnitTest
RunnerGUI *m_rg;
};
- RunnerGUI::RunnerGUI(QWidget *parent) : QHBox(parent)
+ RunnerGUI::RunnerGUI(TQWidget *parent) : TQHBox(parent)
{
m_dcop = new RunnerGUIDCOPImpl(this);
@@ -107,12 +107,12 @@ namespace KUnitTest
m_testerWidget->selectCombo()->insertItem("Selected tests . . .");
RegistryIteratorType it(Runner::self()->registry());
- QStringList suites;
+ TQStringList suites;
for ( ; it.current(); ++it )
{
addTester(it.currentKey(), it.current());
- QString test = it.currentKey();
+ TQString test = it.currentKey();
int index = test.find("::");
if ( index != -1 ) test = test.left(index);
@@ -125,7 +125,7 @@ namespace KUnitTest
// configure the resultslist
m_testerWidget->resultList()->setAllColumnsShowFocus(true);
- m_testerWidget->resultList()->setSelectionMode(QListView::Extended);
+ m_testerWidget->resultList()->setSelectionMode(TQListView::Extended);
m_testerWidget->resultList()->setRootIsDecorated(true);
m_testerWidget->resultList()->setColumnAlignment(g_finishedColumn, Qt::AlignHCenter);
m_testerWidget->resultList()->setColumnAlignment(g_skippedColumn, Qt::AlignHCenter);
@@ -140,10 +140,10 @@ namespace KUnitTest
// init the progress bar
configureProgressBar(Runner::self()->numberOfTestCases(), 0);
- connect(Runner::self(), SIGNAL(finished(const char *, Tester *)), this, SLOT(addTestResult(const char *, Tester *)));
- connect(m_testerWidget->resultList(), SIGNAL(clicked(QListViewItem *)), this, SLOT(showDetails(QListViewItem *)));
- connect(m_testerWidget, SIGNAL(run()), this, SLOT(runSuite()));
- connect(m_testerWidget->details(), SIGNAL(doubleClicked(int, int)), this, SLOT(doubleClickedOnDetails(int, int)));
+ connect(Runner::self(), TQT_SIGNAL(finished(const char *, Tester *)), this, TQT_SLOT(addTestResult(const char *, Tester *)));
+ connect(m_testerWidget->resultList(), TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(showDetails(TQListViewItem *)));
+ connect(m_testerWidget, TQT_SIGNAL(run()), this, TQT_SLOT(runSuite()));
+ connect(m_testerWidget->details(), TQT_SIGNAL(doubleClicked(int, int)), this, TQT_SLOT(doubleClickedOnDetails(int, int)));
}
RunnerGUI::~RunnerGUI()
@@ -161,23 +161,23 @@ namespace KUnitTest
{
if ( Runner::self()->numberOfTests() > 0 )
m_testerWidget->resultsLabel()->setText(
- QString("Test cases: %1 | Tests performed: %5, Skipped: <font color=\"#f7a300\">%4</font> | Passed: <font color=\"#009900\">%2</font>, Failed: <font color=\"#990000\">%3</font>")
+ TQString("Test cases: %1 | Tests performed: %5, Skipped: <font color=\"#f7a300\">%4</font> | Passed: <font color=\"#009900\">%2</font>, Failed: <font color=\"#990000\">%3</font>")
.arg(Runner::self()->numberOfTestCases())
.arg(Runner::self()->numberOfPassedTests())
.arg(Runner::self()->numberOfFailedTests())
.arg(Runner::self()->numberOfSkippedTests())
.arg(Runner::self()->numberOfTests()) );
else
- m_testerWidget->resultsLabel()->setText(QString("Test cases: %1").arg(Runner::self()->numberOfTestCases()));
+ m_testerWidget->resultsLabel()->setText(TQString("Test cases: %1").arg(Runner::self()->numberOfTestCases()));
}
void RunnerGUI::addTestResult(const char *name, Tester *test)
{
- QStringList scopes = QStringList::split("::", name);
- QString suite = scopes[0];
+ TQStringList scopes = TQStringList::split("::", name);
+ TQString suite = scopes[0];
// find the suite item
- QListViewItem *item = 0L;
+ TQListViewItem *item = 0L;
for ( uint i = 0; i < scopes.count(); ++i )
item = getItem(scopes[i], item);
@@ -185,7 +185,7 @@ namespace KUnitTest
{
SlotTester *sltest = static_cast<SlotTester*>(test);
TestResultsListIteratorType it(sltest->resultsList());
- QListViewItem *slotItem = 0L;
+ TQListViewItem *slotItem = 0L;
for ( ; it.current(); ++it)
{
slotItem = getItem(it.currentKey(), item);
@@ -201,28 +201,28 @@ namespace KUnitTest
void RunnerGUI::addTester(const char *name, Tester *test)
{
- QStringList scopes = QStringList::split("::", name);
- QString suite = scopes[0];
+ TQStringList scopes = TQStringList::split("::", name);
+ TQString suite = scopes[0];
// find the suite item
- QListViewItem *item = 0L;
+ TQListViewItem *item = 0L;
for ( uint i = 0; i < scopes.count(); ++i )
item = getItem(scopes[i], item);
if ( test->inherits("KUnitTest::SlotTester") )
{
- QStrList allSlots = test->metaObject()->slotNames();
+ TQStrList allSlots = test->metaObject()->slotNames();
for ( char *sl = allSlots.first(); sl; sl = allSlots.next() )
{
- if ( QString(sl).startsWith("test") )
+ if ( TQString(sl).startsWith("test") )
getItem(sl, item);
}
}
}
- QListViewItem *RunnerGUI::getItem(const QString &name, QListViewItem *item /*= 0L*/)
+ TQListViewItem *RunnerGUI::getItem(const TQString &name, TQListViewItem *item /*= 0L*/)
{
- QListViewItem *parent = item;
+ TQListViewItem *parent = item;
if ( item == 0L ) item = m_testerWidget->resultList()->firstChild();
else item = item->firstChild();
@@ -234,9 +234,9 @@ namespace KUnitTest
if ( item == 0L )
{
if ( parent == 0L )
- item = new QListViewItem(m_testerWidget->resultList());
+ item = new TQListViewItem(m_testerWidget->resultList());
else
- item = new QListViewItem(parent);
+ item = new TQListViewItem(parent);
item->setText(g_nameColumn, name);
}
@@ -246,44 +246,44 @@ namespace KUnitTest
void RunnerGUI::reset()
{
- QListViewItemIterator it( m_testerWidget->resultList() );
+ TQListViewItemIterator it( m_testerWidget->resultList() );
while ( it.current() )
{
- QListViewItem *item = it.current();
+ TQListViewItem *item = it.current();
item->setText(g_finishedColumn, "0");
item->setText(g_skippedColumn, "0");
item->setText(g_failedColumn, "0");
item->setText(g_xfailedColumn, "0");
item->setText(g_passedColumn, "0");
item->setText(g_xpassedColumn, "0");
- item->setPixmap(g_nameColumn, QPixmap());
+ item->setPixmap(g_nameColumn, TQPixmap());
++it;
}
}
- void RunnerGUI::setSummary(QListViewItem *item, TestResults *res)
+ void RunnerGUI::setSummary(TQListViewItem *item, TestResults *res)
{
if ( item == 0L ) return;
bool ok;
int val = item->text(g_finishedColumn).toInt(&ok); if (!ok) val = 0;
- item->setText(g_finishedColumn, QString::number(val + res->testsFinished()));
+ item->setText(g_finishedColumn, TQString::number(val + res->testsFinished()));
val = item->text(g_skippedColumn).toInt(&ok); if (!ok) val = 0;
- item->setText(g_skippedColumn, QString::number(val + res->skipped()));
+ item->setText(g_skippedColumn, TQString::number(val + res->skipped()));
val = item->text(g_passedColumn).toInt(&ok); if (!ok) val = 0;
- item->setText(g_passedColumn, QString::number(val + res->passed()));
+ item->setText(g_passedColumn, TQString::number(val + res->passed()));
val = item->text(g_failedColumn).toInt(&ok); if (!ok) val = 0;
- item->setText(g_failedColumn, QString::number(val + res->errors()));
+ item->setText(g_failedColumn, TQString::number(val + res->errors()));
val = item->text(g_xfailedColumn).toInt(&ok); if (!ok) val = 0;
- item->setText(g_xfailedColumn, QString::number(val + res->xfails()));
+ item->setText(g_xfailedColumn, TQString::number(val + res->xfails()));
val = item->text(g_xpassedColumn).toInt(&ok); if (!ok) val = 0;
- item->setText(g_xpassedColumn, QString::number(val + res->xpasses()));
+ item->setText(g_xpassedColumn, TQString::number(val + res->xpasses()));
bool passed = (item->text(g_failedColumn).toInt(&ok) + item->text(g_xfailedColumn).toInt(&ok)) == 0;
item->setPixmap(g_nameColumn, passed ? SmallIcon("button_ok") : SmallIcon("button_cancel") );
@@ -291,9 +291,9 @@ namespace KUnitTest
setSummary(item->parent(), res);
}
- QString RunnerGUI::fullName(QListViewItem *item)
+ TQString RunnerGUI::fullName(TQListViewItem *item)
{
- QString name = item->text(g_nameColumn);
+ TQString name = item->text(g_nameColumn);
while ( (item = item->parent()) != 0L )
name = item->text(g_nameColumn) + "::" + name;
@@ -312,14 +312,14 @@ namespace KUnitTest
}
else if ( m_testerWidget->selectCombo()->currentItem() == 1 )
{
- QListViewItemIterator it( m_testerWidget->resultList() );
- QStringList prefixes;
+ TQListViewItemIterator it( m_testerWidget->resultList() );
+ TQStringList prefixes;
while ( it.current() )
{
- QListViewItem *item = it.current();
+ TQListViewItem *item = it.current();
if ( item->isSelected() )
{
- QString prefix = fullName(item);
+ TQString prefix = fullName(item);
if ( prefix.endsWith("()") )
{
int index = prefix.findRev("::");
@@ -337,11 +337,11 @@ namespace KUnitTest
}
else
{
- QString suite = m_testerWidget->selectCombo()->currentText();
- QStringList tests;
+ TQString suite = m_testerWidget->selectCombo()->currentText();
+ TQStringList tests;
RegistryIteratorType it(Runner::self()->registry());
for ( ; it.current(); ++it )
- if ( QString(it.currentKey()).startsWith(suite) )
+ if ( TQString(it.currentKey()).startsWith(suite) )
tests.append(it.currentKey());
configureProgressBar(tests.count(), 0);
@@ -353,11 +353,11 @@ namespace KUnitTest
showDetails(m_testerWidget->resultList()->currentItem());
}
- void RunnerGUI::showDetails(QListViewItem *item)
+ void RunnerGUI::showDetails(TQListViewItem *item)
{
if ( item == 0L ) return;
- QString name = fullName(item);
+ TQString name = fullName(item);
if ( name.endsWith("()") ) name = fullName(item->parent());
Tester *tester = Runner::self()->registry().find(name.local8Bit());
@@ -374,7 +374,7 @@ namespace KUnitTest
m_testerWidget->details()->setText("No test found with name: " + fullName(item));
else
{
- QTextEdit *te = m_testerWidget->details();
+ TQTextEdit *te = m_testerWidget->details();
te->clear();
@@ -401,7 +401,7 @@ namespace KUnitTest
}
}
- void RunnerGUI::appendList(QTextEdit *te, const QStringList &list)
+ void RunnerGUI::appendList(TQTextEdit *te, const TQStringList &list)
{
for ( uint i = 0; i < list.count(); ++i )
te->append(list[i]);
@@ -409,20 +409,20 @@ namespace KUnitTest
void RunnerGUI::doubleClickedOnDetails(int para, int /*pos*/)
{
- static QRegExp reFileAndLine("^(.*)\\[([0-9]+)\\]:");
+ static TQRegExp reFileAndLine("^(.*)\\[([0-9]+)\\]:");
- QString line = m_testerWidget->details()->text(para);
+ TQString line = m_testerWidget->details()->text(para);
m_testerWidget->details()->setSelection(para, 0, para, line.length()-1);
if ( reFileAndLine.search(line) != -1 )
{
DCOPClient client;
client.attach();
- QByteArray data;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data;
+ TQDataStream arg(data, IO_WriteOnly);
bool ok;
- arg << QString(reFileAndLine.cap(1)) << (reFileAndLine.cap(2).toInt(&ok) - 1);
- client.send("kdevelop-*", "KDevPartController", "editDocument(QString,int)", data);
+ arg << TQString(reFileAndLine.cap(1)) << (reFileAndLine.cap(2).toInt(&ok) - 1);
+ client.send("kdevelop-*", "KDevPartController", "editDocument(TQString,int)", data);
client.send("kdevelop-*", "MainWindow", "raise()", "");
client.detach();
diff --git a/kunittest/runnergui.h b/kunittest/runnergui.h
index dbd03666..cda237a5 100644
--- a/kunittest/runnergui.h
+++ b/kunittest/runnergui.h
@@ -26,8 +26,8 @@
#ifndef _KUNITTEST_TESTER_H_
#define _KUNITTEST_TESTER_H_
-#include <qlistview.h>
-#include <qhbox.h>
+#include <tqlistview.h>
+#include <tqhbox.h>
#include <kunittest/runner.h>
#include <kunittest/tester.h>
@@ -46,13 +46,13 @@ namespace KUnitTest
Q_OBJECT
public:
- RunnerGUI(QWidget *parent);
+ RunnerGUI(TQWidget *parent);
~RunnerGUI();
private slots:
void addTestResult(const char *name, Tester *test);
void addTester(const char *name, Tester *test);
- void showDetails(QListViewItem *item);
+ void showDetails(TQListViewItem *item);
void runSuite();
void doubleClickedOnDetails(int para, int pos);
@@ -60,13 +60,13 @@ namespace KUnitTest
void reset();
void configureProgressBar(int steps, int progress);
void fillResultsLabel();
- void appendList(QTextEdit *te, const QStringList &list);
+ void appendList(TQTextEdit *te, const TQStringList &list);
- QListViewItem *getItem(const QString &name, QListViewItem *item = 0L);
- void setItem(QListViewItem *item, const TestResults *res);
- QString fullName(QListViewItem *item);
+ TQListViewItem *getItem(const TQString &name, TQListViewItem *item = 0L);
+ void setItem(TQListViewItem *item, const TestResults *res);
+ TQString fullName(TQListViewItem *item);
- void setSummary(QListViewItem *item, TestResults *res);
+ void setSummary(TQListViewItem *item, TestResults *res);
TesterWidget *m_testerWidget;
diff --git a/kunittest/testerwidget.ui.h b/kunittest/testerwidget.ui.h
index b895a357..fd79eb96 100644
--- a/kunittest/testerwidget.ui.h
+++ b/kunittest/testerwidget.ui.h
@@ -13,34 +13,34 @@
void TesterWidget::init()
{
- connect(m_pshRun, SIGNAL(clicked()), this, SIGNAL(run()));
+ connect(m_pshRun, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(run()));
}
-QListView * TesterWidget::resultList()
+TQListView * TesterWidget::resultList()
{
return m_lvResults;
}
-QTextEdit * TesterWidget::details()
+TQTextEdit * TesterWidget::details()
{
return m_teDetails;
}
-QProgressBar * TesterWidget::progressBar()
+TQProgressBar * TesterWidget::progressBar()
{
return m_pbProgress;
}
-QLabel * TesterWidget::resultsLabel()
+TQLabel * TesterWidget::resultsLabel()
{
return m_lbResults;
}
-QComboBox * TesterWidget::selectCombo()
+TQComboBox * TesterWidget::selectCombo()
{
return m_cbSelect;
}