Move CORS authenticator test to non-private tests
authorKurt Pattyn <pattyn.kurt@gmail.com>
Sun, 26 Jan 2014 00:49:53 +0000 (01:49 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 1 Feb 2014 16:01:19 +0000 (17:01 +0100)
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>
tests/auto/auto.pro
tests/auto/qwebsocketcorsauthenticator/qwebsocketcorsauthenticator.pro [new file with mode: 0644]
tests/auto/qwebsocketcorsauthenticator/tst_qwebsocketcorsauthenticator.cpp [moved from tests/auto/websocketcorsauthenticator/tst_websocketcorsauthenticator.cpp with 79% similarity]
tests/auto/websocketcorsauthenticator/websocketcorsauthenticator.pro [deleted file]

index 2ee1976..c05ce29 100644 (file)
@@ -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 (file)
index 0000000..aa485fc
--- /dev/null
@@ -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
 #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 (file)
index dddec22..0000000
+++ /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