add more spacing
[personal-kdebase.git] / runtime / phonon / tests / qtesthelper.h
blobc040d84579b992b948b0b959aff7bcb3601b75c0
1 /* This file is part of the KDE project
2 Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
20 #ifndef QTESTHELPER_H
21 #define QTESTHELPER_H
23 #include <QtTest/QTest>
24 #include "../phononnamespace.h"
25 #include <QtCore/QVariant>
27 namespace QTest
29 template<>
30 char *toString(const Phonon::State &state)
32 switch (state) {
33 case Phonon::LoadingState:
34 return qstrdup("LoadingState");
35 case Phonon::StoppedState:
36 return qstrdup("StoppedState");
37 case Phonon::PlayingState:
38 return qstrdup("PlayingState");
39 case Phonon::BufferingState:
40 return qstrdup("BufferingState");
41 case Phonon::PausedState:
42 return qstrdup("PausedState");
43 case Phonon::ErrorState:
44 return qstrdup("ErrorState");
46 return 0;
49 template<>
50 char *toString(const QVariant::Type &type)
52 switch (type) {
53 case QVariant::Invalid:
54 return qstrdup("QVariant::Invalid");
55 case QVariant::BitArray:
56 return qstrdup("QVariant::BitArray");
57 case QVariant::Bitmap:
58 return qstrdup("QVariant::Bitmap");
59 case QVariant::Bool:
60 return qstrdup("QVariant::Bool");
61 case QVariant::Brush:
62 return qstrdup("QVariant::Brush");
63 case QVariant::ByteArray:
64 return qstrdup("QVariant::ByteArray");
65 case QVariant::Char:
66 return qstrdup("QVariant::Char");
67 case QVariant::Color:
68 return qstrdup("QVariant::Color");
69 case QVariant::Cursor:
70 return qstrdup("QVariant::Cursor");
71 case QVariant::Date:
72 return qstrdup("QVariant::Date");
73 case QVariant::DateTime:
74 return qstrdup("QVariant::DateTime");
75 case QVariant::Double:
76 return qstrdup("QVariant::Double");
77 case QVariant::Font:
78 return qstrdup("QVariant::Font");
79 case QVariant::Icon:
80 return qstrdup("QVariant::Icon");
81 case QVariant::Image:
82 return qstrdup("QVariant::Image");
83 case QVariant::Int:
84 return qstrdup("QVariant::Int");
85 case QVariant::KeySequence:
86 return qstrdup("QVariant::KeySequence");
87 case QVariant::Line:
88 return qstrdup("QVariant::Line");
89 case QVariant::LineF:
90 return qstrdup("QVariant::LineF");
91 case QVariant::List:
92 return qstrdup("QVariant::List");
93 case QVariant::Locale:
94 return qstrdup("QVariant::Locale");
95 case QVariant::LongLong:
96 return qstrdup("QVariant::LongLong");
97 case QVariant::Map:
98 return qstrdup("QVariant::Map");
99 case QVariant::Matrix:
100 return qstrdup("QVariant::Matrix");
101 case QVariant::Transform:
102 return qstrdup("QVariant::Transform");
103 case QVariant::Palette:
104 return qstrdup("QVariant::Palette");
105 case QVariant::Pen:
106 return qstrdup("QVariant::Pen");
107 case QVariant::Pixmap:
108 return qstrdup("QVariant::Pixmap");
109 case QVariant::Point:
110 return qstrdup("QVariant::Point");
111 case QVariant::PointF:
112 return qstrdup("QVariant::PointF");
113 case QVariant::Polygon:
114 return qstrdup("QVariant::Polygon");
115 case QVariant::Rect:
116 return qstrdup("QVariant::Rect");
117 case QVariant::RectF:
118 return qstrdup("QVariant::RectF");
119 case QVariant::RegExp:
120 return qstrdup("QVariant::RegExp");
121 case QVariant::Region:
122 return qstrdup("QVariant::Region");
123 case QVariant::Size:
124 return qstrdup("QVariant::Size");
125 case QVariant::SizeF:
126 return qstrdup("QVariant::SizeF");
127 case QVariant::SizePolicy:
128 return qstrdup("QVariant::SizePolicy");
129 case QVariant::String:
130 return qstrdup("QVariant::String");
131 case QVariant::StringList:
132 return qstrdup("QVariant::StringList");
133 case QVariant::TextFormat:
134 return qstrdup("QVariant::TextFormat");
135 case QVariant::TextLength:
136 return qstrdup("QVariant::TextLength");
137 case QVariant::Time:
138 return qstrdup("QVariant::Time");
139 case QVariant::UInt:
140 return qstrdup("QVariant::UInt");
141 case QVariant::ULongLong:
142 return qstrdup("QVariant::ULongLong");
143 case QVariant::Url:
144 return qstrdup("QVariant::Url");
145 case QVariant::UserType:
146 return qstrdup("QVariant::UserType");
147 case QVariant::LastType:
148 return qstrdup("QVariant::LastType");
150 return 0;
152 } // namespace QTest
154 #endif // QTESTHELPER_H