Commit Graph

401 Commits

Author SHA1 Message Date
Andrew Johnson
60a0c7f181 Make epicsExit subsystem reusable.
Calling epicsAtExit() after epicsExitCallAtExits() now
recreates the per-process list and registers the routine.
2014-06-23 16:28:25 -04:00
Andrew Johnson
9e1ebf8d0f Clean up build warnings from Darwin (clang). 2014-05-30 12:36:50 -05:00
Andrew Johnson
7dd5e217f6 Merged Ralph's get-cpus branch. 2014-05-19 09:44:05 -05:00
Ralph Lange
722d5eeba7 libCom/osi: use epicsThreadGetCPUs implementation from thread-pool branch (posix, WIN32) 2014-05-18 17:24:38 +02:00
Andrew Johnson
4b18edc586 Merged changes from 3.14 branch.
Up to revno 12479.
2014-03-13 15:04:31 -05:00
Andrew Johnson
f5b9db9583 libCom: Fix epicsString.h comparison functions
The string comparison functions epicsStrCaseCmp() and
epicsStrnCaseCmp() were returning incorrect results
when the strings did not match.

These functions now match their BSD equivalents, and
have working tests to confirm their operation.
2014-03-11 17:12:41 -05:00
Andrew Johnson
5bdd9ddca6 Windows: Fix static builds on MinGW
Xiaoqiang Wang proposed some fixes that allow static builds on
the MinGW targets to succeed. Some additional changes made to
blockingSockTest.cpp also clean that up.
2014-02-25 15:56:13 -06:00
Andrew Johnson
3fd8d4515c libCom/test: Finish converting blockingSockTest to epicsUnitTest
Don't call assert() from a test program,
it stops the tests from running if the assert fails.
2014-02-20 16:36:58 -06:00
Andrew Johnson
b32127c5de libCom: Fix epicsTime::strftime() roll-over bug
Fractional seconds could round-up to .000 without
incrementing the integer seconds.
We can't actually do the latter, so we prevent the
roll-over and clamp at all 9's instead.
Idea from Eric Norum.
2014-01-29 16:52:22 -06:00
Andrew Johnson
dbb8d232ee libCom/test: Losen the timer error threshold.
Windows was consistently failing the fastest timer tests.
2013-12-17 17:13:27 -06:00
unknown
b93601bc22 libCom/test: epicsStrGlobMatch() tests 2013-12-17 16:37:46 -06:00
Andrew Johnson
0a2020e2fc Merged changes from 3.14 branch
Up to 3.14.12.4 release.
2013-12-17 12:54:04 -06:00
Andrew Johnson
a50c66b6ff libCom/test: Added epicsEnvTest.c
VxWorks 6.x can make environment variables private to each
thread, which doesn't work too well.
A test failure on VxWorks explains how to change the image
configuration to fix this.
2013-12-16 12:48:25 -06:00
Andrew Johnson
72d65c60a4 epicsErrlogTest: Shorten output lines
Shorten test output from long messages.
2013-09-20 13:44:28 -05:00
Janet Anderson
d3b6d01807 Added WIN32 system library for epicsSockResolveTest 2013-07-17 15:55:49 -05:00
Andrew Johnson
c96db4c877 libCom: Replaced errlogRemoveListener()
New version errlogRemoveListeners() is safer.
2013-06-28 12:35:43 -05:00
Andrew Johnson
2be5e15346 Merged changes from 3.14 branch
Up to revno 12420 inclusive.
2013-06-07 18:08:38 -05:00
Andrew Johnson
ef5d88d3e5 libCom: Back-ported aToIPAddr fix from 3.15 branch.
Cherry-picked 3.15 revno 12398 with some changes.
2013-06-07 17:03:55 -05:00
Andrew Johnson
863e8fdd3b libCom: Fix VxWorks localtime_r() and gmtime_r() wrappers
Wind River changed the return value between VxWorks 6.8 and 6.9.
2013-06-07 14:35:45 -05:00
Andrew Johnson
7addfc8ddd libCom/test: Make epicsUnitTestTest.plt more Perlish
Use Perl's __DATA__ stream for the expected data string.
2013-05-24 15:33:56 -05:00
Andrew Johnson
3196844602 Remove another Borland on Linux remnant. 2013-02-14 15:56:22 -06:00
Andrew Johnson
d85d1f0e56 Merged Ralph's spinlocks branch.
Added an RTEMS implementation which locks interrupts,
and some Release Notes mentioning the new API.
2013-02-12 12:13:01 -06:00
Andrew Johnson
d63dffcd34 libCom/test: epicsSockResolveTest build fix
Add socket libraries for Win32 & Solaris.
2013-01-04 12:22:02 -06:00
Michael Davidsaver
f5b7693a58 libCom: aToIPAddr() finds numeric hostnames
Hostnames that begin with one or more digits were not being looked up
by name, causing problems at BNL.
This commit also changes the vxWorks implementation of hostToIPAddr()
to use inet_aton() instead of inet_addr().
2013-01-04 09:33:13 -06:00
Andrew Johnson
3fb529373f Clear RTEMS build warning
shutdown is also a system identifier.
2013-01-03 15:27:23 -06:00
Andrew Johnson
af2693241f Merged changes from 3.14 branch
Up to revno 12398, i.e. the R3.14.12.3 release.
2012-12-18 15:44:35 -06:00
Michael Davidsaver
79bc3f2265 Make blockingSockTest use a free port number
Instead of using the CA server port 5064 which is often
in use, have the listening socket pick a free port.
2012-12-06 14:31:50 -06:00
Andrew Johnson
ef5688f8de libCom: Accept hex literals in CALC expressions
Code back-ported from the 3.15 branch.
2012-12-03 12:58:26 -06:00
Andrew Johnson
d622bbad05 Fix compiler warnings on linux-x86 2012-12-03 12:48:11 -06:00
Andrew Johnson
7778c0c3ff Solaris & vxWorks 5.5.x fixes
Remove C++-isms.
Make internal routines static when duplicate names appear
in the epicsMutexTest.cpp code; on vxWorks and RTEMS all
test programs get linked into a single binary.
2012-11-20 15:55:53 -06:00
Ralph Lange
3f18327d2d libCom/osi: add tests for epicsSpin (based on epicsMutex tests) 2012-10-29 20:26:11 +01:00
Andrew Johnson
c23b907eee Reduce the duration of epicsMessageQueueTest to 60 seconds. 2012-07-24 11:29:31 -05:00
Andrew Johnson
c6aab2390c More fixes for Cygwin builds. 2012-07-20 17:50:59 -05:00
Andrew Johnson
64c9d7a32a Many tweaks to build on Windows.
There might be some more to come since I'm not committing
this from my Win32 system.
2012-07-17 14:33:31 -05:00
Andrew Johnson
62727dcba6 Clean up warnings from gcc 4.6.3 2012-07-07 15:54:31 -05:00
Andrew Johnson
3bfc6dcf64 errlog in tests
Take eltc(0) out of testPlan() and explicitly add it to those tests
that should suppress expected errlog output.
2012-07-06 17:47:56 -05:00
Andrew Johnson
0597f9c1c8 libCom: Fixed issues with thread-hooks. 2012-07-06 16:33:10 -05:00
Andrew Johnson
004826e67a Clean up some warnings. 2012-07-06 14:26:20 -05:00
Andrew Johnson
dda5e60250 libCom/test: Rename test harness as "libComTestHarness" 2012-07-06 14:23:03 -05:00
Andrew Johnson
a942295ead libCom/calc: Support 0x literals as epicsUInt32
Also use epicsInt32 for all integer calculations.
2012-07-06 14:17:51 -05:00
Andrew Johnson
f9bb1ef542 Fix vxWorks build issues from thread-hooks merge. 2012-07-05 13:39:00 -05:00
Andrew Johnson
a857f7a5ed Merged Ralph's thread-hooks branch.
Minor modifications to fix the vxWorks epicsThreadInit() and
rename some functions.
2012-07-04 13:28:55 -05:00
Ralph Lange
7b47cad8e4 libCom/osi: Clean up epicsThreadHooks API
- remove exit hooks completely
- remove non-public functions fom header files
- add test for epicsThreadMap
- fix bugs in RTEMS and vxWorks implementation of epicsThreadMap
2012-07-03 14:38:12 +02:00
Ralph Lange
da91893ec2 libCom/test: Add test for epicsThreadHooks 2012-07-02 18:18:54 +02:00
Andrew Johnson
da9982f875 libCom: Fix unsigned overflow limits in epicsParse*
The strtoul() routine accepts negative numbers.  This fix
ensures we handle them properly, and adds suitable tests.

Also fix the test for 1e300, in case the compiler gives a
slightly different literal constant than strtod() returns.
2012-06-30 15:34:29 -05:00
Andrew Johnson
fb61234431 Change the epicsParse APIs to return a units pointer.
This lets us use epicsParseDouble() for scan rate parsing.

Ensure the scanOnce thread is a higher priority than the fastest
periodic scan thread, irrespective of how many threads there are.
2012-06-29 14:41:35 -05:00
Andrew Johnson
6595ff9518 Clean up some compiler warnings from gcc 4.6 2012-06-26 00:19:10 -05:00
Andrew Johnson
269fb01c63 libCom: Add routines for parsing strings into epicsTypes
Adds new routines for converting numeric strings into the
standard epicsInt8, epicsUInt8, epicsInt16, epicsUInt16,
epicsInt32 and epicsUInt32 types, along with Long, ULong,
Double and Float.  These all provide error checking and
detection of extraneous characters.  The epicsScanDouble
and epicsScanFloat routines originally in epicsStdlib.h
are replaced by macros that call the epicsParse routine,
and this also provides epicsScanLong and epicsScanULong
to match.

A test file is added to ensure conversions work properly
and report appropriate errors.  This file also checks the
native strtod() routine if not used to check whether the
epicsStrtod() code is required on this platform.
2012-06-22 14:06:52 -05:00
Andrew Johnson
c708bb1bac epicsTypes: Added epicsInt64 and epicsUInt64
With size checks for them in epicsTypesTest.
Also added static checks of type sizes there, since we can.
2012-06-08 16:28:31 -05:00
Andrew Johnson
24e2452bd4 libCom/test: epicsAtomic tests
Added C++ template instances, so this code loads on
a vxWorks 5.5.2 system.
2012-06-07 13:38:11 -05:00