summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorkuzulis <scapig2@yandex.ru>2011-10-27 21:24:58 +0400
committerkuzulis <kuzulis@kuzulis.localdomain>2011-10-27 21:24:58 +0400
commitf5374e5df67806e4ff0e567cef104da55381002e (patch)
tree6e07fbbc0c4d715e3c280e607ece4ff657799dc5 /tests
parent09c3ac82740038e7e5e9ce55a668e3c4cfdbfc51 (diff)
downloadqtserialport-f5374e5df67806e4ff0e567cef104da55381002e.tar.gz
/tests/guidevtest: Added new stub test class "WaitForX Test".
Diffstat (limited to 'tests')
-rw-r--r--tests/guidevtest/guidevtest.pro4
-rw-r--r--tests/guidevtest/maindialog.cpp4
-rw-r--r--tests/guidevtest/unittests.h10
-rw-r--r--tests/guidevtest/unittestwaitforx.cpp31
4 files changed, 48 insertions, 1 deletions
diff --git a/tests/guidevtest/guidevtest.pro b/tests/guidevtest/guidevtest.pro
index 388ebdb..5acd8b9 100644
--- a/tests/guidevtest/guidevtest.pro
+++ b/tests/guidevtest/guidevtest.pro
@@ -23,7 +23,8 @@ SOURCES += \
main.cpp \
maindialog.cpp \
unittestinfo.cpp \
- unittestsignals.cpp
+ unittestsignals.cpp \
+ unittestwaitforx.cpp
HEADERS += \
maindialog.h \
@@ -40,3 +41,4 @@ FORMS += \
+
diff --git a/tests/guidevtest/maindialog.cpp b/tests/guidevtest/maindialog.cpp
index 3b6ae67..7195e9a 100644
--- a/tests/guidevtest/maindialog.cpp
+++ b/tests/guidevtest/maindialog.cpp
@@ -96,6 +96,8 @@ UnitTestBase *UnitTestFactory::create(UnitTestBase::UnitID id, Logger *logger)
return new UnitTestInfo(logger);
case UnitTestBase::SignalsUnitId:
return new UnitTestSignals(logger);
+ case UnitTestBase::WaitForXUnitId:
+ return new UnitTestWaitForX(logger);
default:;
}
@@ -346,6 +348,8 @@ void MainDialog::createAvailableTests()
m_testsList.append(UnitTestFactory::create(UnitTestBase::InfoUnitId, m_logger));
// Create "Signals test"
m_testsList.append(UnitTestFactory::create(UnitTestBase::SignalsUnitId, m_logger));
+ // Create "WaitForX test"
+ m_testsList.append(UnitTestFactory::create(UnitTestBase::WaitForXUnitId, m_logger));
foreach(UnitTestBase *test, m_testsList) {
diff --git a/tests/guidevtest/unittests.h b/tests/guidevtest/unittests.h
index 678a83a..6abfbf5 100644
--- a/tests/guidevtest/unittests.h
+++ b/tests/guidevtest/unittests.h
@@ -31,6 +31,7 @@ public:
enum UnitID {
InfoUnitId,
SignalsUnitId,
+ WaitForXUnitId,
};
@@ -110,6 +111,15 @@ private:
};
+class UnitTestWaitForX : public UnitTestBase
+{
+ Q_OBJECT
+public:
+ explicit UnitTestWaitForX(Logger *logger, QObject *parent = 0);
+
+public slots:
+ virtual void start();
+};
class UnitTestFactory
diff --git a/tests/guidevtest/unittestwaitforx.cpp b/tests/guidevtest/unittestwaitforx.cpp
new file mode 100644
index 0000000..24b5fc1
--- /dev/null
+++ b/tests/guidevtest/unittestwaitforx.cpp
@@ -0,0 +1,31 @@
+#include "unittests.h"
+#include "serialport.h"
+
+
+
+/* Public methods */
+
+UnitTestWaitForX::UnitTestWaitForX(Logger *logger, QObject *parent)
+ : UnitTestBase(UnitTestBase::WaitForXUnitId, logger, parent)
+{
+ m_name = QString(tr("WaitForX Test"));
+ m_description = QString(tr("\"WaitForX Test\" ..."));
+}
+
+/* Public slots */
+
+void UnitTestWaitForX::start()
+{
+ QString header(tr("\n[ Test: ID#%1, Name: %2 ]\n%3\n\n"));
+ header = header
+ .arg(m_id)
+ .arg(m_name)
+ .arg(QString("timestamp"));/*.arg(UnitTestManager::timestamp());*/
+
+ m_logger->addContent(header);
+
+ ////
+
+ emit finished();
+}
+