From d55d7d4fc7a7b66b5c45b431ce86a9786e095333 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 15 Feb 2018 11:27:18 +0100 Subject: Add test for gsm48_generate_mid_from_imsi() Change-Id: Ibe5c0831268c788ceecd10fd7b22ece6480da817 --- tests/gsm0408/gsm0408_test.c | 13 +++++++++++++ tests/gsm0408/gsm0408_test.ok | 1 + 2 files changed, 14 insertions(+) (limited to 'tests/gsm0408') diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 77a88224..ab2dee4c 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -194,10 +194,23 @@ static void test_mid_from_tmsi(void) printf("passed\n"); } +static void test_mid_from_imsi(void) +{ + char *imsi = "901700000004620"; + uint8_t buf[10], len; + + printf("Simple IMSI encoding test...."); + + len = gsm48_generate_mid_from_imsi(buf, imsi); + + printf("passed: [%u] %s\n", len, osmo_hexdump(buf, len)); +} + int main(int argc, char **argv) { test_bearer_cap(); test_mid_from_tmsi(); + test_mid_from_imsi(); test_ra_cap(); return EXIT_SUCCESS; diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 83165fac..76a79403 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -1,6 +1,7 @@ Test `CSD 9600/V.110/transparent' passed Test `Speech, all codecs' passed Simple TMSI encoding test....passed +Simple IMSI encoding test....passed: [10] 17 08 99 10 07 00 00 00 64 02 Constructed RA: RA: MNC=121, MCC=77, LAC=666, RAC=5 RA: MNC=121, MCC=77, LAC=666, RAC=5 -- cgit v1.2.3