mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-12 20:47:06 +00:00
[Core, mod_sofia] Add switch_uint31_t type. Fix CSeq bigger than 2^31-1.
This commit is contained in:
1 parent
da93927c01
commit
5b1c2688da
4 files changed
+34
-11
No files matched your search
@@ -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