Skip to content

Commit fe2d010

Browse files
author
Christian Feldmann
committed
Try a videoHandlerRGB test. I think this failed in CI in the past.
1 parent eb866ab commit fe2d010

3 files changed

Lines changed: 54 additions & 6 deletions

File tree

YUViewLib/src/video/rgb/videoHandlerRGB.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ class videoHandlerRGB : public videoHandler
109109
}
110110
// Set the current raw format and update the control. Only emit a signalHandlerChanged signal
111111
// if emitSignal is true.
112-
virtual void setRGBPixelFormat(const rgb::PixelFormatRGB &format, bool emitSignal = false)
112+
virtual void setRGBPixelFormat(const PixelFormatRGB &format, bool emitSignal = false)
113113
{
114114
setSrcPixelFormat(format);
115115
if (emitSignal)
116116
emit signalHandlerChanged(true, RECACHE_NONE);
117117
}
118118
virtual void setRGBPixelFormatByName(const QString &name, bool emitSignal = false)
119119
{
120-
this->setRGBPixelFormat(rgb::PixelFormatRGB(name.toStdString()), emitSignal);
120+
this->setRGBPixelFormat(PixelFormatRGB(name.toStdString()), emitSignal);
121121
}
122122

123123
void
@@ -167,7 +167,7 @@ class videoHandlerRGB : public videoHandler
167167
bool limitedRange{};
168168

169169
// Get the RGB values for the given pixel.
170-
virtual rgb::rgba_t getPixelValue(const QPoint &pixelPos) const;
170+
virtual rgba_t getPixelValue(const QPoint &pixelPos) const;
171171

172172
// Load the given frame and return it for caching. The current buffers (currentFrameRawRGBData and
173173
// currentFrame) will not be modified.
@@ -183,7 +183,7 @@ class videoHandlerRGB : public videoHandler
183183
void convertRGBToImage(const QByteArray &sourceBuffer, QImage &outputImage);
184184

185185
// Set the new pixel format thread save (lock the mutex)
186-
void setSrcPixelFormat(const rgb::PixelFormatRGB &newFormat);
186+
void setSrcPixelFormat(const PixelFormatRGB &newFormat);
187187

188188
// Convert one frame from the current pixel format to RGB888
189189
void convertSourceToRGBA32Bit(const QByteArray &sourceBuffer,

YUViewUnitTest/YUViewUnitTest.pro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
QT += core xml
1+
QT += core xml widgets
22

33
TARGET = YUViewUnitTest
44
TEMPLATE = app
@@ -14,7 +14,8 @@ HEADERS += $$files(*.h, true)
1414
INCLUDEPATH += $$top_srcdir/submodules/googletest/googletest/include \
1515
$$top_srcdir/submodules/googletest/googlemock/include \
1616
$$top_srcdir/YUViewLib/src \
17-
$$top_srcdir/YUViewUnitTest/common
17+
$$top_srcdir/YUViewUnitTest/common \
18+
$$top_builddir/YUViewLib
1819
LIBS += -L$$top_builddir/submodules/googletest-qmake/gtest -lgtest
1920
LIBS += -L$$top_builddir/submodules/googletest-qmake/gtest_main -lgtest_main
2021
LIBS += -L$$top_builddir/YUViewLib -lYUViewLib
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* This file is part of YUView - The YUV player with advanced analytics toolset
2+
* <https://github.com/IENT/YUView>
3+
* Copyright (C) 2015 Institut für Nachrichtentechnik, RWTH Aachen University, GERMANY
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* In addition, as a special exception, the copyright holders give
11+
* permission to link the code of portions of this program with the
12+
* OpenSSL library under certain conditions as described in each
13+
* individual source file, and distribute linked combinations including
14+
* the two.
15+
*
16+
* You must obey the GNU General Public License in all respects for all
17+
* of the code used other than OpenSSL. If you modify file(s) with this
18+
* exception, you may extend this exception to your version of the
19+
* file(s), but you are not obligated to do so. If you do not wish to do
20+
* so, delete this exception statement from your version. If you delete
21+
* this exception statement from all source files in the program, then
22+
* also delete it here.
23+
*
24+
* This program is distributed in the hope that it will be useful,
25+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
26+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+
* GNU General Public License for more details.
28+
*
29+
* You should have received a copy of the GNU General Public License
30+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
31+
*/
32+
33+
#include "gtest/gtest.h"
34+
#include <common/Testing.h>
35+
#include <video/rgb/videoHandlerRGB.h>
36+
37+
namespace video::rgb::test
38+
{
39+
40+
TEST(videoHandlerRGBTest, testDefaultConstructor)
41+
{
42+
videoHandlerRGB handler;
43+
44+
EXPECT_FALSE(handler.isFormatValid());
45+
}
46+
47+
} // namespace video::rgb::test

0 commit comments

Comments
 (0)