diff options
author | Kurt Pattyn <pattyn.kurt@gmail.com> | 2014-01-26 01:49:53 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-01 17:01:19 +0100 |
commit | 3dbdc9a9e6153b46c01269c85804609123f1bd7d (patch) | |
tree | 619e0747927f38e54d598af9e9f38dc4c1331503 /tests/auto | |
parent | 11b5eca580900a677fdf9a5d6cd990b0700ad5ad (diff) | |
download | qtwebsockets-3dbdc9a9e6153b46c01269c85804609123f1bd7d.tar.gz |
Move CORS authenticator test to non-private tests
QWebSocketCorsAuthenticator is a public class and hence needs to be
tested with the public API of QtWebSockets.
Change-Id: If3af0744d8901f9c6c13d5fb9061ebf0a5a8d163
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/auto.pro | 6 | ||||
-rw-r--r-- | tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro | 13 | ||||
-rw-r--r-- | tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp (renamed from tests/auto/websocketcorsauthenticator/tst_websocketcorsauthenticator.cpp) | 27 | ||||
-rw-r--r-- | tests/auto/websocketcorsauthenticator/websocketcorsauthenticator.pro | 14 |
4 files changed, 26 insertions, 34 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 2ee1976..c05ce29 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,10 +1,10 @@ TEMPLATE = subdirs -#SUBDIRS += +SUBDIRS = \ + qwebsocketcorsauthenticator contains(QT_CONFIG, private_tests): SUBDIRS += \ websocketprotocol \ dataprocessor \ websocketframe \ - handshakerequest \ - websocketcorsauthenticator + handshakerequest diff --git a/tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro b/tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro new file mode 100644 index 0000000..aa485fc --- /dev/null +++ b/tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro @@ -0,0 +1,13 @@ +CONFIG += console +CONFIG += testcase +CONFIG -= app_bundle + +TEMPLATE = app + +TARGET = tst_qwebsocketcorsauthenticator + +QT = core testlib websockets + +SOURCES += tst_qwebsocketcorsauthenticator.cpp + +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/websocketcorsauthenticator/tst_websocketcorsauthenticator.cpp b/tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp index 7bb44b1..6429ce1 100644 --- a/tests/auto/websocketcorsauthenticator/tst_websocketcorsauthenticator.cpp +++ b/tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp @@ -45,20 +45,15 @@ #include <QtCore/QtEndian> #include "QtWebSockets/qwebsocketcorsauthenticator.h" -#include "QtWebSockets/qwebsocketprotocol.h" -#include "private/qwebsocketprotocol_p.h" QT_USE_NAMESPACE -Q_DECLARE_METATYPE(QWebSocketProtocol::CloseCode) -Q_DECLARE_METATYPE(QWebSocketProtocol::OpCode) - -class tst_WebSocketCorsAuthenticator : public QObject +class tst_QWebSocketCorsAuthenticator : public QObject { Q_OBJECT public: - tst_WebSocketCorsAuthenticator(); + tst_QWebSocketCorsAuthenticator(); private Q_SLOTS: void initTestCase(); @@ -69,27 +64,25 @@ private Q_SLOTS: void tst_initialization(); }; -tst_WebSocketCorsAuthenticator::tst_WebSocketCorsAuthenticator() +tst_QWebSocketCorsAuthenticator::tst_QWebSocketCorsAuthenticator() {} -void tst_WebSocketCorsAuthenticator::initTestCase() +void tst_QWebSocketCorsAuthenticator::initTestCase() { } -void tst_WebSocketCorsAuthenticator::cleanupTestCase() +void tst_QWebSocketCorsAuthenticator::cleanupTestCase() {} -void tst_WebSocketCorsAuthenticator::init() +void tst_QWebSocketCorsAuthenticator::init() { - qRegisterMetaType<QWebSocketProtocol::OpCode>("QWebSocketProtocol::OpCode"); - qRegisterMetaType<QWebSocketProtocol::CloseCode>("QWebSocketProtocol::CloseCode"); } -void tst_WebSocketCorsAuthenticator::cleanup() +void tst_QWebSocketCorsAuthenticator::cleanup() { } -void tst_WebSocketCorsAuthenticator::tst_initialization() +void tst_QWebSocketCorsAuthenticator::tst_initialization() { { QWebSocketCorsAuthenticator authenticator((QString())); @@ -121,7 +114,7 @@ void tst_WebSocketCorsAuthenticator::tst_initialization() } } -QTEST_MAIN(tst_WebSocketCorsAuthenticator) +QTEST_MAIN(tst_QWebSocketCorsAuthenticator) -#include "tst_websocketcorsauthenticator.moc" +#include "tst_qwebsocketcorsauthenticator.moc" diff --git a/tests/auto/websocketcorsauthenticator/websocketcorsauthenticator.pro b/tests/auto/websocketcorsauthenticator/websocketcorsauthenticator.pro deleted file mode 100644 index dddec22..0000000 --- a/tests/auto/websocketcorsauthenticator/websocketcorsauthenticator.pro +++ /dev/null @@ -1,14 +0,0 @@ -CONFIG += console -CONFIG += testcase -CONFIG -= app_bundle - -TEMPLATE = app - -TARGET = tst_websocketcorsauthenticator - -QT = core testlib websockets websockets-private - -SOURCES += tst_websocketcorsauthenticator.cpp - -requires(contains(QT_CONFIG, private_tests)) -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 |