summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* BC data files for QtSerialPort for Qt 5.6Milla Pohjanheimo2016-09-131-0/+3952
| | | | | | | Added binary compatibility data files for tst_bic test Change-Id: I0c3c4fc4e7d48fdcd1bec4a65a51a79f1a1a88ca Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* Fix stalling of reading with the limited buffer size on *nixDenis Shienkov2015-10-011-0/+45
| | | | | | | | | | | When the read buffer with a limited size is used, the read notifier becomes disabled when the buffer completely is filled. The notifier should be enabled again when several bytes were read from the read buffer. Change-Id: I723253fb153a1144009579141fa0ce1aca93b648 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Open the dummy device for tests on any platformDenis Shienkov2015-09-101-2/+0
| | | | | | | | | | | | | | | The virtual serial port drivers (such as com0com or tty0tty) require all pairs of devices were open, otherwise any I/O will fails. Seems, it is feature of com0com and tty0tty drivers, and maybe others drivers of virtual devices. There is only one waitForReadyReadWithTimeout() test which opens the dummy device only in Windows. So, it is necessary to open the dummy device on any platform. Change-Id: I472238704fe200309b5015c2f9740d8e4b6cb41f Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove the clearReceiver() function from the testsDenis Shienkov2015-09-101-54/+0
| | | | | | | | | It is not necessary any more. Now all tests with the com0com serial ports are passed without this function. Change-Id: I02b50ca5f28cf93e9e2731d3d0351607ffd2b814 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use the termios v2 to custom baud rate switchingDenis Shienkov2015-09-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a long time the Linux kernel has support new version of the termios structure (V2). To setup the user speed it is necessary to do following steps: * Query current content of termios2 by calling the ioctl() with the TCGETS2 flag. * Add to the c_cflag field the BOTHER flag. * Set to the c_ispeed/c_ospeed fields an actual values of custom speeds. * Write new content of termios2 back by calling the ioctl() with the TCSETS2 flag. This new method much simpler and is more transparent in implementation than changes of a custom divisor. It is preferable and will be used by default for all cases. If for some reason a current Linux kernel doesn't support the termios2, then will be falling back to the old method with changing of a custom divisor. Tested with the on-board and the USB (PL2303) serial ports. Task-number: QTBUG-48094 Change-Id: I49a5389b089980b616b4e2ff815ce0b579752d0e Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Massimo Callegari <massimocallegari@yahoo.it> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactor functionality of the loopBack testDenis Shienkov2015-09-081-23/+59
| | | | | | | | | | | | | | | | | Testing of a single port with connected Tx and Rx pins doesn't make sense since: * It is necessary existence of a real physical port. * It is impossible to set different speed for transmission and reception (in common case). Now the new test is deprived of these problems, it can reveal real mismatch of speeds. Change-Id: I1c60a373b60198d9aa9cefc329c0817981232de8 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add auto tests to check a propertiesDenis Shienkov2015-09-081-0/+171
| | | | | | | | ... such as baudRate, dataBits, parity, stopBits, and flowControl. Change-Id: Ife5c2993e0c0302d06ef5f51a9fdc53f87f95896 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Refactor the speed configuration for *nixDenis Shienkov2015-09-071-0/+33
| | | | | | | | | | | | | | | | | | | | The internal implementation of this is a little tangled. It is reasonable to simplify it: 1. Remove the setBaudRate_helper() method, as it is equivalent to setStandardBaudRate() method. 2. Now the setStandardBaudRate() and the setCustomBaudRate() are self-sufficient methods (can setup a speed and an error codes internally) and return a boolean values. Also added the "loopback" test for check of different speeds. Tested with the on-board and the USB serial ports. Change-Id: I4320c2e29ad42a394e07753cbaea804d0faf6b78 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Increase time for testDenis Shienkov2015-09-061-1/+1
| | | | | | | | | | | ... because 500 msec is not enough for reopening of real USB serial port in synchronousReadWriteAfterAsynchronousReadWrite test. Tested with the USB serial ports from Prolific (PL2303). Change-Id: Ic944567247d1b4a9971489289279b8191704d38c Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Share some of windows specific tests and for *unixDenis Shienkov2015-09-061-5/+0
| | | | | | | | Tested on Linux with the USB serial ports PL2303. Change-Id: I37b887c7f3a9abe98a83fbf8af9587de330097b3 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use the new signal/slot syntax everywherev5.6.0-alpha1Denis Shienkov2015-09-021-13/+13
| | | | | Change-Id: Ia9868d010106abbfeb8f8d24e84adf37de879991 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Avoid to start of communication notifier if it already is activeDenis Shienkov2015-08-271-0/+11
| | | | | | | | | | | | This happens in the QSP::clear() method, where the WaitCommEvent() function returns with an error "The parameter is incorrect", because it calls when the waiting already is active. Tested with the virtual com0com and on-board serial ports. Change-Id: I351a336f2d3c05852a654e7bccc3ff84d7aba025 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Get rid of incomplete and never used manual testsDenis Shienkov2015-08-066-326/+1
| | | | | | Change-Id: I8057ab7b7a641c8f6abde8e9063fd2ee56fc1165 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Allow to pass the flush tests using the tty0tty virtual devicesDenis Shienkov2015-08-051-0/+8
| | | | | | | | | The receiver on other side should be opened even if it is not used; otherwise the tests will be fails with the EINVAL error. Change-Id: I85ff942c5b7e8276f22867921239bfc8933dac77 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix reading when switching from asynchronous to synchronous approachDenis Shienkov2015-07-071-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | If one wants to use the asynchronous approach (using the signals and slots), and then - the synchronous (using the waitForXX functions) then synchronous reading stalls because the waitForReadyRead() method always returns the TimeoutError code. The reason is that the signal readyRead() is emitted before the startAsyncRead() (or the startAsyncCommunication()) called inside of completeAsyncRead(). Need to emit the readyRead() only after the next asynchronous reading (the startAsyncRead() or the startAsyncCommunication()) was cocked. Now the behavior is similar to behavior of QWindowsPipeReader. Besides, the auto-test which reveals this issue is added. Tested with the virtual com0com serial ports, using the auto-tests and set of the examples. Change-Id: I64bfb871d17c179f474d6672546e532566913a7f Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Andrzej Ostruszka <andrzej.ostruszka@gmail.com>
* Remove the QT_VERSION_CHECK(5, 0, 0) macrov5.5.0-beta1Denis Shienkov2015-04-193-29/+0
| | | | | | | | ... since current branch supports only Qt5. Change-Id: I2aaf4261b307eb6ca7ae32e94ddaf7801395f022 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove space between "if/elif defined" macro and its bracketDenis Shienkov2015-03-121-4/+4
| | | | | | | | It is the recommended coding-style which is used in the Qt core. Change-Id: Id2efc3b2276b2d86d75fe0b7240077dbb61286f0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-257-3531/+14562
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/serialport/qserialport_unix.cpp src/serialport/qserialport_unix_p.h src/serialport/qserialport_win.cpp src/serialport/qserialport_win_p.h src/serialport/qserialport_wince.cpp src/serialport/qserialport_wince_p.h Change-Id: Ibb917652b132e66fbb90f437bf762c1094911dc0
| * bic: Add/Replace 5.{1,2,3,4}.0 bic data for linux-gcc-amd64v5.4.25.4.2Sergio Ahumada2015-02-135-3520/+14514
| | | | | | | | | | | | | | | | | | Remove the ia32 data since there are no linux x86 machines in the CI system (which makes the data useless from an automated testing point of view) and most people use x64 these days anyway. Change-Id: If43f9164f94662dc7f7160babb9e3de709078fec Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
| * Skip the constructByInfo() test if no serial ports are found on *nixDenis Shienkov2015-01-161-1/+15
| | | | | | | | | | | | | | | | | | | | | | In unix-like systems it is possible to use socat to creation of the virtual serial ports. But these devices are symlinks on the /dev/pts devices, that is not a serial ports. Thus QSPI can not find it and will construct a null object. In this case this is not an error and we need just to skip test. Change-Id: I59bbb3c4653555be39ea6fff903c386065c10d0a Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
| * Share the clearReceiver() function and for the *nix testsDenis Shienkov2015-01-151-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The waitForReadyReadWithTimeout() test is failed when using the socat utility. The reason is that the receiver's side receive data from the previous waitForBytesWritten() test, even the receiver was closed and re-opened again in the new test. We need suppress this behavior using the clearReceiver() function when starting of waitForReadyReadWithTimeout() test. Change-Id: I6735aa9c9744ec1732f9bd4f701068a540ae2316 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
| * Autotest misconfiguration error message is more verboseSergey Belyashov2014-12-012-4/+31
| | | | | | | | | | | | | | | | Error message about missing environment variables generates list of required variables. Change-Id: Icbb680abbd9fc5d0549907b7399757d943c6d535 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Update copyright headersJani Heikkinen2015-02-135-60/+44
| | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I35f551de8408a2eb6a0f39df1f09d90c8084a7c0 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devFrederik Gladhorn2015-01-205-1/+243
|\ \
| * \ Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-195-1/+243
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/serialport/qserialport.cpp src/serialport/qserialport.h src/serialport/qserialport_unix.cpp src/serialport/qserialport_unix_p.h src/serialport/qserialport_win.cpp src/serialport/qserialport_win_p.h src/serialport/qserialport_wince_p.h src/serialport/qt4support/include/private/qcore_unix_p.h Change-Id: Ifaa5ce8c1c0eb1c70246c54782719b91f3c95771
| | * Allow to use custom devices pathsDenis Shienkov2014-11-273-1/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSP incorrectly transforms non-standard device names to their paths and vice-versa (for example, "/home/ttyS0", "//./COM1", and so on). Now this problem is solved: * The transformation code is moved to QSPP. * Added autotests auto/qserialportinfoprivate to testing of conversion algorithm. These tests are private and can be activated with building of QtSerialPort with: qmake "QT_CONFIG+=private_tests warnings_are_errors" \ DEFINES+=QT_BUILD_INTERNAL Tested on Windows 8, Linux, OSX with auto-tests, with on-board and virtual serial ports. Task-number: QTBUG-38639 Change-Id: I43757a7f1390f53ed2b1d70de59c6bfb71892a59 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
| | * Fix QSPI::isNull()Denis Shienkov2014-11-213-1/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method QSPI::isNull() should return false when QSPI is empty. Tested on Winsows 8 and Linux with on-board, virtual and USB serial ports using Qt5 and then Qt4. Task-number: QTBUG-41262 Change-Id: Ic9e0afc5549311283aef7ec2ed841f5e418b7edf Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* | | Improve usage of the break state for the Tx lineDenis Shienkov2015-01-151-0/+59
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Now the sendBreak() method is deprecated since it is blocking and impossible to implement same behavior on different platforms using their API's. Besides, this method can be implemented via setBreakEnabled() and QTimer. 2. Introduced the new property named as "breakEnabled" which consist of setBreakEnabled() and isBreakEnabled() methods and the signal breakEnabledChanged(). Note: After opening, the port always is in non-break state. Task-number: QTBUG-36571 Change-Id: Ib808dab7eaed8cc5449c66d8186a29a7b7e45afc Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Drop the Qt4 supportDenis Shienkov2014-10-233-15/+3
|/ | | | | | | | Now QtSerialPort can be built for Qt5 only. QtSerialPort for Qt4 is developed in a separate branch. Change-Id: Iaaa95fb7cb0aedbfc1b17ed11717fff8f9c126a0 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-10-141-7/+84
|\ | | | | | | Change-Id: Id7e66059233e8d07ba44cad19048d9cddc68e250
| * Restart of async reading when a QSP::clear() is calledDenis Shienkov2014-10-031-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method QSP::clear() can stall reading in case of following situations: - at the moment when PurgeComm abort of previously started asynchronous reading operation - when a serial port is in hardware flow control mode - when a serial port has a limited read buffer size Therefore is necessary restart of asynchronous reading to enable of the read sequence. Change-Id: I7a722a1ee20ecba0dd631da96ca81d2937d7ca6b Reviewed-by: Robert Kurjata <rkurjata@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
| * Fix reading on Windows at limited read buffer sizeDenis Shienkov2014-10-021-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case the read buffer has a limited size then are impossible to read remainder which is still can be in driver's queue, since no readyRead signal emmitted and reading are stalled. Problem is that Windows does not fire the EV_RXCHAR event in case a driver's queue has ready to read remainder; this event will be triggered only when a new data are received. The solution is to start of asynchronous read operation for reading of possible remainder from the queue after doing QSP::read() from the user. Besides is necessary to meet conditions: - do not start reading in case a reading already is started - do not start reading in case is not in limited buffer size - do not start reading in case is a previous reading returns a less data than read buffer size or are not in the hardware flow control mode Tested on Windows 8 with virtual com0com serial ports using Qt5 and then Qt4. Task-number: QTBUG-41295 Change-Id: I01797e6f8d6006751244144fead3616b1de1b811 Reviewed-by: Robert Kurjata <rkurjata@gmail.com> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
| * Fix typo in twoStageSynchronousLoopback testDenis Shienkov2014-09-281-2/+2
| | | | | | | | | | | | | | | | | | Commit f1761c1236edce428278f7a9e8aa1091097eaa57 introduce a typo for receiverPort and senderPort variables, that lead to failure of test. Change-Id: I18ecad78bb11d7bb218a674c3c3bf9c863a2b33c Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
| * Fix order of passed parameters into QCOMPAREDenis Shienkov2014-09-281-7/+7
| | | | | | | | | | | | | | | | According to documentation the QCOMPARE should accept to the first parameter an actual value, and to the second parameter an expected value. Change-Id: I64e762e779fa6a61401f358c4dd6097dacf7a33a Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-161-4/+160
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5887622f233275703cca8cc2a5db4aaaccc72d97
| * Make tst_qtserialport build with Qt 4Samuel Gaist2014-09-121-4/+5
| | | | | | | | | | | | | | | | | | The newly moved twoStageSynchronousLoopback fails to compile since there's no qCompare available for int and long long with Qt 4. This patch allows to build it again with Qt 4 Change-Id: Ib3764b125f371ae70864bd578c7ccda39d08ae22 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
| * Fix a race condition at writing on Windowsv5.3.25.3.2Denis Shienkov2014-08-281-0/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. The writeStarted flag shall be reset to false after bytesWritten() signal is emitted, but not before it. 2. In case of start of writing from the startAsyncWriteTimer it is necessary to call the startAsyncWrite() method but not the completeAsyncWrite() method. It give guarantees to exclude of race condition to multiple call of the WriteFile twice until the write operation is not completed. For example, a race condition is watched in case of writing data from the slots which are connected to the bytesWritten() signal from a device; or to the timeout() signal from a timer with zero interval. To checking of these scenarios are added additional autotests. Tested on Windows 8 with the on-board and USB serial ports, using Qt5. Task-number: QTBUG-40769 Change-Id: Iedabbf38847debeee795a10fd7a4c54c65d2a338 Reviewed-by: Patrick Noffke <patrick.noffke@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* | Update license headers and add new license filesAntti Kokko2014-09-093-54/+30
|/ | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I08685205169cdd4b49a651ed98f36ba1e6c1bb29 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Move the synchronous loopback test from benchmarks to auto testsDenis Shienkov2014-08-035-158/+29
| | | | | | | | | | | | | | | Previous commit 76f293bfb0fd7bab391f96ac822eacc40e4c5176 with adding of this test to the benchmarks were hasty. After all it makes sense to place it to auto tests to have opportunity to run with others together. Besides, this test is renamed since it is not a loopback, it is an I/O test with the synchronous approach. Change-Id: I043a6e0075561167bb29a59a384554ef98dbbd4a Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix events handling in waitForBytesWritten() method on WindowsDenis Shienkov2014-07-301-3/+48
| | | | | | | | | | | | | | | | | | | | | In case of communication event is triggered in the waitForBytesWritten() method then necessary to process it with the _q_completeAsyncCommunication() method, but not with the _q_completeAsyncRead() method. Otherwise it leads to false filling of the readBuffer with the data that were read earlier (or with garbage) which remained in readChunkBuffer. The synchronous loopback autotest reproduces a bug without of this patch. Tested on Windows 7/8 with the on-board and USB serial ports, using Qt5. Task-number: QTBUG-40344 Change-Id: I679109b60f4058c4c6f7e5f02c1f70ba6039d8d8 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Add the synchronous loopback data verification testDenis Shienkov2014-07-264-1/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Good reason to check of data correctness at transferring and receiving. In this test are used two serial ports, connected in a null-modem mode: http://en.wikipedia.org/wiki/Null_modem . The sender port transfers data to the receiver port. After data are received is carried out check of equivalence of the transferred and received data. Before run of testing it is necessary to set two variable environments QTEST_SERIALPORT_SENDER and QTEST_SERIALPORT_RECEIVER to specify names of used serial ports. This test can reveal errors related with the internal data processing and also errors of synchronous I/O inside of QSerialPort. This test is placed in separate "benchmarks" category not to mix-up with "manual" and "auto" categories, because this test is closer to "benchmarks" by own functionality. Tested on Windows 7/8 with the virtual com0com serial ports, using Qt4 and then Qt5. Change-Id: Ie6f87b50784bce211cf68c16cf75f79d12a8564f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Make independent implementation of QSerialPortInfo for OS XDenis Shienkov2014-07-091-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix waitForReadyRead() on windowsDenis Shienkov2014-06-031-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | The commit 2360c401ae2012ed1b5a2b470a088cbbdb0d7f27 introduced an regression into waitForReadyRead(). Before this commit each read transaction was started again until the zero number of bytes will returns from FIFO. When FIFO is empty, all data has been read, and only then the waitForReadyRead() return true. I.e. condition "qint64(readBuffer.size()) != currentReadBufferSize" does not mean that reading is finished. But after that commit this condition is incorrect, because now each read operation started once and can not return zero bytes (in case the number of read bytes less than ReadChunkSize). Thus it led to returning of TimeoutError error. Now, this issue has been fixed. Also is added the set of auto-tests to testing of the waitForReadyRead() method. Tested on Windows 7/8 using Qt5 and then Qt4. Task-number: QTBUG-39314 Change-Id: I8abbf986c2a1cc77af634ddbc1747fb46f416a39 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add test for the waitForBytesWritten() methodDenis Shienkov2014-05-261-0/+16
| | | | | | Change-Id: I4a6767196d205cf1f0715edfb9ea117a2d7fa5c9 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix compilation of qserialport auto-test with Qt4Denis Shienkov2014-05-261-0/+8
| | | | | | | | | | | | | 1. The QCOMPARE macro can not make type cast between "int" and "qint64", though on qt5 there are no problems. 2. The QSKIP macro should accept two input parameters. Tested build on Lixux 64bit and Windows with Qt4 and then Qt5. Change-Id: I1f8497201e8d704098faea789bc61829f0d2f9e4 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix compilation of qserialport auto-test with Qt4Denis Shienkov2014-05-231-4/+4
| | | | | | | | | | | In qt4 the macro QCOMPARE can not make type cast between "int" and "qint64", though on qt5 there are no problems. Tested build on Lixux 64bit with Qt4 and then Qt5. Change-Id: I258f8ee4d26b65cc81720d66714ef69df23e7266 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Add a unit test to verify flush()Denis Shienkov2014-05-131-0/+96
| | | | | | | | On Windows a test will be skipped since flush() does not work there Change-Id: Ibda38401aff5f1c50644c6d61f9802217146a4fb Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix the default constructor test caseDenis Shienkov2014-05-031-3/+4
| | | | | | | | | Commit 7c737e0edcb93585856c65890ef34e5c5a28ee6b introduced this regression by changing the default baud rate from 0 to 9600. Change-Id: If20315eb53c3416646541dda82add0f4fc12d4a3 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Enable QtSerialPort on QNXRafael Roquetto2014-04-281-1/+1
| | | | | | | | | | On QNX, the combination (IHFLOW | OHFLOW) is equivalent to the CRTSCTS flag. Only /dev/ser* ports can be enumerated. Tested on SVTronics UEVM5432 Omap5 board with QNX 6.6 Change-Id: I64b149258a525835e63f231b5291fa86637e3d2a Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Obsolete the "settings restore on close" APILaszlo Papp2014-03-071-1/+0
| | | | | | | | | Now that the settings detection is removed, it would be better to make this API deprecate because it does not make much sense anymore. It was a bad idea to add this, but we cannot remove it for now, hence the obsoletion. Change-Id: I5e02959cb54281995b911ff0f64bd2fa36b80060 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>