[PATCH] osmo-msc[master]: Mark static test functions as such

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/.

Max gerrit-no-reply at lists.osmocom.org
Tue Feb 6 16:17:07 UTC 2018


Review at  https://gerrit.osmocom.org/6294

Mark static test functions as such

Change-Id: I5eac4c24257fd38068ba629d3c21848181703220
---
M tests/msc_vlr/msc_vlr_tests.c
M tests/msc_vlr/msc_vlr_tests.h
2 files changed, 7 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/6294/1

diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 44108a2..c75d950 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -113,15 +113,10 @@
 	return msg;
 }
 
-const char *gh_type_name(struct gsm48_hdr *gh)
+static const char *gh_type_name(struct gsm48_hdr *gh)
 {
 	return gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh),
 					gsm48_hdr_msg_type(gh));
-}
-
-const char *msg_type_name(struct msgb *msg)
-{
-	return gh_type_name((void*)msg->data);
 }
 
 void dtap_expect_tx(const char *hex)
@@ -251,7 +246,7 @@
 	talloc_free(msg);
 }
 
-int ms_sends_msg_fake(uint8_t pdisc, uint8_t msg_type)
+static int ms_sends_msg_fake(uint8_t pdisc, uint8_t msg_type)
 {
 	int rc;
 	struct msgb *msg;
@@ -326,7 +321,7 @@
 	paging_expecting_imsi = NULL;
 }
 
-int _paging_sent(enum ran_type via_ran, const char *imsi, uint32_t tmsi, uint32_t lac)
+static int _paging_sent(enum ran_type via_ran, const char *imsi, uint32_t tmsi, uint32_t lac)
 {
 	log("%s sends out paging request to IMSI %s, TMSI 0x%08x, LAC %u",
 	    ran_type_name(via_ran), imsi, tmsi, lac);
@@ -522,10 +517,10 @@
 	return 0;
 }
 
-int _validate_dtap(struct msgb *msg, enum ran_type to_ran)
+static int _validate_dtap(struct msgb *msg, enum ran_type to_ran)
 {
 	btw("DTAP --%s--> MS: %s: %s",
-	    ran_type_name(to_ran), msg_type_name(msg),
+	    ran_type_name(to_ran), gh_type_name((void*)msg->data),
 	    osmo_hexdump_nospc(msg->data, msg->len));
 
 	OSMO_ASSERT(dtap_tx_expected);
@@ -748,7 +743,7 @@
 	fake_time_passes(0, 0);
 }
 
-void check_talloc(void *msgb_ctx, void *tall_bsc_ctx, int expected_blocks)
+static void check_talloc(void *msgb_ctx, void *tall_bsc_ctx, int expected_blocks)
 {
 	talloc_report_full(msgb_ctx, stderr);
 	/* Expecting these to stick around in tall_bsc_ctx:
@@ -823,7 +818,7 @@
 
 void *msgb_ctx = NULL;
 
-void run_tests(int nr)
+static void run_tests(int nr)
 {
 	int test_nr;
 	const char *imsi = "901700000004620";
diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h
index eaec340..2ea3f29 100644
--- a/tests/msc_vlr/msc_vlr_tests.h
+++ b/tests/msc_vlr/msc_vlr_tests.h
@@ -144,8 +144,6 @@
 
 void thwart_rx_non_initial_requests();
 
-void check_talloc(void *msgb_ctx, void *tall_bsc_ctx, int expected_blocks);
-
 #define EXPECT_ACCEPTED(expect_accepted) do { \
 		if (g_conn) \
 			OSMO_ASSERT(conn_exists(g_conn)); \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5eac4c24257fd38068ba629d3c21848181703220
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list