Fix 'error: initializer element is not constant' with debian 8's gcc
4.9.2, triggered by XUA_HDR. Create a new _XUA_HDR without the type cast,
and use it inside of const struct definitions (xua_test.c). The new
macro is needed, because removing the type cast from the original
XUA_HDR would break other uses.
Related: OS#5004
Change-Id: I890432ee976043d012b01023f7dd2cfecf79d115
osmo-msc identifies its BSC and RNC peers by SCCP address, and compares those
by memcmp(), which is not really accurate. Rather provide a meaningful
osmo_sccp_addr_cmp() API to determine whether SCCP addresses are identical.
Go for a full cmp that would also allow sorting.
Change-Id: Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5
As warned by gcc 8.1.0:
In file included from libosmo-sccp/include/osmocom/sigtran/osmo_ss7.h:7,
from libosmo-sccp/include/../src/xua_internal.h:3,
from libosmo-sccp/tests/xua/xua_test.c:21:
/include/osmocom/core/utils.h:13:34: error: division ‘sizeof (const uint8_t (*)[12] {aka const unsigned char (*)[12]}) / sizeof (const uint8_t[12] {aka const unsigned char[12]})’ does not compute the number of array elements [-Werror=sizeof-pointer-div]
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
^
libosmo-sccp/tests/xua/xua_test.c:371:45: note: in expansion of macro ‘ARRAY_SIZE’
#define PARTARR(x, data) { .tag = x, .len = ARRAY_SIZE(data), .dat = (uint8_t *) data }
Change-Id: Iad5703d68fee26fc83958741512820d2539e604e
The recent bug with chopped-off point codes in SCCP Address handling
has shown that this code could need proper test cases. This patch
adds a testsuite for SCCP address encoding and decoding.
Related: OS#2441
Change-Id: I612352736ab33462ca0dd97798a2c437eadccb86
The sanitize build fails because gt_out is not initialized to zero, but is
later mem-compared to a zero-initialized struct.
Zero-initialize gt_out.
Also print in the test output both byte dumps. It helped to figure out the test
failure and might as well stay.
Change-Id: Ice8ee9c2a6bde4924f3ae6d95aa9268ebef9f070