aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-02-15 11:27:18 +0100
committerMax <msuraev@sysmocom.de>2018-02-15 11:44:33 +0100
commitd55d7d4fc7a7b66b5c45b431ce86a9786e095333 (patch)
treeb916a08e80e23096e8f72df66f4bb87032ee2cf4
parent408a90093bd389826fe4806a31b8bc1b2425efbf (diff)
Add test for gsm48_generate_mid_from_imsi()
-rw-r--r--tests/gsm0408/gsm0408_test.c13
-rw-r--r--tests/gsm0408/gsm0408_test.ok1
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index 77a8822..ab2dee4 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 83165fa..76a7940 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