mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-01-25 02:07:54 +00:00
[Core, mod_sofia] Add switch_uint31_t type. Fix CSeq bigger than 2^31-1.
This commit is contained in:
@@ -53,6 +53,26 @@ FST_CORE_BEGIN("./conf")
|
||||
}
|
||||
FST_TEARDOWN_END()
|
||||
|
||||
FST_TEST_BEGIN(test_switch_uint31_t_overflow)
|
||||
{
|
||||
switch_uint31_t x;
|
||||
uint32_t overflow;
|
||||
|
||||
x.value = 0x7fffffff;
|
||||
x.value++;
|
||||
|
||||
fst_check_int_equals(x.value, 0);
|
||||
x.value++;
|
||||
fst_check_int_equals(x.value, 1);
|
||||
x.value -= 2;
|
||||
fst_check_int_equals(x.value, 0x7fffffff);
|
||||
|
||||
overflow = (uint32_t)0x7fffffff + 1;
|
||||
x.value = overflow;
|
||||
fst_check_int_equals(x.value, 0);
|
||||
}
|
||||
FST_TEST_END()
|
||||
|
||||
FST_TEST_BEGIN(test_switch_parse_cidr_v6)
|
||||
{
|
||||
ip_t ip, mask;
|
||||
|
||||
Reference in New Issue
Block a user