aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-02-20 15:11:25 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-02-20 22:05:50 +0100
commit22da145e4cbfee53039562b318516b3d8d1a49d0 (patch)
treea79a06e50b59681283e786c55528d8b38179920e
parentf4cd228f1e238fbc824cdbdbd5eb30d99c44e079 (diff)
cosmetic: gsm0408_test: RA test cases as array-of-struct
(Preparation for adding 3-digit MNC) Change-Id: Ic6c645ebf82d5f8d9d51c4c4cc804a0172008156
-rw-r--r--tests/gsm0408/gsm0408_test.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index ab2dee4c..8e6cf2f2 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -158,23 +158,27 @@ static inline void check_ra(const struct gprs_ra_id *raid)
printf("passed\n");
}
-static void test_ra_cap(void)
-{
- struct gprs_ra_id raid1 = {
+static struct gprs_ra_id test_ra_cap_items[] = {
+ {
.mnc = 121,
.mcc = 77,
.lac = 666,
.rac = 5,
- };
- struct gprs_ra_id raid2 = {
+ },
+ {
.mnc = 98,
.mcc = 84,
.lac = 11,
.rac = 89,
- };
+ },
+};
+
+static void test_ra_cap(void)
+{
+ int i;
- check_ra(&raid1);
- check_ra(&raid2);
+ for (i = 0; i < ARRAY_SIZE(test_ra_cap_items); i++)
+ check_ra(&test_ra_cap_items[i]);
}
static void test_mid_from_tmsi(void)