summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2013-02-01 17:50:53 +0000
committerLaszlo Papp <lpapp@kde.org>2013-02-01 19:42:03 +0100
commit2533aaee8ed67e60ad103ed3b832033c167d9ad8 (patch)
treed024aa667cc77c729031c7f882cb38bbe38e1753 /tests
parentdf202538e34319f5924997598e848c53c18b418c (diff)
Rewrite the assignment test function from scratch.
Not sure an assignment test is needed at all, but it does not hurt either on the other hand. Change-Id: I937e8ce41421b457da438eb447b0422257efeb39 Reviewed-by: Thiago Augusto Correa <thiago.correa@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/qserialportinfo/tst_qserialportinfo.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/manual/qserialportinfo/tst_qserialportinfo.cpp b/tests/manual/qserialportinfo/tst_qserialportinfo.cpp
index a2787d8f..2a7fa56b 100644
--- a/tests/manual/qserialportinfo/tst_qserialportinfo.cpp
+++ b/tests/manual/qserialportinfo/tst_qserialportinfo.cpp
@@ -70,16 +70,16 @@ void tst_QSerialPortInfo::constructors()
void tst_QSerialPortInfo::assignment()
{
- QList<QSerialPortInfo> list(QSerialPortInfo::availablePorts());
+ QList<QSerialPortInfo> serialPortInfoList(QSerialPortInfo::availablePorts());
- for (int c = 0; c < list.size(); ++c) {
- QSerialPortInfo info = list[c];
- QCOMPARE(info.portName(), list[c].portName());
- QCOMPARE(info.systemLocation(), list[c].systemLocation());
- QCOMPARE(info.description(), list[c].description());
- QCOMPARE(info.manufacturer(), list[c].manufacturer());
- QCOMPARE(info.vendorIdentifier(), list[c].vendorIdentifier());
- QCOMPARE(info.productIdentifier(), list[c].productIdentifier());
+ foreach (const QSerialPortInfo &serialPortInfo, serialPortInfoList) {
+ QSerialPortInfo otherSerialPortInfo = serialPortInfo;
+ QCOMPARE(otherSerialPortInfo.portName(), serialPortInfo.portName());
+ QCOMPARE(otherSerialPortInfo.systemLocation(), serialPortInfo.systemLocation());
+ QCOMPARE(otherSerialPortInfo.description(), serialPortInfo.description());
+ QCOMPARE(otherSerialPortInfo.manufacturer(), serialPortInfo.manufacturer());
+ QCOMPARE(otherSerialPortInfo.vendorIdentifier(), serialPortInfo.vendorIdentifier());
+ QCOMPARE(otherSerialPortInfo.productIdentifier(), serialPortInfo.productIdentifier());
}
}