summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDenis Shienkov <scapig2@yandex.ru>2011-10-22 22:29:24 +0400
committerDenis Shienkov <scapig2@yandex.ru>2011-10-22 22:29:24 +0400
commit5d4555dab4bed5e8e8884a0ec2df1a593247cff5 (patch)
tree6e5e48db3f09f52dcd508745f30086cdebfd1b43 /tests
parentcfffbde74c0cf72f2c91d8a60c2638c96c6d3e57 (diff)
downloadqtserialport-5d4555dab4bed5e8e8884a0ec2df1a593247cff5.tar.gz
/tests/guidevtest: Added a stub for new test "Signals Test"
Diffstat (limited to 'tests')
-rw-r--r--tests/guidevtest/guidevtest.pro4
-rw-r--r--tests/guidevtest/maindialog.cpp5
-rw-r--r--tests/guidevtest/unittests.h24
-rw-r--r--tests/guidevtest/unittestsignals.cpp37
4 files changed, 63 insertions, 7 deletions
diff --git a/tests/guidevtest/guidevtest.pro b/tests/guidevtest/guidevtest.pro
index 73888a5..388ebdb 100644
--- a/tests/guidevtest/guidevtest.pro
+++ b/tests/guidevtest/guidevtest.pro
@@ -22,7 +22,8 @@ include(../../src/src.pri)
SOURCES += \
main.cpp \
maindialog.cpp \
- unittestinfo.cpp
+ unittestinfo.cpp \
+ unittestsignals.cpp
HEADERS += \
maindialog.h \
@@ -38,3 +39,4 @@ FORMS += \
+
diff --git a/tests/guidevtest/maindialog.cpp b/tests/guidevtest/maindialog.cpp
index 3965dc6..543907d 100644
--- a/tests/guidevtest/maindialog.cpp
+++ b/tests/guidevtest/maindialog.cpp
@@ -44,6 +44,7 @@ void Logger::addContent(const QString &content, bool clearAll)
UnitTestBase::UnitTestBase(UnitID id, Logger *logger, QObject *parent)
: QObject(parent), m_id(id), m_logger(logger)
+ , m_srcPort(0), m_dstPort(0)
{
Q_ASSERT(logger);
m_enableParam = "%1/enable";
@@ -51,8 +52,8 @@ UnitTestBase::UnitTestBase(UnitID id, Logger *logger, QObject *parent)
void UnitTestBase::setPair(const QString &src, const QString &dst)
{
- m_srcPort = src;
- m_dstPort = dst;
+ m_srcPortName = src;
+ m_dstPortName = dst;
}
void UnitTestBase::setEnable(bool enable)
diff --git a/tests/guidevtest/unittests.h b/tests/guidevtest/unittests.h
index 89c17a7..65e5352 100644
--- a/tests/guidevtest/unittests.h
+++ b/tests/guidevtest/unittests.h
@@ -18,6 +18,8 @@ private:
QFile *m_file;
};
+class SerialPort;
+
class UnitTestBase : public QObject
{
Q_OBJECT
@@ -48,10 +50,10 @@ protected:
QString m_description;
QString m_enableParam;
Logger *m_logger;
-
-private:
- QString m_srcPort;
- QString m_dstPort;
+ SerialPort *m_srcPort;
+ SerialPort *m_dstPort;
+ QString m_srcPortName;
+ QString m_dstPortName;
};
@@ -66,6 +68,20 @@ public slots:
};
+class SerialPort;
+
+class UnitTestSignals : public UnitTestBase
+{
+ Q_OBJECT
+public:
+ explicit UnitTestSignals(Logger *logger, QObject *parent = 0);
+
+public slots:
+ virtual void start();
+
+private slots:
+ void stage();
+};
diff --git a/tests/guidevtest/unittestsignals.cpp b/tests/guidevtest/unittestsignals.cpp
new file mode 100644
index 0000000..3f6ad14
--- /dev/null
+++ b/tests/guidevtest/unittestsignals.cpp
@@ -0,0 +1,37 @@
+#include "unittests.h"
+#include "serialport.h"
+
+
+
+/* Public methods */
+
+UnitTestSignals::UnitTestSignals(Logger *logger, QObject *parent)
+ : UnitTestBase(UnitTestBase::InfoUnitId, logger, parent)
+{
+ m_name = QString(tr("Signals Test"));
+ m_description = QString(tr("Signals Test Description"));
+
+ m_srcPort = new SerialPort(this);
+ m_dstPort = new SerialPort(this);
+}
+
+/* Public slots */
+
+void UnitTestSignals::start()
+{
+ m_srcPort->setPort(m_srcPortName);
+ m_dstPort->setPort(m_dstPortName);
+
+ ///
+
+ emit finished();
+}
+
+/* Private slots */
+
+void UnitTestSignals::stage()
+{
+
+}
+
+