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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user