osmith has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34838?usp=email )

Change subject: library: deduplicate f_logp
......................................................................

library: deduplicate f_logp

Change-Id: Ie84a8a75e9f162fcbef0d07d0bc75e47a5303fa3
---
M bsc/BSC_Tests.ttcn
M hnbgw/HNBGW_Tests.ttcn
M hnodeb/HNB_Tests.ttcn
M library/Osmocom_VTY_Functions.ttcn
M smlc/SMLC_Tests.ttcn
M upf/UPF_Tests.ttcn
6 files changed, 19 insertions(+), 42 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve




diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 426109a..57b44e0 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1129,16 +1129,6 @@
                          "sccp-timer iar " & int2str(g_bsc_sccp_timer_iar)});
 }

-friend function f_logp(TELNETasp_PT pt, charstring log_msg)
-{
-       // log on TTCN3 log output
-       log(log_msg);
-       // log in stderr log
-       if (pt.checkstate("Mapped")) {
-               f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & 
log_msg);
-       }
-}
-
 private function f_sysinfo_seen(integer rsl_idx, RSL_Message rsl) runs on 
test_CT
 {
        if (rsl_idx >= lengthof(g_system_information)) {
diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index c3849b8..4afb8dd 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -349,14 +349,6 @@
                }
 }

-friend function f_logp(TELNETasp_PT pt, charstring log_msg)
-{
-       // log on TTCN3 log output
-       log(log_msg);
-       // log in stderr log
-       f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);
-}
-
 function f_init_vty(charstring id := "foo") runs on test_CT {
        if (HNBGWVTY.checkstate("Mapped")) {
                /* skip initialization if already executed once */
diff --git a/hnodeb/HNB_Tests.ttcn b/hnodeb/HNB_Tests.ttcn
index 6d1ddc5..df7a04c 100644
--- a/hnodeb/HNB_Tests.ttcn
+++ b/hnodeb/HNB_Tests.ttcn
@@ -95,14 +95,6 @@
                }
 }

-friend function f_logp(TELNETasp_PT pt, charstring log_msg)
-{
-       // log on TTCN3 log output
-       log(log_msg);
-       // log in stderr log
-       f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);
-}
-
 function f_init_vty(charstring id := "foo") runs on test_CT {
        if (HNBVTY.checkstate("Mapped")) {
                /* skip initialization if already executed once */
diff --git a/library/Osmocom_VTY_Functions.ttcn 
b/library/Osmocom_VTY_Functions.ttcn
index a448b8b..3dd0429 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -363,4 +363,14 @@
        mtc.stop;
 }

+public function f_logp(TELNETasp_PT pt, charstring log_msg)
+{
+       // log on TTCN3 log output
+       log(log_msg);
+       // log in stderr log
+       if (pt.checkstate("Mapped")) {
+               f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & 
log_msg);
+       }
+}
+
 }
diff --git a/smlc/SMLC_Tests.ttcn b/smlc/SMLC_Tests.ttcn
index 5324d1c..2a50666 100644
--- a/smlc/SMLC_Tests.ttcn
+++ b/smlc/SMLC_Tests.ttcn
@@ -156,14 +156,6 @@
                }
 }

-private function f_logp(TELNETasp_PT pt, charstring log_msg)
-{
-       // log on TTCN3 log output
-       log(log_msg);
-       // log in stderr log
-       f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);
-}
-
 /* global initialization function
  * \param nr_bts Number of BTSs we should start/bring up
  * \param handler_mode Start an RSL_Emulation_CT component (true) or not 
(false).
diff --git a/upf/UPF_Tests.ttcn b/upf/UPF_Tests.ttcn
index 7dc01bb..140e81b 100644
--- a/upf/UPF_Tests.ttcn
+++ b/upf/UPF_Tests.ttcn
@@ -68,14 +68,6 @@
                }
 }

-friend function f_logp(TELNETasp_PT pt, charstring log_msg)
-{
-       // log on TTCN3 log output
-       log(log_msg);
-       // log in stderr log
-       f_vty_transceive(pt, "logp lglobal notice TTCN3 f_logp(): " & log_msg);
-}
-
 private function f_get_name_val(out charstring val, charstring str, charstring 
name, charstring sep := ":", charstring delim := " ") return boolean {
        var charstring labl := name & sep;
        var integer namepos := f_strstr(str, labl);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34838?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie84a8a75e9f162fcbef0d07d0bc75e47a5303fa3
Gerrit-Change-Number: 34838
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-MessageType: merged

Reply via email to