[MERGED] libosmocore[master]: cosmetic: gsm0408_test: RA test cases as array-of-struct

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Feb 22 07:49:10 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: gsm0408_test: RA test cases as array-of-struct
......................................................................


cosmetic: gsm0408_test: RA test cases as array-of-struct

(Preparation for adding 3-digit MNC)

Change-Id: Ic6c645ebf82d5f8d9d51c4c4cc804a0172008156
---
M tests/gsm0408/gsm0408_test.c
1 file changed, 12 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index ab2dee4..8e6cf2f 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -158,23 +158,27 @@
 		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,
-	};
+	},
+};
 
-	check_ra(&raid1);
-	check_ra(&raid2);
+static void test_ra_cap(void)
+{
+	int i;
+
+	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)

-- 
To view, visit https://gerrit.osmocom.org/6654
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6c645ebf82d5f8d9d51c4c4cc804a0172008156
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list