From 73ae7a9ca0b9f2bbf4a6800ed8e9aa9bbd99d597 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 8 Oct 2013 12:04:42 +0200 Subject: tests: Fix warnings This fixes warnings that are raised by missing includes, missing casts, missing return statements, using printf %lu with uint64_t, and unused symbols. --- tests/auth/milenage_test.c | 4 +++- tests/conv/conv_test.c | 2 ++ tests/sms/sms_test.c | 4 +--- tests/smscb/smscb_test.c | 1 + tests/timer/timer_test.c | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/auth/milenage_test.c b/tests/auth/milenage_test.c index 7c996f02..0223764a 100644 --- a/tests/auth/milenage_test.c +++ b/tests/auth/milenage_test.c @@ -7,6 +7,8 @@ #include #include +int milenage_opc_gen(uint8_t *opc, const uint8_t *k, const uint8_t *op); + static void dump_auth_vec(struct osmo_auth_vector *vec) { printf("RAND:\t%s\n", osmo_hexdump(vec->rand, sizeof(vec->rand))); @@ -88,7 +90,7 @@ int main(int argc, char **argv) if (rc < 0) { printf("AUTS failed\n"); } else { - printf("AUTS success: SEQ.MS = %lu\n", test_aud.u.umts.sqn); + printf("AUTS success: SEQ.MS = %llu\n", (unsigned long long)test_aud.u.umts.sqn); } opc_test(&test_aud); diff --git a/tests/conv/conv_test.c b/tests/conv/conv_test.c index ab651d43..d9440f95 100644 --- a/tests/conv/conv_test.c +++ b/tests/conv/conv_test.c @@ -347,6 +347,8 @@ ubit_to_sbit(sbit_t *dst, ubit_t *src, int n) dst[i] = src[i] ? -127 : 127; } +static void sbit_to_ubit(ubit_t *dst, sbit_t *src, int n) __attribute__((unused)); + static void sbit_to_ubit(ubit_t *dst, sbit_t *src, int n) { diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.c index 8e10241a..2c9d8d8b 100644 --- a/tests/sms/sms_test.c +++ b/tests/sms/sms_test.c @@ -266,18 +266,15 @@ static void test_gen_oa(void) int main(int argc, char** argv) { printf("SMS testing\n"); - struct msgb *msg; uint8_t i; uint16_t buffer_size; uint8_t octet_length; int octets_written; uint8_t computed_octet_length; uint8_t septet_length; - uint8_t gsm_septet_length; uint8_t coded[256]; uint8_t tmp[160]; uint8_t septet_data[256]; - uint8_t ud_header[6]; int nchars; char result[256]; @@ -320,6 +317,7 @@ int main(int argc, char** argv) /* Test: encode multiple SMS */ int number_of_septets = gsm_septet_encode(septet_data, (const char *) test_multiple_encode[0].input); + (void) number_of_septets; /* SMS part 1 */ memset(tmp, 0x42, sizeof(tmp)); diff --git a/tests/smscb/smscb_test.c b/tests/smscb/smscb_test.c index e10e12d8..5925f69b 100644 --- a/tests/smscb/smscb_test.c +++ b/tests/smscb/smscb_test.c @@ -21,6 +21,7 @@ #include #include +#include static uint8_t smscb_msg[] = { 0x40, 0x10, 0x05, 0x0d, 0x01, 0x11 }; diff --git a/tests/timer/timer_test.c b/tests/timer/timer_test.c index bb9a177c..6184f667 100644 --- a/tests/timer/timer_test.c +++ b/tests/timer/timer_test.c @@ -115,7 +115,7 @@ static void secondary_timer_fired(void *data) timersub(¤t, &v->stop, &res); if (timercmp(&res, &precision, >)) { fprintf(stderr, "ERROR: timer %p has expired too late!\n", - v->timer); + &v->timer); too_late++; } -- cgit v1.2.3