[PATCH] openbsc[master]: gtphub_test: rename llist_len() to _llist_len(), prep for li...

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jan 19 16:15:07 UTC 2017


Hello Max, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/1562

to look at the new patch set (#3).

gtphub_test: rename llist_len() to _llist_len(), prep for libosmocore llist_len()

Also change the return value to unsigned, like will be the case in the
libosmocore implementation.

Related: libosmocore Change-Id Ic49adc7a346f5722bf624d7d3b4a735e4220ae15
Change-Id: I9a7e438de4539c382de54b7337fd18e4bf19d007
---
M openbsc/tests/gtphub/gtphub_test.c
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/1562/3

diff --git a/openbsc/tests/gtphub/gtphub_test.c b/openbsc/tests/gtphub/gtphub_test.c
index 7d7673b..3d8ec3a 100644
--- a/openbsc/tests/gtphub/gtphub_test.c
+++ b/openbsc/tests/gtphub/gtphub_test.c
@@ -57,10 +57,10 @@
 void *osmo_gtphub_ctx;
 
 /* TODO copied from libosmo-abis/src/subchan_demux.c, remove dup */
-static int llist_len(struct llist_head *head)
+static unsigned int _llist_len(struct llist_head *head)
 {
 	struct llist_head *entry;
-	int i = 0;
+	unsigned int i = 0;
 
 	llist_for_each(entry, head)
 		i++;
@@ -174,11 +174,11 @@
 		mapping = nr_map_have(map, origin1, orig, 0);
 		m[i] = mapping->repl;
 		OSMO_ASSERT(m[i] != 0);
-		OSMO_ASSERT(llist_len(&map->mappings) == (i+1));
+		OSMO_ASSERT(_llist_len(&map->mappings) == (i+1));
 		for (check_i = 0; check_i < i; check_i++)
 			OSMO_ASSERT(m[check_i] != m[i]);
 	}
-	OSMO_ASSERT(llist_len(&map->mappings) == TEST_N_HALF);
+	OSMO_ASSERT(_llist_len(&map->mappings) == TEST_N_HALF);
 
 	/* create another TEST_N mappings with the same original numbers, but
 	 * from a different origin */
@@ -189,11 +189,11 @@
 		mapping = nr_map_have(map, origin2, orig, 0);
 		m[i2] = mapping->repl;
 		OSMO_ASSERT(m[i2] != 0);
-		OSMO_ASSERT(llist_len(&map->mappings) == (i2+1));
+		OSMO_ASSERT(_llist_len(&map->mappings) == (i2+1));
 		for (check_i = 0; check_i < i2; check_i++)
 			OSMO_ASSERT(m[check_i] != m[i2]);
 	}
-	OSMO_ASSERT(llist_len(&map->mappings) == TEST_N);
+	OSMO_ASSERT(_llist_len(&map->mappings) == TEST_N);
 
 	/* verify mappings */
 	for (i = 0; i < TEST_N_HALF; i++) {
@@ -213,7 +213,7 @@
 
 	/* remove all mappings */
 	for (i = 0; i < TEST_N_HALF; i++) {
-		OSMO_ASSERT(llist_len(&map->mappings) == (TEST_N - 2*i));
+		OSMO_ASSERT(_llist_len(&map->mappings) == (TEST_N - 2*i));
 
 		nr_t orig = TEST_I + i;
 		nr_mapping_del(nr_map_get(map, origin1, orig));

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9a7e438de4539c382de54b7337fd18e4bf19d007
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>


More information about the gerrit-log mailing list