summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-10 14:05:08 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-10 14:05:08 +0200
commit47c2aa40fca1f951dcbf3f3bf36a8481875cdfab (patch)
treea46d8dc2046b3fc2c2362255c57b2ab77adbfc74 /tests
parent80042b6e527238d11dd2c955e47b652941c2ba6e (diff)
downloadlibresourceqt-47c2aa40fca1f951dcbf3f3bf36a8481875cdfab.tar.gz
Fixed Resource, and users of Resource
Diffstat (limited to 'tests')
-rw-r--r--tests/test-resource/test-resource.cpp97
-rw-r--r--tests/test-resource/test-resource.h6
2 files changed, 0 insertions, 103 deletions
diff --git a/tests/test-resource/test-resource.cpp b/tests/test-resource/test-resource.cpp
index 2098a88..e943fa2 100644
--- a/tests/test-resource/test-resource.cpp
+++ b/tests/test-resource/test-resource.cpp
@@ -167,101 +167,6 @@ void TestResource::testOptional()
QVERIFY(result == expected);
}
-void TestResource::testShared_data()
-{
- QTest::addColumn<ResourceType>("type");
- QTest::addColumn<bool>("shared");
- QTest::addColumn<bool>("expected");
-
- QTest::newRow("Resource is shared") << AudioPlaybackType << true << true;
- QTest::newRow("Resource is not shared") << AudioPlaybackType << false << false;
- QTest::newRow("Resource is shared") << AudioRecorderType << true << true;
- QTest::newRow("Resource is not shared") << AudioRecorderType << false << false;
- QTest::newRow("Resource is shared") << VideoPlaybackType << true << true;
- QTest::newRow("Resource is not shared") << VideoPlaybackType << false << false;
- QTest::newRow("Resource is shared") << VideoRecorderType << true << true;
- QTest::newRow("Resource is not shared") << VideoRecorderType << false << false;
- QTest::newRow("Resource is shared") << VibraType << true << true;
- QTest::newRow("Resource is not shared") << VibraType<< false << false;
- QTest::newRow("Resource is shared") << BacklightType << true << true;
- QTest::newRow("Resource is not shared") << BacklightType << false << false;
- QTest::newRow("Resource is shared") << SystemButtonType << true << true;
- QTest::newRow("Resource is not shared") << SystemButtonType << false << false;
- QTest::newRow("Resource is shared") << LedsType << true << true;
- QTest::newRow("Resource is not shared") << LedsType << false << false;
- QTest::newRow("Resource is shared") << LockButtonType << true << true;
- QTest::newRow("Resource is not shared") << LockButtonType << false << false;
- QTest::newRow("Resource is shared") << ScaleButtonType << true << true;
- QTest::newRow("Resource is not shared") << ScaleButtonType << false << false;
- QTest::newRow("Resource is shared") << SnapButtonType << true << true;
- QTest::newRow("Resource is not shared") << SnapButtonType << false << false;
- QTest::newRow("Resource is shared") << LensCoverType << true << true;
- QTest::newRow("Resource is not shared") << LensCoverType << false << false;
-}
-
-void TestResource::testShared()
-{
- QFETCH(ResourceType, type);
- QFETCH(bool, shared);
- QFETCH(bool, expected);
-
- Resource *resource = resourceFromType(type);
- resource->setShared(shared);
-
- bool result = resource->isShared();
-
- QCOMPARE(result, expected);
-}
-
-void TestResource::testGranted_data()
-{
- QTest::addColumn<ResourceType>("type");
- QTest::addColumn<bool>("granted");
- QTest::addColumn<bool>("expected");
-
- QTest::newRow("Resource is granted") << AudioPlaybackType << true << true;
- QTest::newRow("Resource is denied") << AudioPlaybackType << false << false;
- QTest::newRow("Resource is granted") << AudioRecorderType << true << true;
- QTest::newRow("Resource is denied") << AudioRecorderType << false << false;
- QTest::newRow("Resource is granted") << VideoPlaybackType << true << true;
- QTest::newRow("Resource is denied") << VideoPlaybackType << false << false;
- QTest::newRow("Resource is granted") << VideoRecorderType << true << true;
- QTest::newRow("Resource is denied") << VideoRecorderType << false << false;
- QTest::newRow("Resource is granted") << VibraType << true << true;
- QTest::newRow("Resource is denied") << VibraType<< false << false;
- QTest::newRow("Resource is granted") << BacklightType << true << true;
- QTest::newRow("Resource is denied") << BacklightType << false << false;
- QTest::newRow("Resource is granted") << SystemButtonType << true << true;
- QTest::newRow("Resource is denied") << SystemButtonType << false << false;
- QTest::newRow("Resource is granted") << LedsType << true << true;
- QTest::newRow("Resource is denied") << LedsType << false << false;
- QTest::newRow("Resource is granted") << LockButtonType << true << true;
- QTest::newRow("Resource is denied") << LockButtonType << false << false;
- QTest::newRow("Resource is granted") << ScaleButtonType << true << true;
- QTest::newRow("Resource is denied") << ScaleButtonType << false << false;
- QTest::newRow("Resource is granted") << SnapButtonType << true << true;
- QTest::newRow("Resource is denied") << SnapButtonType << false << false;
- QTest::newRow("Resource is granted") << LensCoverType << true << true;
- QTest::newRow("Resource is denied") << LensCoverType << false << false;
-}
-
-void TestResource::testGranted()
-{
- QFETCH(ResourceType, type);
- QFETCH(bool, granted);
- QFETCH(bool, expected);
-
- Resource *resource = resourceFromType(type);
-
- if(granted)
- resource->setGranted();
- else
- resource->unsetGranted();
- bool result = resource->isGranted();
-
- QVERIFY(result == expected);
-}
-
void TestResource::testClone()
{
for(quint32 type=AudioPlaybackType; type < NumberOfTypes; type++) {
@@ -270,8 +175,6 @@ void TestResource::testClone()
Resource *copy = resource->clone();
QCOMPARE(copy->isOptional(), resource->isOptional());
- QCOMPARE(copy->isShared(), resource->isShared());
- QCOMPARE(copy->isGranted(), resource->isGranted());
QCOMPARE(copy->type(), resource->type());
delete copy;
}
diff --git a/tests/test-resource/test-resource.h b/tests/test-resource/test-resource.h
index 61a48ea..d80f828 100644
--- a/tests/test-resource/test-resource.h
+++ b/tests/test-resource/test-resource.h
@@ -42,12 +42,6 @@ private slots:
void testOptional_data();
void testOptional();
- void testShared_data();
- void testShared();
-
- void testGranted_data();
- void testGranted();
-
void testClone();
};