epicsStringTest is new

This commit is contained in:
Marty Kraimer
2003-04-07 13:52:15 +00:00
parent 48e9500f1a
commit 9519c2646a
3 changed files with 69 additions and 0 deletions

View File

@@ -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

View File

@@ -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 <stddef.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#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);
}

View File

@@ -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;
}