diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2014-07-01 18:57:59 +0400 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2014-07-09 09:13:08 +0200 |
commit | 3c48b918339b25fa21595d7bed6dc8b9e5ca65b0 (patch) | |
tree | 92984c235983144bd7ac54d444e7acf07e7949ab /tests | |
parent | a55dbce3d1a5f75647d5325f94af9d76a41cdede (diff) | |
download | qtserialport-3c48b918339b25fa21595d7bed6dc8b9e5ca65b0.tar.gz |
Make independent implementation of QSerialPortInfo for OS X
Building in OS X uses some shared code from the serialportinfo_unix.cpp
module with the OS X specific code from the serialportinfo_mac.cpp module.
Thus, all code of the serialportinfo_unix.cpp module, which not related
with the OS X, is shielded by a macro. It adds an excessive garbage for
readability in this module and also some confusion in the *.pri file.
It makes sense to make implementation of the serialportinfo_mac.cpp
module completely independent, that will simplify maintaining of source
code.
Besides are added tests which can reveal declared but not implemented
methods in building, and also to check a correctness of default values
at running.
Tested build on OS X 10.8.4 with Qt4, an then on Android with Qt5.
Change-Id: I67935b64e2b623fb8d4c14d59e1b87f1eac71c3e
Reviewed-by: Bernard Pratz <guyzmo+qt@m0g.net>
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/qserialportinfo/tst_qserialportinfo.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/manual/qserialportinfo/tst_qserialportinfo.cpp b/tests/manual/qserialportinfo/tst_qserialportinfo.cpp index c73aa00..1908dc0 100644 --- a/tests/manual/qserialportinfo/tst_qserialportinfo.cpp +++ b/tests/manual/qserialportinfo/tst_qserialportinfo.cpp @@ -54,6 +54,7 @@ class tst_QSerialPortInfo : public QObject private slots: void serialPortInfoList(); + void standardBaudRateList(); void constructors(); void assignment(); }; @@ -64,9 +65,27 @@ void tst_QSerialPortInfo::serialPortInfoList() QCOMPARE(list.isEmpty(), false); } +void tst_QSerialPortInfo::standardBaudRateList() +{ + QList<qint32> list(QSerialPortInfo::standardBaudRates()); + QCOMPARE(list.isEmpty(), false); +} + void tst_QSerialPortInfo::constructors() { - // FIXME + QSerialPortInfo serialPortInfo; + QCOMPARE(serialPortInfo.portName().isEmpty(), true); + QCOMPARE(serialPortInfo.systemLocation().isEmpty(), true); + QCOMPARE(serialPortInfo.description().isEmpty(), true); + QCOMPARE(serialPortInfo.manufacturer().isEmpty(), true); + QCOMPARE(serialPortInfo.serialNumber().isEmpty(), true); + QCOMPARE(serialPortInfo.vendorIdentifier(), quint16(0)); + QCOMPARE(serialPortInfo.productIdentifier(), quint16(0)); + QCOMPARE(serialPortInfo.hasVendorIdentifier(), false); + QCOMPARE(serialPortInfo.hasProductIdentifier(), false); + QCOMPARE(serialPortInfo.isNull(), false); + QCOMPARE(serialPortInfo.isBusy(), false); + QCOMPARE(serialPortInfo.isValid(), false); } void tst_QSerialPortInfo::assignment() |