diff options
Diffstat (limited to 'kexi/plugins/macros/tests/xmlhandlertests2.cpp')
-rw-r--r-- | kexi/plugins/macros/tests/xmlhandlertests2.cpp | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/kexi/plugins/macros/tests/xmlhandlertests2.cpp b/kexi/plugins/macros/tests/xmlhandlertests2.cpp index cc38c077..8e990d11 100644 --- a/kexi/plugins/macros/tests/xmlhandlertests2.cpp +++ b/kexi/plugins/macros/tests/xmlhandlertests2.cpp @@ -59,39 +59,39 @@ namespace KoMacroTest { /** * @a Macro instance as a container for the macroitems; */ - KSharedPtr<KoMacro::Macro> macro; // container for manually created items - KSharedPtr<KoMacro::Macro> macro2; // container for parsen items - KSharedPtr<KoMacro::Macro> macro3; // container for parsen items after back-converting by toXML() and again parseXML() + TDESharedPtr<KoMacro::Macro> macro; // container for manually created items + TDESharedPtr<KoMacro::Macro> macro2; // container for parsen items + TDESharedPtr<KoMacro::Macro> macro3; // container for parsen items after back-converting by toXML() and again parseXML() /** * An @a TestObject instance used internaly to test * handling and communication with from TQObject * inheritated instances. */ - KSharedPtr<KoMacro::Action> testaction; - KSharedPtr<KoMacro::Action> action2; // action of the parsen macro2 - KSharedPtr<KoMacro::Action> action3; // action of the parsen macro3 - KSharedPtr<KoMacro::Action> testaction_2; // for test12 - KSharedPtr<KoMacro::Action> action2_2; // action of the parsen macro2, for test12 - KSharedPtr<KoMacro::Action> action3_2; // action of the parsen macro3, for test12 + TDESharedPtr<KoMacro::Action> testaction; + TDESharedPtr<KoMacro::Action> action2; // action of the parsen macro2 + TDESharedPtr<KoMacro::Action> action3; // action of the parsen macro3 + TDESharedPtr<KoMacro::Action> testaction_2; // for test12 + TDESharedPtr<KoMacro::Action> action2_2; // action of the parsen macro2, for test12 + TDESharedPtr<KoMacro::Action> action3_2; // action of the parsen macro3, for test12 /** * Represents a @a TQValuList of @a MacroItem which are parsen in the * correspondig @a Macro . */ - TQValueList<KSharedPtr<KoMacro::MacroItem > > macroitems2; // items of macro2 - TQValueList<KSharedPtr<KoMacro::MacroItem > > macroitems3; // items of macro3 + TQValueList<TDESharedPtr<KoMacro::MacroItem > > macroitems2; // items of macro2 + TQValueList<TDESharedPtr<KoMacro::MacroItem > > macroitems3; // items of macro3 /** * @a MacroItem instances which ist fillen manually from the given XML * and parsen by the @a XMLHandler over the XML. */ - KSharedPtr<KoMacro::MacroItem> macroitem; // created manually from XML - KSharedPtr<KoMacro::MacroItem> macroitem2; // parsen from XML in macro2 - KSharedPtr<KoMacro::MacroItem> macroitem3; // parsen from XML in macro3 - KSharedPtr<KoMacro::MacroItem> macroitem_2; // created manually from XML, for test12 - KSharedPtr<KoMacro::MacroItem> macroitem2_2;// parsen from XML in macro2, for test12 - KSharedPtr<KoMacro::MacroItem> macroitem3_2;// parsen from XML in macro3, for test12 + TDESharedPtr<KoMacro::MacroItem> macroitem; // created manually from XML + TDESharedPtr<KoMacro::MacroItem> macroitem2; // parsen from XML in macro2 + TDESharedPtr<KoMacro::MacroItem> macroitem3; // parsen from XML in macro3 + TDESharedPtr<KoMacro::MacroItem> macroitem_2; // created manually from XML, for test12 + TDESharedPtr<KoMacro::MacroItem> macroitem2_2;// parsen from XML in macro2, for test12 + TDESharedPtr<KoMacro::MacroItem> macroitem3_2;// parsen from XML in macro3, for test12 Private() : xmlguiclient(0) @@ -207,10 +207,10 @@ void XMLHandlerTests2::testCorrectDomElement() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -300,10 +300,10 @@ void XMLHandlerTests2::testBadRoot() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_XASSERT(d->macro2->parseXML(elem),true); @@ -339,9 +339,9 @@ void XMLHandlerTests2::testMissingVariable() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -425,11 +425,11 @@ void XMLHandlerTests2::testMoreVariables() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); - KSharedPtr<KoMacro::Variable> varbla = d->macroitem->addVariable("testbla","somethingwrong"); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); + TDESharedPtr<KoMacro::Variable> varbla = d->macroitem->addVariable("testbla","somethingwrong"); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -517,10 +517,10 @@ void XMLHandlerTests2::testWrongVersion() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_XASSERT(d->macro2->parseXML(elem),true); @@ -559,10 +559,10 @@ void XMLHandlerTests2::testWrongXMLStruct() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_XASSERT(d->macro2->parseXML(elem),true); @@ -599,10 +599,10 @@ void XMLHandlerTests2::testMaxNum() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(INT_MAX)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(DBL_MAX)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(INT_MAX)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(DBL_MAX)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -687,10 +687,10 @@ void XMLHandlerTests2::testMaxNum2() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(INT_MAX+1)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(DBL_MAX+1)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(INT_MAX+1)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(DBL_MAX+1)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -775,10 +775,10 @@ void XMLHandlerTests2::testMinNum() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(INT_MIN)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(DBL_MIN)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(INT_MIN)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(DBL_MIN)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -863,10 +863,10 @@ void XMLHandlerTests2::testMinNum2() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(INT_MIN-1)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(DBL_MIN-1)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(INT_MIN-1)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(DBL_MIN-1)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -951,10 +951,10 @@ void XMLHandlerTests2::testBigNumber() d->macroitem->setAction(d->testaction); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - //TODO //KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0123456789012345678901234567890123456789)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + //TODO //TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0123456789012345678901234567890123456789)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -1050,18 +1050,18 @@ void XMLHandlerTests2::testTwoMacroItems() d->macroitem_2->setAction(d->testaction_2); // Push the Variables into the macroitem. - KSharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); - KSharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); - KSharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); - KSharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); - KSharedPtr<KoMacro::Variable> varbla = d->macroitem->addVariable("testbla","somethingwrong"); + TDESharedPtr<KoMacro::Variable> varstring = d->macroitem->addVariable("teststring",TQVariant("test_string")); + TDESharedPtr<KoMacro::Variable> varint = d->macroitem->addVariable("testint",TQVariant(0)); + TDESharedPtr<KoMacro::Variable> varbool = d->macroitem->addVariable("testbool",TQVariant(true)); + TDESharedPtr<KoMacro::Variable> vardouble = d->macroitem->addVariable("testdouble",TQVariant(0.6)); + TDESharedPtr<KoMacro::Variable> varbla = d->macroitem->addVariable("testbla","somethingwrong"); // Push the Variables into the macroitem4. - KSharedPtr<KoMacro::Variable> varstring_2 = d->macroitem_2->addVariable("teststring",TQVariant("testString2")); - KSharedPtr<KoMacro::Variable> varint_2 = d->macroitem_2->addVariable("testint",TQVariant(4)); - KSharedPtr<KoMacro::Variable> varbool_2 = d->macroitem_2->addVariable("testbool",TQVariant(false)); - KSharedPtr<KoMacro::Variable> vardouble_2 = d->macroitem_2->addVariable("testdouble",TQVariant(0.7)); - KSharedPtr<KoMacro::Variable> varbla_2 = d->macroitem_2->addVariable("testbla","somethingwrong2"); + TDESharedPtr<KoMacro::Variable> varstring_2 = d->macroitem_2->addVariable("teststring",TQVariant("testString2")); + TDESharedPtr<KoMacro::Variable> varint_2 = d->macroitem_2->addVariable("testint",TQVariant(4)); + TDESharedPtr<KoMacro::Variable> varbool_2 = d->macroitem_2->addVariable("testbool",TQVariant(false)); + TDESharedPtr<KoMacro::Variable> vardouble_2 = d->macroitem_2->addVariable("testdouble",TQVariant(0.7)); + TDESharedPtr<KoMacro::Variable> varbla_2 = d->macroitem_2->addVariable("testbla","somethingwrong2"); // Is our XML parseable into a 2. Macro by calling parseXML()? KOMACROTEST_ASSERT(d->macro2->parseXML(elem),true); @@ -1072,7 +1072,7 @@ void XMLHandlerTests2::testTwoMacroItems() KOMACROTEST_ASSERT(d->macroitems2.size(),(sizetypelist)2); { - TQValueList<KSharedPtr<KoMacro::MacroItem > >::ConstIterator mit2(d->macroitems2.constBegin()); + TQValueList<TDESharedPtr<KoMacro::MacroItem > >::ConstIterator mit2(d->macroitems2.constBegin()); // 2a.comparison - Test if the Action is correct? d->macroitem2 = *mit2; mit2++; @@ -1111,7 +1111,7 @@ void XMLHandlerTests2::testTwoMacroItems() KOMACROTEST_ASSERT(d->macroitems3.size(),(sizetypelist)2); { - TQValueList<KSharedPtr<KoMacro::MacroItem > >::ConstIterator mit3(d->macroitems3.constBegin()); + TQValueList<TDESharedPtr<KoMacro::MacroItem > >::ConstIterator mit3(d->macroitems3.constBegin()); // 2b.comparison - Test if the Action is correct? d->macroitem3 = *mit3; mit3++; @@ -1145,14 +1145,14 @@ void XMLHandlerTests2::testTwoMacroItems() * End of Sub-methos of testParseAndToXML2(). ***************************************************************************/ -bool XMLHandlerTests2::assertActionsEqual(KSharedPtr<KoMacro::Action> action, - KSharedPtr<KoMacro::Action> action2) +bool XMLHandlerTests2::assertActionsEqual(TDESharedPtr<KoMacro::Action> action, + TDESharedPtr<KoMacro::Action> action2) { return action->name() == action2->name(); } -bool XMLHandlerTests2::assertVariablesEqual(KSharedPtr<KoMacro::Variable> var, - KSharedPtr<KoMacro::Variable> var2) +bool XMLHandlerTests2::assertVariablesEqual(TDESharedPtr<KoMacro::Variable> var, + TDESharedPtr<KoMacro::Variable> var2) { if ( var->variant() != var2->variant() ) kdDebug() << "Variable1: " << var->variant() << " and Variable2: " << var2->variant() << endl; return var->variant() == var2->variant(); |