From da73676c8a5af66b55523a9cdfbfbea2baa88a2a Mon Sep 17 00:00:00 2001 From: Tomas Junnonen Date: Mon, 12 Apr 2010 13:50:25 +0300 Subject: Changes: Renamed dui to meegotouch By: Holger, Daniel, Janne RevBy: Tomas, Holger --- tests/ut_mappletid/.gitignore | 1 + tests/ut_mappletid/ut_mappletid.cpp | 53 +++++++++++++++++++++++++++++++++++++ tests/ut_mappletid/ut_mappletid.h | 43 ++++++++++++++++++++++++++++++ tests/ut_mappletid/ut_mappletid.pro | 15 +++++++++++ 4 files changed, 112 insertions(+) create mode 100644 tests/ut_mappletid/.gitignore create mode 100644 tests/ut_mappletid/ut_mappletid.cpp create mode 100644 tests/ut_mappletid/ut_mappletid.h create mode 100644 tests/ut_mappletid/ut_mappletid.pro (limited to 'tests/ut_mappletid') diff --git a/tests/ut_mappletid/.gitignore b/tests/ut_mappletid/.gitignore new file mode 100644 index 00000000..a097f572 --- /dev/null +++ b/tests/ut_mappletid/.gitignore @@ -0,0 +1 @@ +ut_duiappletid diff --git a/tests/ut_mappletid/ut_mappletid.cpp b/tests/ut_mappletid/ut_mappletid.cpp new file mode 100644 index 00000000..dab26b01 --- /dev/null +++ b/tests/ut_mappletid/ut_mappletid.cpp @@ -0,0 +1,53 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libmeegotouch. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#include +#include "ut_mappletid.h" + +void Ut_MAppletId::init() +{ + m_subject = new MAppletId(); +} + +void Ut_MAppletId::cleanup() +{ + delete m_subject; + m_subject = 0; +} + +void Ut_MAppletId::initTestCase() +{ +} + +void Ut_MAppletId::cleanupTestCase() +{ +} + +void Ut_MAppletId::testAppletInstanceIdentifier() +{ + QCOMPARE(m_subject->toString(), QString("//0")); + QCOMPARE(m_subject->instanceId(), uint(0)); + + delete m_subject; + m_subject = new MAppletId("Foo", "FooCanvas", 1); + QCOMPARE(m_subject->toString(), QString("Foo/FooCanvas/1")); + QCOMPARE(m_subject->instanceId(), uint(1)); +} + +QTEST_MAIN(Ut_MAppletId) diff --git a/tests/ut_mappletid/ut_mappletid.h b/tests/ut_mappletid/ut_mappletid.h new file mode 100644 index 00000000..0098e2f7 --- /dev/null +++ b/tests/ut_mappletid/ut_mappletid.h @@ -0,0 +1,43 @@ +/*************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (directui@nokia.com) +** +** This file is part of libmeegotouch. +** +** If you have questions regarding the use of this file, please contact +** Nokia at directui@nokia.com. +** +** This library is free software; you can redistribute it and/or +** modify it under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation +** and appearing in the file LICENSE.LGPL included in the packaging +** of this file. +** +****************************************************************************/ + +#ifndef UT_MAPPLETID_H +#define UT_MAPPLETID_H + +#include +#include + +#include + +class Ut_MAppletId : public QObject +{ + Q_OBJECT + +private slots: + void init(); + void cleanup(); + void initTestCase(); + void cleanupTestCase(); + void testAppletInstanceIdentifier(); + +private: + MAppletId *m_subject; +}; + +#endif diff --git a/tests/ut_mappletid/ut_mappletid.pro b/tests/ut_mappletid/ut_mappletid.pro new file mode 100644 index 00000000..a7e16756 --- /dev/null +++ b/tests/ut_mappletid/ut_mappletid.pro @@ -0,0 +1,15 @@ +include(../common_top.pri) + +TARGET = ut_mappletid +INCLUDEPATH += $$MSRCDIR/extensions/mashup/mashup \ + $$MSRCDIR/extensions/mashup/appletcommunication + +QT += network + +SOURCES += ut_mappletid.cpp \ + $$MSRCDIR/extensions/mashup/mashup/mappletid.cpp + +HEADERS += ut_mappletid.h \ + $$MSRCDIR/extensions/mashup/mashup/mappletid.h + +include(../common_bot.pri) -- cgit v1.2.3