Commit Graph

17 Commits

Author SHA1 Message Date
Andrew Johnson
30b789aa49 Fix epicsStrnEscapedFromRaw() and epicsStrnRawFromEscaped()
Major rewrites; the original epicsStrnRawFromEscaped() could read
beyond the end of the input buffer if the input count ended in the
middle of an octal or hex escape sequence. Zero termination did not
always match the return count, and hex escapes were always 2 digits,
contrary to the C standard.

New versions don't use epicsSnprintf() or sscanf() for hex and octal
conversions, so should be slightly faster.

Added 81 new tests to check the above issues.
2014-12-01 11:34:58 -06:00
Andrew Johnson
6f7fc7bf8e Merged changes from 3.14 branch
Up to revno 12504.
2014-11-07 15:57:13 -06:00
Andrew Johnson
53d9a07f64 Fix buffer overflow in epicsStrnRawFromEscaped
lp:1388313
2014-11-05 10:06:02 -06: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
unknown
b93601bc22 libCom/test: epicsStrGlobMatch() tests 2013-12-17 16:37:46 -06:00
Andrew Johnson
fbda9f3280 RCS keyword updates for Bazaar
Replaced $Id$ and $Header$ keywords with $Revision-Id$
Deleted $Log$ keywords and any log messages
2010-10-05 14:27:37 -05:00
Andrew Johnson
48aabfc6ad libCom/test/epicsStringTest: %Zd isn't portable. 2010-09-29 17:44:10 -05:00
Andrew Johnson
d545a8f04f Added test code, fixed bug found in epicsStrnEscapedFromRawSize(). 2009-04-10 19:58:34 +00:00
Ralph Lange
7fccc59fe9 ANSIfication of stuff (mostly missing argument types in declarations) 2009-04-03 17:46:26 +00:00
Andrew Johnson
48337e2382 Fixed gcc '0 flag' warnings. 2006-11-28 17:04:18 +00:00
Andrew Johnson
ad1f8f9925 Added round-trip testing of char escapes. 2006-11-15 20:14:46 +00:00
Andrew Johnson
6c19051727 Major reorganization:
Removed all Main.cpp files, use the macro in testMain.h instead and
defaulted all argc/argv parameters.
Converted all real test programs to use epicsUnitTest.h.
Moved performance measurements from epicsThreadTest to epicsThreadPerform.
Moved epicsOkToBlockTest tests into epicsThreadTest.
On a host arch,  make test  inside the O.arch directory runs all tests.
2006-11-09 22:38:41 +00:00
Andrew Johnson
4d67f3596a Converted some of the test routines to use the new epicsUnitTest facility. 2006-03-30 20:13:25 +00:00
Ralph Lange
de9767dc34 += "done" - message (all tests should print something). 2004-10-26 10:20:35 +00:00
W. Eric Norum
4dc47cc3c7 Add epicsStrnCaseCmp(). 2004-01-13 23:07:11 +00:00
Marty Kraimer
9519c2646a epicsStringTest is new 2003-04-07 13:52:15 +00:00