summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* Add API for querying the serial numberLaszlo Papp2014-03-021-0/+2
| | | | | | | | | | | Thanks go to Massimo Callegari for the initial patch and the request to remind us again. Thanks also go to Denis and Sergey for working on the windows serial number parser. Task-number: QTBUG-31981 Change-Id: I60d882280f481eb99d275e0a9c81da50292b1c61 Reviewed-by: Massimo Callegari <massimocallegari@yahoo.it> Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
* Add the minimal set of the base auto testsv5.3.0-alpha1Denis Shienkov2014-02-223-1/+231
| | | | | | | | | | | | | | | | Added two types of tests: the constructing tests and the opening tests. The construction tests are checking of the getters to return of default values. Also are checking a correctness work of the constructor of class with different types of a port name. The opening tests are checking the open() method with the valid/invalid open modes and with the valid/invalid port names. The results are compared with the expected behavior (with the error codes and the return values). Change-Id: I503adf629cf613844bf9b96d8704ff017ea5fcdb Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* test: Add 5.1.0 bic data for linux-gcc-ia32Sergio Ahumada2013-11-273-0/+3527
| | | | | Change-Id: I23025d79468650a62c881d3c8cbedfcb7d039495 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Disable QNX buildAndreas Holzammer2013-10-311-1/+1
| | | | | | | | | Nobody tested the serial port and it does not compile as CRTSCTS is not defined. Lets disable it until its fixed. Change-Id: Ifc032194773b166a7fd9502f5d7f518019d80c7c Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Add CMake unit tests for QtSerialPort.Stephen Kelly2013-04-094-1/+24
| | | | | Change-Id: I406517f216e7c73c20439ca2f9a17e60709ef661 Reviewed-by: Laszlo Papp <lpapp@kde.org>
* tests: Don't run manual tests in the CI systemv5.1.0-alpha1Sergio Ahumada2013-04-042-2/+0
| | | | | | | | Manual tests are not suppossed to be run by the CI system, so removing CONFIG += testcase from the .pro files. Change-Id: I43a729a22a25d9656a1cf76cf3489b3abb893fbd Reviewed-by: Laszlo Papp <lpapp@kde.org>
* Make the test .pro files more aligned and consistent to the other modulesLaszlo Papp2013-02-284-4/+5
| | | | | Change-Id: I6c227b10dd4cb4f5cd8390fa5fae3a282b676f9e Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Assign a new method name for the port name setting APILaszlo Papp2013-02-231-7/+7
| | | | | | | | | | | | | | | | | | * This is more intuitive as it is not setting the port with all its settings like baud rate, flow control, stop bits, parity, and so forth, but only the port name. * This will allow in upcoming change to establish a property for the port name along with a port name changed signal to be useful from different threads, QML, and so forth. * Clean up the documentation not to provide internal information to the end users, and also make the text a bit more concise and better readable. * Examples are also changed accordingly, to use the new API. Change-Id: Idbaa8ee2dee17c63fc0278f687ccc231c5ab670f Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Remove the QtSerialPort namespace define and hence namespace usageLaszlo Papp2013-02-072-2/+2
| | | | | | | | | | * This is for following the convention in the Qt Project with the rest. * This fixes examples and tests to build now as all of them are broken due to the regression. Change-Id: I3f4d64d97466520aea621da582a64a0d97e32136 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Rewrite the assignment test function from scratch.Laszlo Papp2013-02-011-9/+9
| | | | | | | | | 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>
* Refactor certain variable names, remove useless comments and so forthLaszlo Papp2013-02-012-23/+23
| | | | | Change-Id: Id8af629c2b488050b8accd4c552e9b0ebf366e32 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Make all the file renames and relevant changesLaszlo Papp2013-01-275-11/+11
| | | | | | | | "git log --follow /path/to/the/file/in/question" can be used, for instance, for the renamed files to get the whole history. Change-Id: I20da087ca88e2c179a6c3232772fa21575e0aa6a Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change the QtCore reference in the copyright headers to QtSerialPortLaszlo Papp2013-01-272-2/+2
| | | | | Change-Id: Ic19f6843d32260404f72038cf77aa6f686e7a3ff Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Rename the SerialPort* classes to QSerialPort* including the internals.Laszlo Papp2013-01-272-69/+69
| | | | | | | | | | | | | | | Unfortunately, the rename has to happen in a separate commit because of the limitations of "git": "git does not track renames of files in history, git only records tree snapshots. It can try to guess whether a change was a rename, or just unrelated removal+addition, when asked. You can help this by making the rename in a different commit from a modification. See man git-log -C and -M" ... so the rename will happen in the next change. Change-Id: Ibe56eba0a0d2c7489db48a6c519d60d3315c00de Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change the variable names properly for the examples and tests in case of Qt4Laszlo Papp2013-01-262-2/+2
| | | | | Change-Id: I08609cb9c679002262a24b52fc46bbfcabb512d7 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change Denis' email address in the copyrights headersLaszlo Papp2013-01-262-2/+2
| | | | | Change-Id: I8c564f68bb32423957f2171e1c76d8a428f16eb3 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Call the module QtSerialPort instead of QtAddOnSerialPortLaszlo Papp2013-01-262-4/+4
| | | | | | | | Use the QTSERIALPORT as a term for internal variables as well to remain consistent with the freshly chosen module name. Change-Id: Ia780b105649b39a1eca46702466da5bc31ec5af0 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Change the copyright headers to the Qt Project standard formLaszlo Papp2013-01-262-48/+48
| | | | | Change-Id: Id6414c91a0bc700734873cd798807868865cd453 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Use "BaudRate" instead of "Rate" and "BaudXXXX" instead of "RateXXXX"Laszlo Papp2013-01-261-18/+18
| | | | | Change-Id: Id5db378b6da89f672cb55fa312e325cd1e9b88ce Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Updating a project tree for compilation fixingDenis Shienkov2012-11-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For optimization and build correction for Qt4/Qt5 there was a need for unification and modification of a tree of projects. The previous structure of the project didn't meet the changed requirements for Qt5 that led to errors of build and complication of possibility of correction of errors of build. It is necessary to note the main changes: * Removed not used /modules direcrory with all content, because it is autogenerated. * Moved all contents from /src directory to /src/serialport directory. It was necessary for simplification of the qmake commands at building for Qt5 (in particular, there is no need to fill out a module name since it is the name of directory /serialport). * Changed the exported macro defines Q_ADDON_SERIALPORT_EXPORT to Q_SERIALPORT_EXPORT and QT_ADDON_SERIALPORT_LIB to QT_SERIALPORT_LIB. It was necessary for fixing compilation error for unknown reason on Windows and Qt5 when used MSVC compiler. Checked on Windows and Gnu/Linux, also this patch fixes bug: Task-number: QTPLAYGROUND-5 Change-Id: Idc9ba98115d5961a22ae307c0e4034a56f3223b5 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
* Fix the broken tests with Qt4 due to the QSKIP API changeLaszlo Papp2012-05-231-32/+13
| | | | | | | | | | | QSKIP went through a source incompatible change from Qt4 migration to Qt5. Therefore, the customers cannot build the project with tests (default build) without such a fix like this. Change-Id: I376e88db723c61358d00cb737a30cde46e03c3a1 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Debao Zhang <dbzhang800@gmail.com> Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* Prepared a first manual test example.Denis Shienkov2012-05-187-0/+354
| | | | | | | | This test checks access to the all available ports, as well do the validation a configuring each port. Change-Id: Ic3f58b43d9427be9164fae431f4775fb26afc5ca Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* The first prepare QtSerialPort to the form of add-on, with the requirements ↵Denis Shienkov2012-02-2925-2792/+0
| | | | | | | of "Creating a new module or tool for Qt" Change-Id: I62bba3590a8873bfd03ed6836ac105e0a30d35ba Reviewed-by: Denis Shienkov <scapig@yandex.ru>
* Linux: SerialPortInfo, modify macro from HAVE_UDEV to HAVE_LIBUDEV.kuzulis2011-11-241-3/+1
|
* *nix: Preparing for the implementation SerialPortInfo for variouskuzulis2011-11-201-2/+2
| | | | *nix/bsd OS.
* /tests/guidevtest: For test "IO test" added function to create randomlykuzulis2011-11-191-2/+18
| | | | | the data array given size. In this case, control characters 11h and 13h (XON/XOFF) are not added to the array.
* /tests/guidevtest: For test "IO test" implemented in a log record of thekuzulis2011-11-191-1/+24
| | | | | transmitted/received data packet. In this case, the data in the log are sorted in a table of 32 characters.
* /tests/guidevtest: For test "IO test" increased timeout to read thekuzulis2011-11-191-1/+1
| | | | whole data packet to 700 msec.
* /tests/guidevtest: For "IO test" added test description.kuzulis2011-11-191-19/+28
|
* /tests/guidevtest: Added new IO test.Denis Shienkov2011-11-157-43/+350
|
* /tests/guiapp: Added processing and show last error code in trace dialog.Denis Shienkov2011-11-141-0/+2
|
* /tests/guiapp: For dialog boxes added titles.Denis Shienkov2011-11-142-2/+2
|
* /tests/guiapp: The mechanism calls the dialog boxes. Now the dialog boxes ↵Denis Shienkov2011-11-142-16/+5
| | | | are created in stack.
* /tests/guiapp: Removed unused files.Denis Shienkov2011-11-149-1084/+0
|
* /tests/guiapp: Moved from QWidget to QDialog.kuzulis2011-11-1411-12/+1081
|
* /tests/guidevtest: Added new stub test class "WaitForX Test".kuzulis2011-10-274-1/+48
|
* /tests/guidevtest: Added description about "Signals Test".kuzulis2011-10-262-5/+40
|