Commit Graph

11 Commits

Author SHA1 Message Date
Igor Kushnir
b514ba1270 tests: add ConcurrentQueueTest::randomCalls()
The new test is a randomized stress test. It consistently passes right
now. The test's detailed output can be analyzed to reveal anomalies and
bugs. The test can catch various bugs that future changes to
ConcurrentQueue's code may introduce.
2021-12-29 09:36:44 +01:00
Igor Kushnir
2cbcaaa391 tests: add ConcurrentQueueTest::waitAllFromMultipleThreads()
This new test hangs because ConcurrentQueue::nextJob() unblocks only
one of the threads that wait for _waitVar.
2021-12-29 09:36:44 +01:00
Igor Kushnir
34b0698d02 Make ConcurrentQueueTest::cancelPending1UserThread() non-flaky
ConcurrentQueueTest::cancelPending1UserThread() often fails when
ConcurrentQueueTest is launched from Qt Creator immediately after
switching between Debug and Release YACReader build configurations.
The CPU busyness must be affecting the thread scheduling timing, which
breaks the test's timing assumptions in this case.

Use the return value of ConcurrentQueue::cancelPending() instead of
relying on the timing of thread scheduling to determine the number of
canceled jobs.
2021-12-29 09:36:44 +01:00
Igor Kushnir
4bbd16c3b3 tests: add ConcurrentQueueTest::cancelPending1UserThread()
This new test consistently fails because of a bug in
ConcurrentQueue::cancelPending() described in the following comment:
https://github.com/YACReader/yacreader/issues/201#issuecomment-774987383
2021-12-29 09:36:44 +01:00
Igor Kushnir
ec938651c4 tests: add the first Qt Test - ConcurrentQueueTest
Place common Qt Test qmake code into tests/qt_test.pri.

Build tests as part of top-level YACReader project unless no_tests
CONFIG option is set. This way the tests are built by default during
development. Packagers can skip building tests by running
`qmake "CONFIG+=no_tests"`.

Both ConcurrentQueueTest::singleUserThread() and
ConcurrentQueueTest::multipleUserThreads() pass. Evidently
ConcurrentQueue::enqueue() can be safely called from multiple threads on
the same ConcurrentQueue object with no additional synchronization. Once
each thread enqueues all its jobs, one thread can safely call waitAll().
2021-12-29 09:36:44 +01:00
Joan Karadimov
1c3fd4d16f Do not pass MSVC arguments to mingw/gcc 2021-11-02 11:02:32 +01:00
Luis Ángel San Martín
5aa02a19bb clang-format 2021-10-18 21:56:52 +02:00
Luis Ángel San Martín
e3ec56aa43 Format code using clang-format 2019-05-30 19:46:37 +02:00
Felix Kauselmann
ab96056b0e Normalize line endings
Normalize the line endings for a bunch of files previously not covered 
by .gitattributes.
2018-08-07 11:09:02 +02:00
Felix Kauselmann
d5a11fb16b Add .gitattributes rules for text and binary handling 2018-07-30 15:04:04 +02:00
apollo2k4
f2a356fc70 Update russian translation. Need to subtract and to bring the terminology to a common denominator 2018-01-08 16:32:56 +00:00