From f48939571124ed362cadbfa419136a79872bbd05 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 7 Sep 2005 20:49:49 +0000 Subject: [PATCH] the test now builds and passes and even works with srcdir!=builddir coolo is, in case anyone missed it, a build system god whilst i am but the humble jester in that court at least i can add "qttestlib" to my resume now to find someone who'd care ;) svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=458332 --- tests/Makefile.am | 4 ++++ tests/testAppletInfo.cpp | 30 ++++++++++++++++++------------ tests/testAppletInfo.h | 1 + 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 4c70cda1e..c7b7e0efd 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -9,3 +9,7 @@ METASOURCES = AUTO LDADD = ../libplasma.la -lQtTest_debug testAppletInfo_SOURCES = testAppletInfo.cpp + +check: + opwd=$PWD; cd $(srcdir) && $$opwd/testAppletInfo + diff --git a/tests/testAppletInfo.cpp b/tests/testAppletInfo.cpp index 9535086a4..5a025aa1d 100644 --- a/tests/testAppletInfo.cpp +++ b/tests/testAppletInfo.cpp @@ -36,6 +36,12 @@ TestAppletInfo::TestAppletInfo(QObject* parent) uniqueJavascript = new Plasma::AppletInfo(pwd + "/uniqueJavaScriptApplet.desktop"); } +TestAppletInfo::~TestAppletInfo() +{ + delete m_instance; + delete m_aboutData; +} + void TestAppletInfo::name_data(QtTestTable &t) { t.defineElement("QString", "expected"); @@ -177,34 +183,34 @@ void TestAppletInfo::unique_data(QtTestTable &t) t.defineElement("bool", "actual"); *t.newData("Non-Unique Native Applet") << notUniqueNative->unique() - << "nativeApplet.desktop"; + << false; *t.newData("Unique Javascript Applet") << uniqueJavascript->unique() - << "uniqueJavaScriptApplet.desktop"; + << true; } void TestAppletInfo::unique() { - FETCH(QString, expected); - FETCH(QString, actual); + FETCH(bool, expected); + FETCH(bool, actual); COMPARE(expected, actual); } void TestAppletInfo::hidden_data(QtTestTable &t) { - t.defineElement("QString", "expected"); - t.defineElement("QString", "actual"); + t.defineElement("bool", "expected"); + t.defineElement("bool", "actual"); - *t.newData("Non-Unique Native Applet") << notUniqueNative->unique() - << "nativeApplet.desktop"; - *t.newData("Unique Javascript Applet") << uniqueJavascript->unique() - << "uniqueJavaScriptApplet.desktop"; + *t.newData("Non-Unique Native Applet") << notUniqueNative->hidden() + << false; + *t.newData("Unique Javascript Applet") << uniqueJavascript->hidden() + << true; } void TestAppletInfo::hidden() { - FETCH(QString, expected); - FETCH(QString, actual); + FETCH(bool, expected); + FETCH(bool, actual); COMPARE(expected, actual); } diff --git a/tests/testAppletInfo.h b/tests/testAppletInfo.h index e71331ac5..c016bd1d3 100644 --- a/tests/testAppletInfo.h +++ b/tests/testAppletInfo.h @@ -35,6 +35,7 @@ class TestAppletInfo: public QObject Q_OBJECT public: TestAppletInfo(QObject* parent = 0); + ~TestAppletInfo(); private slots: void name_data(QtTestTable& t);