From e573c4362f007ce2a2ae1f7939c16a6fa6e1e9f0 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Wed, 25 Jul 2001 15:21:38 +0000 Subject: [PATCH] make ringPointerTestMain a .cpp file; timerTest is obsolete --- src/libCom/test/Makefile | 2 +- ...nterTestMain.c => ringPointerTestMain.cpp} | 2 + src/libCom/test/timerTest.c | 86 ------------------- src/libCom/test/timerTestMain.c | 24 ------ 4 files changed, 3 insertions(+), 111 deletions(-) rename src/libCom/test/{ringPointerTestMain.c => ringPointerTestMain.cpp} (97%) delete mode 100644 src/libCom/test/timerTest.c delete mode 100644 src/libCom/test/timerTestMain.c diff --git a/src/libCom/test/Makefile b/src/libCom/test/Makefile index 7508b2231..dd46572dd 100644 --- a/src/libCom/test/Makefile +++ b/src/libCom/test/Makefile @@ -30,7 +30,7 @@ epicsTimerTestHost_SRCS += epicsTimerTestMain.cpp epicsTimerTest.cpp PROD_HOST += epicsTimerTestHost OBJS_IOC += epicsTimerTest -ringPointerTestHost_SRCS += ringPointerTestMain.c ringPointerTest.c +ringPointerTestHost_SRCS += ringPointerTestMain.cpp ringPointerTest.c PROD_HOST += ringPointerTestHost OBJS_IOC += ringPointerTest diff --git a/src/libCom/test/ringPointerTestMain.c b/src/libCom/test/ringPointerTestMain.cpp similarity index 97% rename from src/libCom/test/ringPointerTestMain.c rename to src/libCom/test/ringPointerTestMain.cpp index 27554445b..0d374ac12 100644 --- a/src/libCom/test/ringPointerTestMain.c +++ b/src/libCom/test/ringPointerTestMain.cpp @@ -16,7 +16,9 @@ of this distribution. #include #include "epicsThread.h" +extern "C" { void ringPointerTest(void); +} int main() diff --git a/src/libCom/test/timerTest.c b/src/libCom/test/timerTest.c deleted file mode 100644 index 8d3f9f7f0..000000000 --- a/src/libCom/test/timerTest.c +++ /dev/null @@ -1,86 +0,0 @@ -/* timerTest.c */ - -/* Author: Marty Kraimer Date: 26JAN2000 */ - -/********************COPYRIGHT NOTIFICATION********************************** -This software was developed under a United States Government license -described on the COPYRIGHT_UniversityOfChicago file included as part -of this distribution. -****************************************************************************/ - -#include -#include -#include -#include -#include - -#include "epicsThread.h" -#include "osiTimer.h" -#include "errlog.h" -#include "epicsTime.h" - -static void expire(void *pPrivate); -static void destroy(void *pPrivate); -static int again(void *pPrivate); -static double delay(void *pPrivate); -static void show(void *pPrivate, unsigned level); -static osiTimerJumpTable jumpTable = { expire,destroy,again,delay,show}; -static osiTimerQueueId timerQueue; - -typedef struct myPvt { - osiTimerId timer; - double requestedDiff; - epicsTimeStamp start; -}myPvt; - - -#define ntimers 3 - -void timerTest(void) -{ - myPvt *timer[ntimers]; - epicsTimeStamp start; - int i; - - timerQueue = osiTimerQueueCreate(epicsThreadPriorityLow); - for(i=0; itimer = osiTimerCreate(&jumpTable,timerQueue,(void *)timer[i]); - epicsTimeGetCurrent(&start); - timer[i]->start = start; - timer[i]->requestedDiff = (double)i; - osiTimerArm(timer[i]->timer,(double)i); - } - epicsThreadSleep((double)(ntimers + 2)); - printf("timerTest returning\n"); -} - -void expire(void *pPrivate) -{ - myPvt *pmyPvt = (myPvt *)pPrivate; - epicsTimeStamp end; - double diff; - - epicsTimeGetCurrent(&end); - diff = epicsTimeDiffInSeconds(&end,&pmyPvt->start); - printf("myCallback requestedDiff %f diff %f\n",pmyPvt->requestedDiff,diff); -} - -void destroy(void *pPrivate) -{ - return; -} - -int again(void *pPrivate) -{ - return(0); -} - -double delay(void *pPrivate) -{ - return(0.0); -} -void show(void *pPrivate, unsigned level) -{ - return; -} diff --git a/src/libCom/test/timerTestMain.c b/src/libCom/test/timerTestMain.c deleted file mode 100644 index cb8bd1162..000000000 --- a/src/libCom/test/timerTestMain.c +++ /dev/null @@ -1,24 +0,0 @@ -/* timerTestMain.c */ -/* Author: Marty Kraimer Date: 26JAN2000 */ - -/********************COPYRIGHT NOTIFICATION********************************** -This software was developed under a United States Government license -described on the COPYRIGHT_UniversityOfChicago file included as part -of this distribution. -****************************************************************************/ - -#include -#include -#include -#include -#include - - -void timerTest(void); - -int main(int argc,char *argv[]) -{ - timerTest(); - printf("main terminating\n"); - return(0); -}