libCom/test: Added epicsTypesTest, checks type sizes.

This commit is contained in:
Andrew Johnson
2011-10-28 15:19:54 -05:00
parent b3ec73edcf
commit 0b92d61a14
3 changed files with 42 additions and 0 deletions

View File

@@ -17,6 +17,11 @@ epicsUnitTestTest_SRCS += epicsUnitTestTest.c
# Not much point running this on vxWorks or RTEMS...
TESTS += epicsUnitTestTest
TESTPROD_HOST += epicsTypesTest
epicsTypesTest_SRCS += epicsTypesTest.cpp
testHarness_SRCS += epicsTypesTest.cpp
TESTS += epicsTypesTest
TESTPROD_HOST += epicsCalcTest
epicsCalcTest_SRCS += epicsCalcTest.cpp
testHarness_SRCS += epicsCalcTest.cpp

View File

@@ -33,6 +33,7 @@ int epicsThreadOnceTest(void);
int epicsThreadPriorityTest(void);
int epicsThreadPrivateTest(void);
int epicsTimeTest(void);
int epicsTypesTest(void);
int macLibTest(void);
int macEnvExpandTest(void);
int ringPointerTest(void);
@@ -85,6 +86,8 @@ void epicsRunLibComTests(void)
runTest(epicsTimeTest);
runTest(epicsTypesTest);
runTest(macLibTest);
runTest(macEnvExpandTest);

View File

@@ -0,0 +1,34 @@
/*************************************************************************\
* Copyright (c) 2011 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* epicsTypesTest.c
*
* Size-check epicsTypes
*
*/
#include "epicsUnitTest.h"
#include "epicsTypes.h"
#include "testMain.h"
MAIN(epicsTypesTest)
{
testPlan(8);
testOk1(sizeof(epicsInt8) == 1);
testOk1(sizeof(epicsUInt8) == 1);
testOk1(sizeof(epicsInt16) == 2);
testOk1(sizeof(epicsUInt16) == 2);
testOk1(sizeof(epicsInt32) == 4);
testOk1(sizeof(epicsUInt32) == 4);
testOk1(sizeof(epicsFloat32) == 4);
testOk1(sizeof(epicsFloat64) == 8);
return testDone();
}