diff --git a/src/libCom/test/Makefile b/src/libCom/test/Makefile index d5f2e14f8..3b9e20672 100644 --- a/src/libCom/test/Makefile +++ b/src/libCom/test/Makefile @@ -30,6 +30,10 @@ epicsStdioTestHost_SRCS += epicsStdioTestMain.cpp epicsStdioTest.c PROD_HOST += epicsStdioTestHost OBJS_IOC += epicsStdioTest +epicsStringTestHost_SRCS += epicsStringTestMain.cpp epicsStringTest.c +PROD_HOST += epicsStringTestHost +OBJS_IOC += epicsStringTest + epicsTimeTestHost_SRCS += epicsTimeTestMain.cpp epicsTimeTest.cpp PROD_HOST += epicsTimeTestHost OBJS_IOC += epicsTimeTest diff --git a/src/libCom/test/epicsStringTest.c b/src/libCom/test/epicsStringTest.c new file mode 100644 index 000000000..17a96851e --- /dev/null +++ b/src/libCom/test/epicsStringTest.c @@ -0,0 +1,42 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* epicsStdioTest.c + * + * Author Marty Kraimer + */ + +#include +#include +#include +#include +#include +#include + +#include "epicsString.h" + +int epicsStringTest() +{ + if(epicsStrCaseCmp("","",0)!=0) printf("case 1 failed\n"); + if(epicsStrCaseCmp("","",1)!=0) printf("case 2 failed\n"); + if(epicsStrCaseCmp(" ","",1)!=-1) printf("case 3 failed\n"); + if(epicsStrCaseCmp(""," ",1)!=1) printf("case 4 failed\n"); + if(epicsStrCaseCmp("a","A",1)!=0) printf("case 5 failed\n"); + if(epicsStrCaseCmp("a","A",2)!=0) printf("case 6 failed\n"); + if(epicsStrCaseCmp("abcd","ABCD",2)!=0) printf("case 7 failed\n"); + if(epicsStrCaseCmp("abcd","ABCD",4)!=0) printf("case 8 failed\n"); + if(epicsStrCaseCmp("abcd","ABCD",1000)!=0) printf("case 9 failed\n"); + if(epicsStrCaseCmp("abcd","ABCDE",2)!=0) printf("case 10 failed\n"); + if(epicsStrCaseCmp("abcd","ABCDE",4)!=0) printf("case 11 failed\n"); + if(epicsStrCaseCmp("abcd","ABCDE",1000)!=1) printf("case 12 failed\n"); + if(epicsStrCaseCmp("abcde","ABCD",2)!=0) printf("case 13 failed\n"); + if(epicsStrCaseCmp("abcde","ABCD",4)!=0) printf("case 14 failed\n"); + if(epicsStrCaseCmp("abcde","ABCD",1000)!=-1) printf("case 15 failed\n"); + return(0); +} diff --git a/src/libCom/test/epicsStringTestMain.cpp b/src/libCom/test/epicsStringTestMain.cpp new file mode 100644 index 000000000..e783e6c89 --- /dev/null +++ b/src/libCom/test/epicsStringTestMain.cpp @@ -0,0 +1,23 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ +/* epicsStringTestMain.cpp + * + * Author Marty Kraimer + */ + +extern "C" { +int epicsStringTest ( void ); +} + +int main ( int , char *[] ) +{ + epicsStringTest (); + return 0; +}