Commit Graph

416 Commits

Author SHA1 Message Date
Till Straumann
5a06c118c8 - added unit test for epicsStackTrace 2014-08-28 10:50:03 -07:00
Andrew Johnson
2aea693faf Merged Jeff's 3.15_libcom_from_cvs_trunk branch. 2014-08-25 16:27:18 -05:00
Andrew Johnson
b7f8f17227 blockingSockTest: Undo member renames using m_ prefix
Using the m_ prefix to denote class data members is dangerous in
code that has to compile on VxWorks 5.5 (which 3.15 does) because
the net/mbuf.h header contains the following macro definitions:

#define m_next          mBlkHdr.mNext
#define m_len           mBlkHdr.mLen
#define m_data          mBlkHdr.mData
#define m_type          mBlkHdr.mType
#define m_flags         mBlkHdr.mFlags
#define m_nextpkt       mBlkHdr.mNextPkt
#define m_act           m_nextpkt
#define m_pkthdr        mBlkPktHdr
#define m_ext           pClBlk
#define m_extBuf        m_ext->clNode.pClBuf
#define m_extFreeRtn    m_ext->pClFreeRtn
#define m_extSize       m_ext->clSize
#define m_extRefCnt     m_ext->clRefCnt
#define m_extArg1       m_ext->clFreeArg1
#define m_extArg2       m_ext->clFreeArg2
#define m_extArg3       m_ext->clFreeArg3
#define  m_copy(m, o, l)        m_copym((m), (o), (l), M_DONTWAIT)
#define  m_copym(m, o, l, w)    netMblkChainDup(_pNetDpool, (m), (o), (l), (w))
#define  m_freem(m)             netMblkClChainFree(m)
#define  m_free(m)              netMblkClFree(m)    
#define m_mbufs         mNum
#define m_drops         mDrops
#define m_wait          mWait
#define m_drain         mDrain
#define m_mtypes        mTypes

While the names in the original change all appear to be safe, I
don't want us to start using this convention because we will then
have to police commits more closely or risk build failures in the
future when someone who doesn't know about or remember the issue
can't or doesn't try building their code against VxWorks 5.5.

I don't particularly like the this-> convention to mark member
names either, but until the VxWorks 5.5 support requirement goes
away the m_ convention is worse. Another common convention of
using a leading underscore is not safe either, those names are
reserved for the C/C++ implementation.
2014-08-02 14:02:43 -05:00
Andrew Johnson
6767f5089f threadPool: Replaced errno.h status values with S_pool_* ones
ETIMEDOUT is not provided on MinGW.
2014-08-01 17:55:53 -05:00
Andrew Johnson
ab78480d54 Merged spinlockfix branch.
Some last-minute fixes for VxWorks build warnings.
2014-07-31 12:45:40 -05:00
Andrew Johnson
b3afbea7cf Merged Michael's thread-pool branch.
Made various formatting changes, and fixed one problem in the
test program which failed a test on UP machines.
2014-07-29 16:05:24 -05:00
Michael Davidsaver
c4a1208d6e epicsSpinTest: add to libCom test harness 2014-07-25 18:17:27 -04:00
Michael Davidsaver
9cb65e5408 epicsSpinTest: plug some leaks 2014-07-25 18:17:02 -04:00
Andrew Johnson
2a9d05248f Fix epicsSpinTest.c spinThread tests
Runs many more rounds, without blocking with the lock held.
2014-07-25 16:21:03 -05:00
Michael Davidsaver
5824f98972 epicsSpinTest: fix verifyTryLock()
avoid sleeping with a spinlock held.
Now test only works on SMP systems.
2014-07-25 15:11:54 -04:00
Michael Davidsaver
b3a1fe9c6b thread pool: fix return of epicsJobUnqueue()
Return 0 on success (was queued, now is not),
1 if not queued initially, and EINVAL
if orphaned.
2014-07-24 18:56:27 -04:00
Andrew Johnson
9b6e270b97 Final spinlock tidying-up
* Abort epicsSpinTest() if epicsSpinCreate() returns NULL
* Adjust RELEASE_NOTES that describe the implementations.
2014-07-24 16:33:35 -05:00
Michael Davidsaver
01a50b5165 thread pool test 2014-07-24 14:22:52 -04:00
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
Jeff Hill
36d801682b oops, variable used to be unsigned; changed to signed constant 2013-11-07 14:59:30 -07:00
Jeff Hill
4d54b91a3a o fixed compile errors in, and proper diagnostic from, casPVI.cc
o suprressed some compile time warnings in bucketLib.c
o cleaned up cxx templates README
o removed use of tsMinMax from libCom in favor of the standard library 
     (calls to  tsMinMax still exist in other components in base, but they are being removed)
o removed sharable library export of certain private member functions from class fdManager
o fixed aToIPAddr to correctly lookup all of the different IP addresses string types on all OS types
    independent of the OS interfae variations
o removed use of inet_aton from vxWorks implementation of hostToIPAddr
   o this function is for converting a host name to an ip address _only_
   o the aToIPAddr wrapper is supposed to do the dotted ip ascii string to ip address structure 
   conversion independent of OS spoecific interface variations, when it works correctly
o fixed some spelling issues in comments
o added additional optimizations for processors w/o floating point ALU to addNanoSec in epicsTime
o removed tabs and junk comments from win32 osdProcess.c
o moved PLL update in win32 osdTime.c from timer to a dedicated thread
o added missing epicsExportShared symbols define to osiNTPTime.c
o fixed server ctor should not modify arguments of its caller in blockingSockTest
o removed sunpro specific ifdef nolomger needed from epicsTimeTest.cpp
2013-11-07 10:26:03 -07: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