From 629828f7a3cdde7f49623f9b95a7464a75121291 Mon Sep 17 00:00:00 2001 From: borutr Date: Thu, 7 Jun 2007 20:33:22 +0000 Subject: [PATCH] * support/regression/tests/constantRange.c, support/regression/tests/scott-compare3.c: fixed failing regression tests, uncovered by implementation of more flexible rule for detection of testing functions git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4839 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 ++++ support/regression/tests/constantRange.c | 16 ++++++++++++---- support/regression/tests/scott-compare3.c | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ddf1610..f9fb2401 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,10 @@ * support/regression/generate-cases.py: implemented more flexible rule for detection of testing functions, allowing white-spaces surrounding the function name and the 'void' parameter. + * support/regression/tests/constantRange.c, + support/regression/tests/scott-compare3.c: fixed failing regression + tests, uncovered by implementation of more flexible rule for detection + of testing functions 2007-06-04 Maarten Brock diff --git a/support/regression/tests/constantRange.c b/support/regression/tests/constantRange.c index a4000ace..1dfc10cf 100644 --- a/support/regression/tests/constantRange.c +++ b/support/regression/tests/constantRange.c @@ -73,15 +73,23 @@ testConstantRange (void) ASSERT (! (UINT16_MAX + 1L == u16)); ASSERT ( ( 0 - 1 != u16)); ASSERT ( (UINT16_MAX + 1L != u16)); - ASSERT ( ( 0 - 1 < u16)); ASSERT (! (UINT16_MAX < u16)); ASSERT ( ( 0 <= u16)); ASSERT (! (UINT16_MAX + 1L <= u16)); ASSERT (! ( 0 > u16)); ASSERT ( (UINT16_MAX + 1L > u16)); - ASSERT (! ( 0 - 1 >= u16)); ASSERT ( (UINT16_MAX >= u16)); +#if defined(PORT_HOST) +/* on 32bit host: -1 is presented as 32 bit int, 16 bit unsigned short is promoted to 32 bit int */ + ASSERT ( ( 0 - 1 < u16)); /* -1 > 0 */ + ASSERT (! ( 0 - 1 >= u16)); /* !(-1 <= 0) */ +#else +/* on 16bit sdcc: int (-1) is promoted to unsigned int (0xffff) */ + ASSERT ( ( 0 - 1 > u16)); /* 0xffff > 0 */ + ASSERT (! ( 0 - 1 <= u16)); /* !(0xffff <= 0) */ +#endif + /* sdcc can't hold a number (INT32_MIN - 1) or (INT32_MAX + 1), there's no 'double' or 'long long' */ /* ASSERT (! (INT32_MIN - 1 == s32)); */ @@ -101,13 +109,13 @@ testConstantRange (void) /* ASSERT (! (UINT32_MAX + 1 == u32)); */ ASSERT ( ( 0 - 1 != u32)); /* ASSERT ( (UINT32_MAX + 1 != u32)); */ - ASSERT ( ( 0 - 1 < u32)); + ASSERT ( ( 0 - 1 > u32)); /* 0xffffffff > 0 */ ASSERT (! (UINT32_MAX < u32)); ASSERT ( ( 0 <= u32)); /* ASSERT (! (UINT32_MAX + 1 <= u32)); */ ASSERT (! ( 0 > u32)); /* ASSERT ( (UINT32_MAX + 1 > u32)); */ - ASSERT (! ( 0 - 1 >= u32)); + ASSERT (! ( 0 - 1 <= u32)); /* !(0xffffffff <= 0) */ ASSERT ( (UINT32_MAX >= u32)); } diff --git a/support/regression/tests/scott-compare3.c b/support/regression/tests/scott-compare3.c index 31b22b70..9bdd8ba9 100644 --- a/support/regression/tests/scott-compare3.c +++ b/support/regression/tests/scott-compare3.c @@ -142,7 +142,7 @@ void c_abcd(void) ASSERT(!(aint0 == 0x00cd)); - ASSERT(!(aint0 == (unsigned int)0x1234abcdU)); + ASSERT(aint0 == (unsigned short int)0x1234abcdU); } -- 2.30.2