Commit Graph

3651 Commits

Author SHA1 Message Date
Andrew Johnson a365de2419 Fix return value of epicsUnitTest::testDone()
Wasn't properly returning a non-zero exit status
when HARNESS_ACTIVE was set.
2020-12-17 18:21:07 -06:00
Ralph Lange 0fbfc74182 Fix missing deletion in 97b29129 from 'fix/misc'
- fixes 97b29129 that was replacing two assert() statements
  without removing the original (offending) lines
2020-06-23 11:23:57 +02:00
Ralph Lange 92374b2be2 libcom/osi: fix potential leak in vxWorks/osdThread.c
(found by sonar/cppcheck)
2020-06-10 14:26:40 +02:00
Ralph Lange 579fc9d0c7 libcom/osi: fix potential leak in default/osdThreadHooks.c
(found by sonar/cppcheck)
2020-06-10 14:26:40 +02:00
Ralph Lange cd47bbf99b libcom/osi: fix debug printf() in default/osdNetIntf.c
(found by sonar/cppcheck)
2020-06-10 14:26:40 +02:00
Ralph Lange d3d40689c8 libcom/osi: fix dangerous usage of strncat (WIN32)
(found by sonar/cppcheck)
2020-06-10 14:26:40 +02:00
Ralph Lange d5eb055bb7 libcom/flex: fix sscanf() argument types
(code smell found by sonar/cppcheck)
2020-06-10 14:26:40 +02:00
Ralph Lange 97b29129af libcom/test: don't modify operand in assert() statement
(code smell found by sonar/cppcheck)
2020-06-10 14:26:40 +02:00
Andrew Johnson 732f8b19be Merge branch 'defaultMessageQueue' into 3.15 2020-05-14 10:41:52 -05:00
Andrew Johnson b03e2f376b eMQTest: Start each test with a new (empty) queue
If fastReceiver() took more than 0.01 seconds to exit,
sleepySender() might have pushed a second message onto
the queue after setting recvExit, so there would be an
extra message in the queue for the next test, which I
was seeing on Appveyor. That's my current theory...
2020-05-13 16:11:31 -05:00
Andrew Johnson 59c68807b6 Heinz Junkes' fix for lp: #1812084 Build failure on RTEMS
I reduced some of the code duplication from his original.
2020-05-13 15:26:34 -05:00
Andrew Johnson 2e7ed02a60 Allow/expect MinGW to fail epicsStackTraceTest #5 2020-05-07 13:13:26 -05:00
Andrew Johnson 089954aaab MessageQueue Tests: Extend Mark's sleep tests 2020-05-07 13:12:12 -05:00
Andrew Johnson 34e0b2f305 osdMessageQueue: Undo change to -ve timeout handling
The internal mySend() and myReceive() routines do expect a timeout
of -1 to mean wait forever, see the epicsMessageQueueSend() and
epicsMessageQueueReceive() API routines.
2020-05-04 11:56:14 -05:00
Andrew Johnson ceb13797a6 Cosmetic 2020-05-01 00:13:02 -05:00
Andrew Johnson 084557bd3e osdMessageQueue: Don't wake our sender until we're ready for it
Move the code that wakes up the next sending task to after we've
added our threadNode to the receiveQueue. He still has to wait for
us to release the Mutex though, so this might make no difference.
This commit also changes when we decrement the number of waiting
senders so it always happens immediately after a threadNode gets
taken off the sendQueue by the code that removed it.
2020-05-01 00:12:32 -05:00
Andrew Johnson aeed7cfbdd osdMessageQueue: This is the mirror of Heinz Junkes' earlier fix
When sending a message, if the queue is full so we have to wait, we
create a threadNode with an eventNode in it and stick it on the
sendQueue, then wait for a receiver to signal that event, waking us.
If we awoke due to a timeout but a receiver was actually waking us
up anyway (i.e. eventSent was set), we shouldn't give up.
2020-04-30 23:55:30 -05:00
Andrew Johnson 183c3b2a3e osdMessageQueue: Clear eventNode before returning it
Introduced freeEventNode() which ensures eventNodes don't have a
signalled event in them before returning the node to the freeList.
Callers pass the status from epicsEventWaitWithTimeout() to indicate
whether it was signalled or not. If it timed out we must trigger it
and Wait to clear the event state.
2020-04-30 23:38:51 -05:00
Andrew Johnson cf2fef2405 osdMessageQueue: Return sooner on -ve timeout
It appears that previously a negative timeout actually implemented a
'wait forever', but the VxWorks and RTEMS implementations both check
for (timeout <= 0) and return immediately if nothing can be done
without waiting.
2020-04-30 23:27:43 -05:00
Andrew Johnson 298c8706ec osdMessageQueue: Rename freeEventNode() -> destroyEventNode() 2020-04-30 22:59:58 -05:00
Andrew Johnson 841effe9ee epicsMessageQueueTest: Shorten the 1R4S tests 2020-04-16 17:14:58 -05:00
Andrew Johnson a9727fd5cb Ben Franksen's fix for lp: #1868486 2020-04-16 17:12:25 -05:00
Andrew Johnson fde0485d6b Added Mark Rivers' tests for the message queue timeout bug 2020-04-16 17:10:53 -05:00
Andrew Johnson a95635a018 Merge Freddie's bit_operations branch into 3.15 2020-04-14 15:28:22 -05:00
Andrew Johnson 9df39475cd Merge Martin Konrad's fix-log-issues branch into 3.15 2020-04-14 11:41:23 -05:00
Andrew Johnson 38339b6ccf Initialize main thread as OkToBlock 2020-04-13 17:56:09 -05:00
Andrew Johnson b2160bd618 Merge Martin Konrad's replace-usleep branch into 3.15 2020-03-20 13:40:35 -05:00
Andrew Johnson a9034bb586 Fix clock_gettime issue on newer MinGW builds
Fixes lp: #1853168
2020-03-07 00:40:13 -06:00
Martin Konrad f9820577c1 Replace usleep call by nanosleep
Also improve behavior in case signals are delivered to the sleeping
thread. This fixes a potential security weakness reported by codacy
(interaction of usleep with SIGALRM and other timer functions such
as sleep(), alarm(), setitimer(), and nanosleep() is unspecified).
2020-03-04 11:19:02 -05:00
Michael Davidsaver e6914f3b80 osdSockUnsentCount.c check for existance of SIO_TCP_INFO 2020-02-20 15:37:18 -05:00
Freddie Akeroyd 3944b32e04 Add back in optimisation disable 2020-02-17 13:30:15 +00:00
Freddie Akeroyd a0667a122b Excluded x64 tests now need to be excluded on x86 too 2020-02-17 13:29:38 +00:00
Freddie Akeroyd 803593560d Remove redundant left logical shift 2020-02-17 12:22:20 +00:00
Freddie Akeroyd 6867f97346 Fix bit operations failures on VS2019 32bit
Working with Dirk Zimoch @dirk.zimoch, fixed various issues
with bit operations on VS2019 32bit. These seem to relate to
handling bit 31 of a 32 bit number.

As EPICS << is an arithmetic bit shift, following Java we
have added <<< and >>> operators for logical shifts

Though it is on a different architecture, this looks like
a similar issue to LP: #1838792
2020-02-14 01:16:09 +00:00
Andrew Johnson dbd6f7e807 Adding tests for epicsThreadClass API
Two tests are disabled which hang the parent in the epicsThread destuctor
2020-01-23 14:26:33 -06:00
Michael Davidsaver f64f84744e more fun with isinf() and friends.
GNU libstdc++ prior to GCC 6.1.0, the overlay math.h always
includes math.h from glibc, which defines isinf() and friends.

GCC 6.1.0 includes a change (6c8ced3f4f867b72a623fe2f23efa204c5786a28)
so that the overlay math.h never includes the glibc math.h
when compiling c++.
The overlay math.h sometimes includes "using std::isinf"
Determined by inspecting libc math.h when building gcc.
2019-12-18 20:30:23 -08:00
Andrew Johnson 475963453c Merge Martin Konrad's retire-epicsexcept branch into 3.15 2019-12-17 23:48:45 -06:00
Michael Davidsaver feb938fae2 minor epicsTimerTest
(cherry picked from commit 7acd7c6145)
2019-12-16 13:16:31 -08:00
Michael Davidsaver e068191684 epicsTimerTest loosen test threshold
(cherry picked from commit f955199805)
2019-12-16 13:16:30 -08:00
Michael Davidsaver 33f2d8c4aa debug epicsTimerTest
(cherry picked from commit 2af0c10470)
2019-12-16 13:16:29 -08:00
Michael Davidsaver 60a092fa50 posix/epicsMath.h
Include "<cmath>" for c++11 and pull in
non-namespace versions of isnan() and friends.
2019-12-16 11:40:13 -08:00
Michael Davidsaver 24f08460bb Revert "libcom: fix colliding isnan/isinf between C99 and C++0x for gcc-4"
This reverts commit 09ec3af337.
2019-12-16 11:40:13 -08:00
Michael Davidsaver 247fea0fa9 Revert "libcom: properly declare isnan() in C++ code"
This reverts commit 2e89a60c2d.
2019-12-16 11:40:13 -08:00
Michael Davidsaver b0418e5274 epicsSockResolveTest add detail 2019-12-16 11:40:13 -08:00
Ralph Lange 2e89a60c2d libcom: properly declare isnan() in C++ code 2019-12-11 14:51:16 +01:00
Ralph Lange 09ec3af337 libcom: fix colliding isnan/isinf between C99 and C++0x for gcc-4
This fix can be removed once support for gcc-4 is dropped in 2038
2019-12-06 10:52:38 +01:00
Ralph Lange 70e9d46d75 libcom: import some C99 math (isnan etc.) into global namespace 2019-12-05 16:44:59 +01:00
zimoch d2d8674cb9 use EPICS_PRIVATE_API macro and fix bug with darwin/ios 2019-11-13 14:02:25 -05:00
zimoch 6f193242e0 renamed epicsSocketCountUnsentBytes to epicsSocketUnsentCount and moved it to osi/os/ 2019-11-13 14:02:23 -05:00
zimoch 39e8ccdef4 fix bug from commit f85454. Apparently epicsExportSharedSymbols is needed even though epicsExport.h is included 2019-11-13 13:49:28 -05:00