summaryrefslogtreecommitdiffstats
path: root/kexi/plugins/macros/tests/commontests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/plugins/macros/tests/commontests.cpp')
-rw-r--r--kexi/plugins/macros/tests/commontests.cpp246
1 files changed, 123 insertions, 123 deletions
diff --git a/kexi/plugins/macros/tests/commontests.cpp b/kexi/plugins/macros/tests/commontests.cpp
index 84c596aa..1086a340 100644
--- a/kexi/plugins/macros/tests/commontests.cpp
+++ b/kexi/plugins/macros/tests/commontests.cpp
@@ -36,8 +36,8 @@
#include <ostream>
#include <climits>
-#include <qstringlist.h>
-#include <qdom.h>
+#include <tqstringlist.h>
+#include <tqdom.h>
#include <kdebug.h>
#include <kunittest/runner.h>
@@ -71,14 +71,14 @@ namespace KoMacroTest {
/**
* An @a TestObject instance used internaly to test
- * handling and communication with from QObject
+ * handling and communication with from TQObject
* inheritated instances.
*/
TestObject* testobject;
TestAction* testaction;
- QDomDocument* doomdocument;
+ TQDomDocument* doomdocument;
/**
* Constructor.
@@ -94,7 +94,7 @@ namespace KoMacroTest {
}
-typedef QValueList< KSharedPtr<KoMacro::MacroItem> >::size_type sizetype;
+typedef TQValueList< KSharedPtr<KoMacro::MacroItem> >::size_type sizetype;
CommonTests::CommonTests()
: KUnitTest::SlotTester()
@@ -119,9 +119,9 @@ void CommonTests::setUp()
d->testaction = new TestAction();
::KoMacro::Manager::self()->publishAction(d->testaction);
- d->doomdocument = new QDomDocument();
+ d->doomdocument = new TQDomDocument();
- QString const xml = QString("<!DOCTYPE macros>"
+ TQString const xml = TQString("<!DOCTYPE macros>"
"<macro xmlversion=\"1\">"
@@ -146,14 +146,14 @@ void CommonTests::testManager()
//check if manager-guiClient equals xmlguiclient
KOMACROTEST_ASSERT( ::KoMacro::Manager::self()->guiClient(), d->xmlguiclient );
//check if manger-object equals testobject
- KOMACROTEST_ASSERT( dynamic_cast<TestObject*>( (QObject*)::KoMacro::Manager::self()->object("TestObject") ), d->testobject );
+ KOMACROTEST_ASSERT( dynamic_cast<TestObject*>( (TQObject*)::KoMacro::Manager::self()->object("TestObject") ), d->testobject );
}
/*
void CommonTests::testAction()
{
- const QString testString = "teststring";
- const QString testInt = "testint";
- const QString testBool = "testbool";
+ const TQString testString = "teststring";
+ const TQString testInt = "testint";
+ const TQString testBool = "testbool";
//TODO: CLEANUP!!!!!!
//TODO: test manipulation of action and macroitem and context.
@@ -162,7 +162,7 @@ void CommonTests::testAction()
//Publish TestAction for the first time.
- QDomElement const domelement = d->doomdocument->documentElement();
+ TQDomElement const domelement = d->doomdocument->documentElement();
KSharedPtr<KoMacro::Macro> macro = KoMacro::Manager::self()->createMacro("testMacro");
@@ -173,7 +173,7 @@ void CommonTests::testAction()
macro->execute(this);
//create list of KSharedPtr from the childs of the macro
- QValueList< KSharedPtr<KoMacro::MacroItem> >& items = macro->items();
+ TQValueList< KSharedPtr<KoMacro::MacroItem> >& items = macro->items();
//check that there is one
@@ -188,7 +188,7 @@ void CommonTests::testAction()
//check that it is not null
KOMACROTEST_XASSERT(sizetype(variableptr.data()), sizetype(0));
//check that it is " "
- KOMACROTEST_ASSERT(variableptr->variant().toString(),QString("testString"));
+ KOMACROTEST_ASSERT(variableptr->variant().toString(),TQString("testString"));
//fetch the "testint"-variable
variableptr = actionptr->variable("testint");
@@ -209,7 +209,7 @@ void CommonTests::testAction()
//check that it is not null
KOMACROTEST_XASSERT(sizetype(variableptr.data()), sizetype(0));
//check that it is " "
- KOMACROTEST_ASSERT(variableptr->variant().toString(),QString("TestString"));
+ KOMACROTEST_ASSERT(variableptr->variant().toString(),TQString("TestString"));
actionptr->setVariable("testint","INTTEST",INT_MAX);
variableptr = actionptr->variable("testint");
@@ -234,7 +234,7 @@ void CommonTests::testAction()
macroitem->setVariable("teststring", "TeStString");
variableptr = macroitem->variable("teststring");
KOMACROTEST_XASSERT(sizetype(variableptr.data()), sizetype(0));
- KOMACROTEST_ASSERT(variableptr->variant().toString(),QString("TeStString"));
+ KOMACROTEST_ASSERT(variableptr->variant().toString(),TQString("TeStString"));
macroitem->setVariable("testint",INT_MIN);
variableptr = macroitem->variable("testint");
@@ -249,8 +249,8 @@ void CommonTests::testAction()
//commontests.cpp: In member function 'void KoMacroTest::CommonTests::testAction()':
//commontests.cpp:249: error: call of overloaded 'setVariable(const char [8], int)' is ambiguous
- //../lib/macroitem.h:131: note: candidates are: QStringList KoMacro::MacroItem::setVariable(const QString&, KSharedPtr<KoMacro::Variable>)
- //../lib/macroitem.h:137: note: QStringList KoMacro::MacroItem::setVariable(const QString&, const QVariant&)
+ //../lib/macroitem.h:131: note: candidates are: TQStringList KoMacro::MacroItem::setVariable(const TQString&, KSharedPtr<KoMacro::Variable>)
+ //../lib/macroitem.h:137: note: TQStringList KoMacro::MacroItem::setVariable(const TQString&, const TQVariant&)
macroitem->setVariable("testint",(int) 0);
variableptr = macroitem->variable("testint");
@@ -286,14 +286,14 @@ void CommonTests::testXmlhandler()
// Local Init
KSharedPtr<KoMacro::Macro> macro = KoMacro::Manager::self()->createMacro("testMacro");
- QDomElement domelement;
+ TQDomElement domelement;
// Save old doomdocument
- QString xmlOld = d->doomdocument->toString();
+ TQString xmlOld = d->doomdocument->toString();
// Part 1: From XML to a Macro.
// Test-XML-document with normal allocated variables.
- QString xml = QString("<!DOCTYPE macros>"
+ TQString xml = TQString("<!DOCTYPE macros>"
"<macro xmlversion=\"1\">"
"<item action=\"testaction\" >"
"<variable name=\"teststring\" >testString</variable>"
@@ -310,7 +310,7 @@ void CommonTests::testXmlhandler()
KOMACROTEST_ASSERT(macro->parseXML(domelement),true);
// Test-XML-document with bad root element.
- xml = QString("<!DOCTYPE macros>"
+ xml = TQString("<!DOCTYPE macros>"
"<maro xmlversion=\"1\">"
"<item action=\"testaction\" >"
"<variable name=\"teststring\" >testString</variable>"
@@ -324,7 +324,7 @@ void CommonTests::testXmlhandler()
KOMACROTEST_ASSERT(macro->parseXML(domelement),false);
// Test-XML-document with wrong macro-xmlversion.
- xml = QString("<!DOCTYPE macros>"
+ xml = TQString("<!DOCTYPE macros>"
"<macro xmlversion=\"2\">"
"<item action=\"testaction\" >"
"<variable name=\"teststring\" >testString</variable>"
@@ -339,7 +339,7 @@ void CommonTests::testXmlhandler()
// TODO Test-XML-document if it has a wrong structure like wrong parathesis
// or missing end tag (is this critical??).
- /*xml = QString("<!DOCTYPE macros>"
+ /*xml = TQString("<!DOCTYPE macros>"
"<macro xmlversion=\"1\">"
"<item action=\"testaction\" >"
"<variable name=\"teststring\" >testString</variable>"
@@ -353,7 +353,7 @@ void CommonTests::testXmlhandler()
// Test-XML-document with wrong item- and variable-tags.
// TODO Could this happen??
- xml = QString("<!DOCTYPE macros>"
+ xml = TQString("<!DOCTYPE macros>"
"<macro xmlversion=\"1\">"
"<iem action=\"testaction\" >"
"<vle name=\"teststring\" >testString</variable>"
@@ -367,7 +367,7 @@ void CommonTests::testXmlhandler()
KOMACROTEST_ASSERT(macro->parseXML(domelement),true); //should be false?
// TODO Test-XML-document with maximum field-size.
- xml = QString("<!DOCTYPE macros>"
+ xml = TQString("<!DOCTYPE macros>"
"<macro xmlversion=\"1\">"
"<item action=\"testaction\" >"
"<variable name=\"teststring\" >testString</variable>"
@@ -381,7 +381,7 @@ void CommonTests::testXmlhandler()
KOMACROTEST_ASSERT(macro->parseXML(domelement),true);
// TODO Test-XML-document with minimum field-size.
- xml = QString("<!DOCTYPE macros>"
+ xml = TQString("<!DOCTYPE macros>"
"<macro xmlversion=\"1\">"
"<item action=\"testaction\" >"
"<variable name=\"teststring\" >testString</variable>"
@@ -410,21 +410,21 @@ void CommonTests::testFunction()
/*
kdDebug()<<"===================== testFunction() ======================" << endl;
- //create a QDomDocument
- QDomDocument domdocument = QDomDocument();
+ //create a TQDomDocument
+ TQDomDocument domdocument = TQDomDocument();
//create some data
- QString const comment = "Describe what the function does";
- QString const name = "myfunc";
- QString const text = "My Function";
- QString const receiver = "TestObject";
- QString const argument1 = "Some string";
+ TQString const comment = "Describe what the function does";
+ TQString const name = "myfunc";
+ TQString const text = "My Function";
+ TQString const receiver = "TestObject";
+ TQString const argument1 = "Some string";
int const argument2 = 12345;
- //set "Function"-content in QDocument
- domdocument.setContent(QString(
- "<function name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver + "\" slot=\"myslot(const QString &amp; , int)\">"
+ //set "Function"-content in TQDocument
+ domdocument.setContent(TQString(
+ "<function name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver + "\" slot=\"myslot(const TQString &amp; , int)\">"
"<argument>" + argument1 + "</argument>"
- "<argument>" + QString("%1").arg(argument2) + "</argument>"
+ "<argument>" + TQString("%1").tqarg(argument2) + "</argument>"
"</function>"
));
@@ -438,7 +438,7 @@ void CommonTests::testFunction()
//check domElement
KOMACROTEST_ASSERT( func->domElement(), domdocument.documentElement() );
//check name
- KOMACROTEST_ASSERT( QString(func->name()), name );
+ KOMACROTEST_ASSERT( TQString(func->name()), name );
//check text
KOMACROTEST_ASSERT( func->text(), text );
//check comment
@@ -446,7 +446,7 @@ void CommonTests::testFunction()
//check receiver
KOMACROTEST_ASSERT( func->receiver(), receiver );
//check slot (arguments)
- KOMACROTEST_ASSERT( QString(func->slot()), QString("myslot(const QString&,int)") );
+ KOMACROTEST_ASSERT( TQString(func->slot()), TQString("myslot(const TQString&,int)") );
//create KoMacro-MetaObject from receiverObject
KSharedPtr<KoMacro::MetaObject> receivermetaobject = func->receiverObject();
@@ -466,14 +466,14 @@ void CommonTests::testFunction()
for( it = funcvariables.constBegin(); it != end; ++it) {
kdDebug() << "VARIABLE => " << (*it ? (*it)->toString() : "<NULL>") << endl;
//hardcoded test:
- // firstrun we have a QString, secondrun we have an int
+ // firstrun we have a TQString, secondrun we have an int
switch(i) {
case 0: { // returnvalue
KOMACROTEST_ASSERT(*it, KSharedPtr<KoMacro::Variable>(NULL));
} break;
case 1: { // first parameter
//check first variable of func is the same as argument1
- //QString const argument1 = "Some string";
+ //TQString const argument1 = "Some string";
KOMACROTEST_ASSERT((*it)->toString(), argument1);
} break;
case 2: { // second parameter
@@ -497,10 +497,10 @@ void CommonTests::testFunction()
KSharedPtr<KoMacro::Variable> stringvar = funcvariables[1];
//check that it is not null
KOMACROTEST_XASSERT((int) stringvar.data(),0);
- //check via QVariant type that stringvar is from Type Variant
+ //check via TQVariant type that stringvar is from Type Variant
KOMACROTEST_ASSERT( stringvar->type(), KoMacro::MetaParameter::TypeVariant );
//check via metaparameter that variant is from type string
- KOMACROTEST_ASSERT( stringvar->variantType(), QVariant::String );
+ KOMACROTEST_ASSERT( stringvar->variantType(), TQVariant::String );
//chech that stringvar equals argument1
KOMACROTEST_ASSERT( stringvar->toString(), argument1 );
@@ -508,10 +508,10 @@ void CommonTests::testFunction()
KSharedPtr<KoMacro::Variable> intvar = funcvariables[2];
//check that it is not null
KOMACROTEST_XASSERT((int) intvar.data(), 0);
- //check via QVariant type that stringvar is from Type Variant
+ //check via TQVariant type that stringvar is from Type Variant
KOMACROTEST_ASSERT( intvar->type(), KoMacro::MetaParameter::TypeVariant );
//check that intvar is An String -> we create an string from int because of xml
- KOMACROTEST_ASSERT( intvar->variantType(), QVariant::String );
+ KOMACROTEST_ASSERT( intvar->variantType(), TQVariant::String );
//check that intvar equals argument2
KOMACROTEST_ASSERT( intvar->toInt(), argument2 );
@@ -522,7 +522,7 @@ void CommonTests::testFunction()
//check returnvalue
//func->setReturnValue(new KoMacro::Variable("54321"));
- //KOMACROTEST_ASSERT( func->returnValue()->toString(), QString("54321") );
+ //KOMACROTEST_ASSERT( func->returnValue()->toString(), TQString("54321") );
*/
}
@@ -532,12 +532,12 @@ void CommonTests::testIntFunction()
/*
kdDebug()<<"===================== testIntFunction() ======================" << endl;
- //create a QDomDocument
- QDomDocument domdocument = QDomDocument();
+ //create a TQDomDocument
+ TQDomDocument domdocument = TQDomDocument();
- //set "Function"-content in QDocument
- domdocument.setContent(QString(
- "<function name=\"myfunc\" text=\"My Function\" comment=\"comment\" receiver=\"TestObject\" slot=\"myslot(const QString &amp; , int)\">"
+ //set "Function"-content in TQDocument
+ domdocument.setContent(TQString(
+ "<function name=\"myfunc\" text=\"My Function\" comment=\"comment\" receiver=\"TestObject\" slot=\"myslot(const TQString &amp; , int)\">"
"<argument>Some string</argument>"
"<argument>12345</argument>"
"</function>"
@@ -552,7 +552,7 @@ void CommonTests::testIntFunction()
//execute the function
func->activate();
//Check returnvalue is same value we entered
- //KOMACROTEST_ASSERT(func->returnValue()->toString(),QString("12345"));
+ //KOMACROTEST_ASSERT(func->returnValue()->toString(),TQString("12345"));
*/
}
@@ -562,12 +562,12 @@ void CommonTests::testDoubleFunction()
/*
kdDebug()<<"===================== testDoubleFunction() ======================" << endl;
- //create a QDomDocument
- QDomDocument domdocument = QDomDocument();
+ //create a TQDomDocument
+ TQDomDocument domdocument = TQDomDocument();
- //set "Function"-content in QDocument
- domdocument.setContent(QString(
- "<function name=\"myfunc\" text=\"My Function\" comment=\"comment\" receiver=\"TestObject\" slot=\"myslot(const QString &amp; , double)\">"
+ //set "Function"-content in TQDocument
+ domdocument.setContent(TQString(
+ "<function name=\"myfunc\" text=\"My Function\" comment=\"comment\" receiver=\"TestObject\" slot=\"myslot(const TQString &amp; , double)\">"
"<argument>Some string</argument>"
"<argument>12.56</argument>"
"</function>"
@@ -582,22 +582,22 @@ void CommonTests::testDoubleFunction()
//execute the function
func->activate();
//Check returnvalue is same value we entered
- //KOMACROTEST_ASSERT(func->returnValue()->toString(),QString("12.56"));
+ //KOMACROTEST_ASSERT(func->returnValue()->toString(),TQString("12.56"));
*/
}
-void CommonTests::testQStringFunction()
+void CommonTests::testTQStringFunction()
{
//TODO: CLEANUP!!!!!!
/*
- kdDebug()<<"===================== testQStringFunction() ======================" << endl;
+ kdDebug()<<"===================== testTQStringFunction() ======================" << endl;
- //create a QDomDocument
- QDomDocument domdocument = QDomDocument();
+ //create a TQDomDocument
+ TQDomDocument domdocument = TQDomDocument();
- //set "Function"-content in QDocument
- domdocument.setContent(QString(
- "<function name=\"myfunc\" text=\"My Function\" comment=\"comment\" receiver=\"TestObject\" slot=\"myslot(const QString &amp;)\">"
+ //set "Function"-content in TQDocument
+ domdocument.setContent(TQString(
+ "<function name=\"myfunc\" text=\"My Function\" comment=\"comment\" receiver=\"TestObject\" slot=\"myslot(const TQString &amp;)\">"
"<argument>Some string</argument>"
"</function>"
));
@@ -610,7 +610,7 @@ void CommonTests::testQStringFunction()
KOMACROTEST_XASSERT((int) func, 0);
//execute the function func->activate();
//Check returnvalue is same value we entered
- //KOMACROTEST_ASSERT(func->returnValue()->toString(),QString("Some string"));
+ //KOMACROTEST_ASSERT(func->returnValue()->toString(),TQString("Some string"));
*/
}
@@ -619,20 +619,20 @@ void CommonTests::testMacro()
//TODO: CLEANUP!!!!!!
kdDebug()<<"===================== testMacro() ======================" << endl;
- QDomElement const domelement = d->doomdocument->documentElement();
+ TQDomElement const domelement = d->doomdocument->documentElement();
KSharedPtr<KoMacro::Macro> macro = KoMacro::Manager::self()->createMacro("testMacro");
//Is our XML parseable ?
KOMACROTEST_ASSERT(macro->parseXML(domelement),true);
-// //create a QDomDocument
-// QDomDocument domdocument = QDomDocument();
+// //create a TQDomDocument
+// TQDomDocument domdocument = TQDomDocument();
//
// //Fully fleged content this time with macro,function and action
-// domdocument.setContent(QString(
+// domdocument.setContent(TQString(
// "<macro name=\"mymacro\" icon=\"myicon\" text=\"My Macro\" comment=\"Some comment to describe the Macro.\">"
// "<action name=\"myaction\" text=\"My Action\" comment=\"Just some comment\" />"
-// "<function name=\"myfunc\" text=\"My Function\" comment=\"Describe what the function does\" receiver=\"TestObject\" slot=\"myslot(const QString &amp;)\">"
+// "<function name=\"myfunc\" text=\"My Function\" comment=\"Describe what the function does\" receiver=\"TestObject\" slot=\"myslot(const TQString &amp;)\">"
// "<argument>The myfunc argument string</argument>"
// "</function>"
// "</macro>"
@@ -647,21 +647,21 @@ void CommonTests::testMacro()
//check that domeElement given to manager is the sam as in the macro
// KOMACROTEST_ASSERT( macro->toXML(), d->doomdocument->documentElement() );
//check the name
- KOMACROTEST_ASSERT( QString(macro->name()), QString("testMacro") );
+ KOMACROTEST_ASSERT( TQString(macro->name()), TQString("testMacro") );
/**
@deprecated values no longer exist
//check the text
- KOMACROTEST_ASSERT( macro->text(), QString("My Macro") );
+ KOMACROTEST_ASSERT( macro->text(), TQString("My Macro") );
//check iconname
- KOMACROTEST_ASSERT( QString(macro->icon()), QString("myicon") );
+ KOMACROTEST_ASSERT( TQString(macro->icon()), TQString("myicon") );
//check comment
- KOMACROTEST_ASSERT( macro->comment(), QString("Some comment to describe the Macro.") );
+ KOMACROTEST_ASSERT( macro->comment(), TQString("Some comment to describe the Macro.") );
*/
//create list of KsharedPtr from the childs of the macro
- QValueList< KSharedPtr<KoMacro::MacroItem> >& items = macro->items();
+ TQValueList< KSharedPtr<KoMacro::MacroItem> >& items = macro->items();
//check that there is one
KOMACROTEST_ASSERT( items.count(), sizetype(1) );
//fetch the first one
@@ -670,14 +670,14 @@ void CommonTests::testMacro()
//-> check that it is not null
KOMACROTEST_XASSERT(sizetype(actionptr.data()), sizetype(0));
//check that it has the right name
- KOMACROTEST_ASSERT( QString(actionptr->name()), QString("testaction") );
+ KOMACROTEST_ASSERT( TQString(actionptr->name()), TQString("testaction") );
//check that it has the right text
- KOMACROTEST_ASSERT( actionptr->text(), QString("Test") );
+ KOMACROTEST_ASSERT( actionptr->text(), TQString("Test") );
//check that it has the right comment
-// KOMACROTEST_ASSERT( actionptr->comment(), QString("") );
+// KOMACROTEST_ASSERT( actionptr->comment(), TQString("") );
/*
//fetch the second one
- KSharedPtr<KoMacro::Action> myfuncptr = children[1];
+ KSharedPtr<KoMacro::Action> myfuncptr = tqchildren[1];
//cast it to function
KoMacro::Function* myfunc = dynamic_cast<KoMacro::Function*>( myfuncptr.data() );
@@ -685,16 +685,16 @@ void CommonTests::testMacro()
KOMACROTEST_XASSERT((int) myfunc, 0);
//check it?s name
- KOMACROTEST_ASSERT( QString(myfunc->name()), QString("myfunc"));
+ KOMACROTEST_ASSERT( TQString(myfunc->name()), TQString("myfunc"));
//check it?s text
- KOMACROTEST_ASSERT( myfunc->text(), QString("My Function") );
+ KOMACROTEST_ASSERT( myfunc->text(), TQString("My Function") );
//check it?s comment
- KOMACROTEST_ASSERT( myfunc->comment(), QString("Describe what the function does") );
+ KOMACROTEST_ASSERT( myfunc->comment(), TQString("Describe what the function does") );
//check it?s receiver object
- KOMACROTEST_ASSERT( myfunc->receiver(), QString("TestObject") );
+ KOMACROTEST_ASSERT( myfunc->receiver(), TQString("TestObject") );
//check it?s slot
- KOMACROTEST_ASSERT( myfunc->slot(), QString("myslot(const QString&)") );
+ KOMACROTEST_ASSERT( myfunc->slot(), TQString("myslot(const TQString&)") );
//exceute it
myfunc->activate();
@@ -712,8 +712,8 @@ void CommonTests::testMacro()
//KOMACROTEST_XASSERT((int) yanActionptr2.data(), 0);
//KOMACROTEST_XASSERT((int) yanActionptr3.data(), 0);
- //create a list of the children from yanMacro
- //QValueList< KSharedPtr<KoMacro::Action> > yanChildren = yanMacro->children();
+ //create a list of the tqchildren from yanMacro
+ //TQValueList< KSharedPtr<KoMacro::Action> > yanChildren = yanMacro->tqchildren();
//check that there are two
//KOMACROTEST_ASSERT(yanChildren.count(), uint(2));
/*
@@ -722,9 +722,9 @@ void CommonTests::testMacro()
const int oldsize = yanChildren.count();
//add a new child to the macro
yanMacro->addChild(yanActionptr2);
- //get the children
- yanChildren = yanMacro->children();
- //get count of children
+ //get the tqchildren
+ yanChildren = yanMacro->tqchildren();
+ //get count of tqchildren
const int size = yanChildren.count();
//check count has changed
KOMACROTEST_XASSERT(size, oldsize);
@@ -735,9 +735,9 @@ void CommonTests::testMacro()
const int oldsize = yanChildren.count();
//add a new child to the macro
yanMacro->addChild(yanActionptr3);
- //get the children
- yanChildren = yanMacro->children();
- //get count of children
+ //get the tqchildren
+ yanChildren = yanMacro->tqchildren();
+ //get count of tqchildren
const int size = yanChildren.count();
//check count has changed
KOMACROTEST_XASSERT(size, oldsize);
@@ -752,18 +752,18 @@ void CommonTests::testDom() {
//TODO: CLEANUP!!!!!!
kdDebug()<<"===================== testDom() ======================" << endl;
/*
- //create a QDomDocument
- QDomDocument domdocument = QDomDocument();
+ //create a TQDomDocument
+ TQDomDocument domdocument = TQDomDocument();
//create data for various documents
- QString const comment = "Describe what the function does";
- QString const name = "myfunc";
- QString const text = "My Function";
- QString const receiver1 = "TestObject";
- QString const receiver2 = "GibtsNich";
+ TQString const comment = "Describe what the function does";
+ TQString const name = "myfunc";
+ TQString const text = "My Function";
+ TQString const receiver1 = "TestObject";
+ TQString const receiver2 = "GibtsNich";
//create wrong Argument tag
- domdocument.setContent(QString(
- "<function name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver1 + "\" slot=\"myslot(const QString &amp; , int)\">"
+ domdocument.setContent(TQString(
+ "<function name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver1 + "\" slot=\"myslot(const TQString &amp; , int)\">"
"<Arg0ment>Some string</Arg0ment>"
"<Arg0ment>12345</Arg0ment>"
"</function>"
@@ -774,8 +774,8 @@ void CommonTests::testDom() {
KOMACROTEST_ASSERTEXCEPTION(KoMacro::Exception&, macroptr->activate());
//create wrong receiver
- domdocument.setContent(QString(
- "<function name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver2 + "\" slot=\"myslot(const QString &amp; , int)\">"
+ domdocument.setContent(TQString(
+ "<function name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver2 + "\" slot=\"myslot(const TQString &amp; , int)\">"
"<argument>Some string</argument>"
"<argument>12345</argument>"
"</function>"
@@ -786,8 +786,8 @@ void CommonTests::testDom() {
KOMACROTEST_ASSERTEXCEPTION(KoMacro::Exception&, macroptr->activate());
//create "wrong" number of parameters
- domdocument.setContent(QString(
- "<function name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver1 + "\" slot=\"myslot(const QString &amp; , int, double)\">"
+ domdocument.setContent(TQString(
+ "<function name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver1 + "\" slot=\"myslot(const TQString &amp; , int, double)\">"
"<argument>Some string</argument>"
"<argument>12345</argument>"
"<argument>12345.25</argument>"
@@ -799,8 +799,8 @@ void CommonTests::testDom() {
KOMACROTEST_ASSERTEXCEPTION(KoMacro::Exception&, macroptr->activate());
//create wrong function tag
- domdocument.setContent(QString(
- "<NoFunction name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver1 + "\" slot=\"myslot(const QString &amp; , int, double)\">"
+ domdocument.setContent(TQString(
+ "<NoFunction name=\"" + name + "\" text=\"" + text + "\" comment=\"" + comment + "\" receiver=\"" + receiver1 + "\" slot=\"myslot(const TQString &amp; , int, double)\">"
"<argument>Some string</argument>"
"<argument>12345</argument>"
"<argument>12345.25</argument>"
@@ -810,7 +810,7 @@ void CommonTests::testDom() {
KOMACROTEST_ASSERTEXCEPTION(KoMacro::Exception&, macroptr = ::KoMacro::Manager::self()->createAction( domdocument.documentElement() ));
//create empty function
- domdocument.setContent(QString(
+ domdocument.setContent(TQString(
"<function name=\"\" text=\"\" comment=\"\" receiver=\"\" slot=\"\">"
"<argument> </argument>"
"<argument> </argument>"
@@ -824,7 +824,7 @@ void CommonTests::testDom() {
//create empty function
- domdocument.setContent(QString(
+ domdocument.setContent(TQString(
"<function>"
"</function>"
));
@@ -840,12 +840,12 @@ void CommonTests::testVariables()
//TODO: CLEANUP!!!!!!
kdDebug()<<"===================== testVariables() ======================" << endl;
/*
- //create a QDomDocument
- QDomDocument domdocument = QDomDocument();
+ //create a TQDomDocument
+ TQDomDocument domdocument = TQDomDocument();
//create data
- domdocument.setContent(QString(
+ domdocument.setContent(TQString(
"<macro name=\"mymacro123\" text=\"My Macro 123\">"
- "<function name=\"func1\" text=\"Function1\" receiver=\"TestObject\" slot=\"myslot(const QString &amp;)\" >"
+ "<function name=\"func1\" text=\"Function1\" receiver=\"TestObject\" slot=\"myslot(const TQString &amp;)\" >"
"<argument>$MyArgumentVariable</argument>"
"<return>$MyReturnVariable</return>"
"</function>"
@@ -859,12 +859,12 @@ void CommonTests::testVariables()
//check that it is not null
KOMACROTEST_XASSERT((int) macro, 0);
- //create a list of its children
- QValueList< KSharedPtr<KoMacro::Action> > children = macro->children();
- //Check that there are two children. The first child is always the returnvalue.
- KOMACROTEST_ASSERT( children.count(), uint(2) );
- //fetch the children
- KSharedPtr<KoMacro::Action> func1ptr = children[1];
+ //create a list of its tqchildren
+ TQValueList< KSharedPtr<KoMacro::Action> > tqchildren = macro->tqchildren();
+ //Check that there are two tqchildren. The first child is always the returnvalue.
+ KOMACROTEST_ASSERT( tqchildren.count(), uint(2) );
+ //fetch the tqchildren
+ KSharedPtr<KoMacro::Action> func1ptr = tqchildren[1];
//create new context
KSharedPtr<KoMacro::Context> context = new KoMacro::Context(macroptr);
@@ -877,7 +877,7 @@ void CommonTests::testVariables()
}
{
- //set variable to be a QString
+ //set variable to be a TQString
context->setVariable("$MyArgumentVariable", new KoMacro::Variable("Some string"));
//execute function
func1ptr->activate(context);
@@ -886,7 +886,7 @@ void CommonTests::testVariables()
//check that it is not null
KOMACROTEST_XASSERT( (int) returnvariable.data(), 0);
//check that it is "Some String"
- KOMACROTEST_ASSERT(returnvariable->toString(),QString("Some string"));
+ KOMACROTEST_ASSERT(returnvariable->toString(),TQString("Some string"));
}
{