summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKurt Pattyn <pattyn.kurt@gmail.com>2013-10-13 12:15:07 +0200
committerKurt Pattyn <pattyn.kurt@gmail.com>2013-10-13 12:25:04 +0200
commit7d27956893423e0447aedaa0038bf38e5725ddfd (patch)
treea40ccd821b073f4c8f7e4d4a83d1df9ea1b5d84e /tests
parente420d258afeb52adf14e4101e5ead8b0981a1718 (diff)
downloadqtwebsockets-7d27956893423e0447aedaa0038bf38e5725ddfd.tar.gz
Added TODO explaining some optimizations
Moved documentation from .h to .cpp Export QWebSocketFrame class for unit testing Added unit tests for web socket frames Change-Id: I824da86fed37fbcd1f5671a21467af7a66f5c019 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/websocketframe/tst_websocketframe.cpp93
-rw-r--r--tests/auto/websocketframe/websocketframe.pro15
2 files changed, 108 insertions, 0 deletions
diff --git a/tests/auto/websocketframe/tst_websocketframe.cpp b/tests/auto/websocketframe/tst_websocketframe.cpp
new file mode 100644
index 0000000..e08307b
--- /dev/null
+++ b/tests/auto/websocketframe/tst_websocketframe.cpp
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtTest/QtTest>
+#include <QtTest/qtestcase.h>
+#include <QDebug>
+
+#include "private/qwebsocketframe_p.h"
+
+QT_USE_NAMESPACE
+
+class tst_WebSocketFrame : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_WebSocketFrame();
+
+private Q_SLOTS:
+ void initTestCase();
+ void cleanupTestCase();
+ void init();
+ void cleanup();
+
+ void tst_initialization();
+};
+
+tst_WebSocketFrame::tst_WebSocketFrame()
+{}
+
+void tst_WebSocketFrame::initTestCase()
+{
+}
+
+void tst_WebSocketFrame::cleanupTestCase()
+{}
+
+void tst_WebSocketFrame::init()
+{
+}
+
+void tst_WebSocketFrame::cleanup()
+{
+}
+
+void tst_WebSocketFrame::tst_initialization()
+{
+ QWebSocketFrame frame;
+ QVERIFY(!frame.isValid());
+ QCOMPARE(frame.getPayload().length(), 0);
+}
+
+QTEST_MAIN(tst_WebSocketFrame)
+
+#include "tst_websocketframe.moc"
+
diff --git a/tests/auto/websocketframe/websocketframe.pro b/tests/auto/websocketframe/websocketframe.pro
new file mode 100644
index 0000000..d18aa7d
--- /dev/null
+++ b/tests/auto/websocketframe/websocketframe.pro
@@ -0,0 +1,15 @@
+CONFIG += console
+CONFIG += c++11
+CONFIG += testcase
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+TARGET = tst_websocketframe
+
+QT = core testlib websockets websockets-private
+
+SOURCES += tst_websocketframe.cpp
+
+requires(contains(QT_CONFIG, private_tests))
+DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0