mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Remove integer-overflow unit tests
There's not much point checking undefined behavior.
This commit is contained in:
parent
31c491504e
commit
e5302ac716
@ -726,46 +726,48 @@ test_evutil_integers(void *arg)
|
||||
tt_assert(u64 > 0);
|
||||
tt_assert(i64 > 0);
|
||||
u64++;
|
||||
i64++;
|
||||
/* i64++; */
|
||||
tt_assert(u64 == 0);
|
||||
tt_assert(i64 == EV_INT64_MIN);
|
||||
tt_assert(i64 < 0);
|
||||
/* tt_assert(i64 == EV_INT64_MIN); */
|
||||
/* tt_assert(i64 < 0); */
|
||||
|
||||
u32 = EV_UINT32_MAX;
|
||||
i32 = EV_INT32_MAX;
|
||||
tt_assert(u32 > 0);
|
||||
tt_assert(i32 > 0);
|
||||
u32++;
|
||||
i32++;
|
||||
/* i32++; */
|
||||
tt_assert(u32 == 0);
|
||||
tt_assert(i32 == EV_INT32_MIN);
|
||||
tt_assert(i32 < 0);
|
||||
/* tt_assert(i32 == EV_INT32_MIN); */
|
||||
/* tt_assert(i32 < 0); */
|
||||
|
||||
u16 = EV_UINT16_MAX;
|
||||
i16 = EV_INT16_MAX;
|
||||
tt_assert(u16 > 0);
|
||||
tt_assert(i16 > 0);
|
||||
u16++;
|
||||
i16++;
|
||||
/* i16++; */
|
||||
tt_assert(u16 == 0);
|
||||
tt_assert(i16 == EV_INT16_MIN);
|
||||
tt_assert(i16 < 0);
|
||||
/* tt_assert(i16 == EV_INT16_MIN); */
|
||||
/* tt_assert(i16 < 0); */
|
||||
|
||||
u8 = EV_UINT8_MAX;
|
||||
i8 = EV_INT8_MAX;
|
||||
tt_assert(u8 > 0);
|
||||
tt_assert(i8 > 0);
|
||||
u8++;
|
||||
i8++;
|
||||
/* i8++;*/
|
||||
tt_assert(u8 == 0);
|
||||
tt_assert(i8 == EV_INT8_MIN);
|
||||
tt_assert(i8 < 0);
|
||||
/* tt_assert(i8 == EV_INT8_MIN); */
|
||||
/* tt_assert(i8 < 0); */
|
||||
|
||||
/*
|
||||
ssize = EV_SSIZE_MAX;
|
||||
tt_assert(ssize > 0);
|
||||
ssize++;
|
||||
tt_assert(ssize < 0);
|
||||
tt_assert(ssize == EV_SSIZE_MIN);
|
||||
*/
|
||||
|
||||
ptr = &ssize;
|
||||
iptr = (ev_intptr_t)ptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user