0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the test suite of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
#include <QtTest/QtTest>
|
|
43 |
|
|
44 |
#include <QtMultimedia/QAbstractVideoBuffer>
|
|
45 |
|
|
46 |
class tst_QAbstractVideoBuffer : public QObject
|
|
47 |
{
|
|
48 |
Q_OBJECT
|
|
49 |
public:
|
|
50 |
tst_QAbstractVideoBuffer();
|
|
51 |
~tst_QAbstractVideoBuffer();
|
|
52 |
|
|
53 |
public slots:
|
|
54 |
void initTestCase();
|
|
55 |
void cleanupTestCase();
|
|
56 |
void init();
|
|
57 |
void cleanup();
|
|
58 |
|
|
59 |
private slots:
|
|
60 |
void handleType_data();
|
|
61 |
void handleType();
|
|
62 |
void handle();
|
|
63 |
};
|
|
64 |
|
|
65 |
class QtTestVideoBuffer : public QAbstractVideoBuffer
|
|
66 |
{
|
|
67 |
public:
|
|
68 |
QtTestVideoBuffer(QAbstractVideoBuffer::HandleType type) : QAbstractVideoBuffer(type) {}
|
|
69 |
|
|
70 |
MapMode mapMode() const { return NotMapped; }
|
|
71 |
|
|
72 |
uchar *map(MapMode, int *, int *) { return 0; }
|
|
73 |
void unmap() {}
|
|
74 |
};
|
|
75 |
|
|
76 |
tst_QAbstractVideoBuffer::tst_QAbstractVideoBuffer()
|
|
77 |
{
|
|
78 |
}
|
|
79 |
|
|
80 |
tst_QAbstractVideoBuffer::~tst_QAbstractVideoBuffer()
|
|
81 |
{
|
|
82 |
}
|
|
83 |
|
|
84 |
void tst_QAbstractVideoBuffer::initTestCase()
|
|
85 |
{
|
|
86 |
}
|
|
87 |
|
|
88 |
void tst_QAbstractVideoBuffer::cleanupTestCase()
|
|
89 |
{
|
|
90 |
}
|
|
91 |
|
|
92 |
void tst_QAbstractVideoBuffer::init()
|
|
93 |
{
|
|
94 |
}
|
|
95 |
|
|
96 |
void tst_QAbstractVideoBuffer::cleanup()
|
|
97 |
{
|
|
98 |
}
|
|
99 |
|
|
100 |
void tst_QAbstractVideoBuffer::handleType_data()
|
|
101 |
{
|
|
102 |
QTest::addColumn<QAbstractVideoBuffer::HandleType>("type");
|
|
103 |
|
|
104 |
QTest::newRow("none")
|
|
105 |
<< QAbstractVideoBuffer::NoHandle;
|
|
106 |
QTest::newRow("opengl")
|
|
107 |
<< QAbstractVideoBuffer::GLTextureHandle;
|
|
108 |
QTest::newRow("user1")
|
|
109 |
<< QAbstractVideoBuffer::UserHandle;
|
|
110 |
QTest::newRow("user2")
|
|
111 |
<< QAbstractVideoBuffer::HandleType(QAbstractVideoBuffer::UserHandle + 1);
|
|
112 |
}
|
|
113 |
|
|
114 |
void tst_QAbstractVideoBuffer::handleType()
|
|
115 |
{
|
|
116 |
QFETCH(QAbstractVideoBuffer::HandleType, type);
|
|
117 |
|
|
118 |
QtTestVideoBuffer buffer(type);
|
|
119 |
|
|
120 |
QCOMPARE(buffer.handleType(), type);
|
|
121 |
}
|
|
122 |
|
|
123 |
void tst_QAbstractVideoBuffer::handle()
|
|
124 |
{
|
|
125 |
QtTestVideoBuffer buffer(QAbstractVideoBuffer::NoHandle);
|
|
126 |
|
|
127 |
QVERIFY(buffer.handle().isNull());
|
|
128 |
}
|
|
129 |
|
|
130 |
QTEST_MAIN(tst_QAbstractVideoBuffer)
|
|
131 |
|
|
132 |
#include "tst_qabstractvideobuffer.moc"
|