diff options
author | Tomas Junnonen <tomas.junnonen@nokia.com> | 2010-04-12 13:50:25 +0300 |
---|---|---|
committer | Tomas Junnonen <tomas.junnonen@nokia.com> | 2010-04-12 13:52:31 +0300 |
commit | da73676c8a5af66b55523a9cdfbfbea2baa88a2a (patch) | |
tree | 0a3b8933a1817c152116da5fa8a7b5cdd8102e60 /tests/ut_mappletid | |
parent | 8832674482d3b9a7fcf77b0cfdcb8e6fe4960b4d (diff) |
Changes: Renamed dui to meegotouch
By: Holger, Daniel, Janne
RevBy: Tomas, Holger
Diffstat (limited to 'tests/ut_mappletid')
-rw-r--r-- | tests/ut_mappletid/.gitignore | 1 | ||||
-rw-r--r-- | tests/ut_mappletid/ut_mappletid.cpp | 53 | ||||
-rw-r--r-- | tests/ut_mappletid/ut_mappletid.h | 43 | ||||
-rw-r--r-- | tests/ut_mappletid/ut_mappletid.pro | 15 |
4 files changed, 112 insertions, 0 deletions
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 <mappletid.h> +#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 <QtTest/QtTest> +#include <QObject> + +#include <mappletid.h> + +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) |