Commit 34d08cd3 authored by Eskil Abrahamsen-Blomfeldt's avatar Eskil Abrahamsen-Blomfeldt
Browse files

Add a test

parent 1998b20f
if(QT_BUILD_STANDALONE_TESTS)
# Add qt_find_package calls for extra dependencies that need to be found when building
# the standalone tests here.
endif()
qt_build_tests()
add_subdirectory(qtvncserver)
qt_internal_add_test(tst_qtvncserver
SOURCES
tst_qtvncserver.cpp
DEFINES
SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
PUBLIC_LIBRARIES
Qt::Gui
Qt::VncServer
Qt::Network
)
/******************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt VNC Server module.
**
** $QT_BEGIN_LICENSE:COMM$
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** $QT_END_LICENSE$
**
******************************************************************************/
#include <QtTest/QtTest>
#include <QtGui/QImage>
#include <QtVncServer/QVncServer>
#include <QtNetwork/QTcpSocket>
class Tst_QtVncServer : public QObject
{
Q_OBJECT
private Q_SLOTS:
void serverConnect();
};
void Tst_QtVncServer::serverConnect()
{
QVncServer *server = new QVncServer(QSize(100, 100), QImage::Format_ARGB32);
QTRY_VERIFY(server->isListening());
QTcpSocket *socket = new QTcpSocket;
socket->connectToHost(QHostAddress::LocalHost, QVncServer::DefaultPort);
QTRY_VERIFY(server->isConnected());
delete socket;
delete server;
}
QTEST_MAIN(Tst_QtVncServer)
#include "tst_qtvncserver.moc"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment