epicsTypes: Added epicsInt64 and epicsUInt64

With size checks for them in epicsTypesTest.
Also added static checks of type sizes there, since we can.
This commit is contained in:
Andrew Johnson
2012-06-08 16:28:31 -05:00
parent 24e2452bd4
commit c708bb1bac
2 changed files with 116 additions and 94 deletions

View File

@@ -13,10 +13,26 @@
#include "epicsUnitTest.h"
#include "epicsTypes.h"
#include "testMain.h"
#include "epicsAssert.h"
/*
* Might as well check at compile-time too, since we can.
*/
STATIC_ASSERT(sizeof(epicsInt8) == 1);
STATIC_ASSERT(sizeof(epicsUInt8) == 1);
STATIC_ASSERT(sizeof(epicsInt16) == 2);
STATIC_ASSERT(sizeof(epicsUInt16) == 2);
STATIC_ASSERT(sizeof(epicsInt32) == 4);
STATIC_ASSERT(sizeof(epicsUInt32) == 4);
STATIC_ASSERT(sizeof(epicsInt64) == 8);
STATIC_ASSERT(sizeof(epicsUInt64) == 8);
STATIC_ASSERT(sizeof(epicsFloat32) == 4);
STATIC_ASSERT(sizeof(epicsFloat64) == 8);
MAIN(epicsTypesTest)
{
testPlan(8);
testPlan(10);
testOk1(sizeof(epicsInt8) == 1);
testOk1(sizeof(epicsUInt8) == 1);
@@ -27,6 +43,9 @@ MAIN(epicsTypesTest)
testOk1(sizeof(epicsInt32) == 4);
testOk1(sizeof(epicsUInt32) == 4);
testOk1(sizeof(epicsInt64) == 8);
testOk1(sizeof(epicsUInt64) == 8);
testOk1(sizeof(epicsFloat32) == 4);
testOk1(sizeof(epicsFloat64) == 8);