提交 812a71e9 编写于 作者: G greg-williams

Modified typedefs in order to avoid collisions

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@41 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
上级 cb1212f9
......@@ -13,20 +13,20 @@
#if defined(BUS_WIDTH) && (BUS_WIDTH != 32)
#if (BUS_WIDTH == 16)
typedef unsigned char U8;
typedef unsigned int U16;
typedef unsigned long U32;
typedef signed char S8;
typedef signed int S16;
typedef signed long S32;
typedef unsigned char _UU8;
typedef unsigned int _UU16;
typedef unsigned long _UU32;
typedef signed char _US8;
typedef signed int _US16;
typedef signed long _US32;
#endif
#else
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned int U32;
typedef signed char S8;
typedef signed short S16;
typedef signed int S32;
typedef unsigned char _UU8;
typedef unsigned short _UU16;
typedef unsigned int _UU32;
typedef signed char _US8;
typedef signed short _US16;
typedef signed int _US32;
#endif
......@@ -283,13 +283,13 @@ void UnityIgnore(const char* message, const long line);
#define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) \
Unity.TestFile=__FILE__; \
UnityAssertBits(((U32)1 << bit), (-1), (actual), (message), (unsigned short)__LINE__); \
UnityAssertBits(((_UU32)1 << bit), (-1), (actual), (message), (unsigned short)__LINE__); \
ABORT_IF_NECESSARY();
#define TEST_ASSERT_BIT_HIGH(bit, actual) TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, NULL)
#define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) \
Unity.TestFile=__FILE__; \
UnityAssertBits(((U32)1 << bit), (0), (actual), (message), (unsigned short)__LINE__); \
UnityAssertBits(((_UU32)1 << bit), (0), (actual), (message), (unsigned short)__LINE__); \
ABORT_IF_NECESSARY();
#define TEST_ASSERT_BIT_LOW(bit, actual) TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, NULL)
......
......@@ -181,7 +181,7 @@ void testNotEqualBits(void)
void testNotEqualUInts(void)
{
int failed;
U16 v0, v1;
_UU16 v0, v1;
v0 = 9000;
v1 = 9001;
......@@ -199,7 +199,7 @@ void testNotEqualUInts(void)
void testNotEqualHex8s(void)
{
int failed;
U8 v0, v1;
_UU8 v0, v1;
v0 = 0x23;
v1 = 0x22;
......@@ -217,7 +217,7 @@ void testNotEqualHex8s(void)
void testNotEqualHex16s(void)
{
int failed;
U16 v0, v1;
_UU16 v0, v1;
v0 = 0x1234;
v1 = 0x1235;
......@@ -235,7 +235,7 @@ void testNotEqualHex16s(void)
void testNotEqualHex32s(void)
{
int failed;
U32 v0, v1;
_UU32 v0, v1;
v0 = 900000;
v1 = 900001;
......@@ -292,8 +292,8 @@ void testEqualUints(void)
void testEqualHex8s(void)
{
U8 v0, v1;
U8 *p0, *p1;
_UU8 v0, v1;
_UU8 *p0, *p1;
v0 = 0x22;
v1 = 0x22;
......@@ -311,8 +311,8 @@ void testEqualHex8s(void)
void testEqualHex16s(void)
{
U16 v0, v1;
U16 *p0, *p1;
_UU16 v0, v1;
_UU16 *p0, *p1;
v0 = 0x9876;
v1 = 0x9876;
......@@ -330,8 +330,8 @@ void testEqualHex16s(void)
void testEqualHex32s(void)
{
U32 v0, v1;
U32 *p0, *p1;
_UU32 v0, v1;
_UU32 *p0, *p1;
v0 = 0x98765432ul;
v1 = 0x98765432ul;
......@@ -349,8 +349,8 @@ void testEqualHex32s(void)
void testEqualBits(void)
{
U32 v0 = 0xFF55AA00;
U32 v1 = 0x55550000;
_UU32 v0 = 0xFF55AA00;
_UU32 v1 = 0x55550000;
TEST_ASSERT_BITS(v1, v0, 0x55550000);
TEST_ASSERT_BITS(v1, v0, 0xFF55CC00);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册