MGCP_Test: add function to check for RTP err counters

At the moment we check the error counters of the RTP statistics in
the testcases. However, in most situations we will do the check to
make sure that no errors occurred (all counters == 0). Rather than
having a long tail of if statements in the testcases we should have
a function for this. This also makes it much easier in case we add
more error countes lateron.

- add and use function f_rtpem_stats_err_check()

Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1
Related: OS#3384
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 264ac28..a6d3460 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -961,21 +961,8 @@
 		if (stats.bytes_payload_tx < 190) {
 			setverdict(fail);
 		}
-		if (stats.num_pkts_rx != 0) {
-			setverdict(fail);
-		}
-		if (stats.num_pkts_rx_err_seq != 0) {
-			setverdict(fail);
-		}
-		if (stats.num_pkts_rx_err_ts != 0) {
-			setverdict(fail);
-		}
-		if (stats.num_pkts_rx_err_pt != 0) {
-			setverdict(fail);
-		}
-		if (stats.num_pkts_rx_err_disabled != 0) {
-			setverdict(fail);
-		}
+
+		f_rtpem_stats_err_check(stats);
 
 		setverdict(pass);
 	}
@@ -1005,18 +992,8 @@
 		if (stats.bytes_payload_tx != stats.bytes_payload_rx) {
 			setverdict(fail);
 		}
-		if (stats.num_pkts_rx_err_seq != 0) {
-			setverdict(fail);
-		}
-		if (stats.num_pkts_rx_err_ts != 0) {
-			setverdict(fail);
-		}
-		if (stats.num_pkts_rx_err_pt != 0) {
-			setverdict(fail);
-		}
-		if (stats.num_pkts_rx_err_disabled != 0) {
-			setverdict(fail);
-		}
+
+		f_rtpem_stats_err_check(stats);
 
 		setverdict(pass);
 	}
@@ -1068,10 +1045,8 @@
 			mtc.stop;
 		}
 
-		if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) {
-			setverdict(fail, "RTP packets with wrong payload type received");
-			mtc.stop;
-		}
+		f_rtpem_stats_err_check(stats[0]);
+		f_rtpem_stats_err_check(stats[1]);
 
 		setverdict(pass);
 	}
@@ -1174,20 +1149,15 @@
 			setverdict(fail, "number of packets not within normal parameters");
 			mtc.stop;
 		}
-		if (stats[0].num_pkts_rx_err_pt > 0) {
-			setverdict(fail, "RTP packets with wrong payload type received");
-			mtc.stop;
-		}
 
 		temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx;
 		if (temp > 3 or temp < -3) {
 			setverdict(fail, "number of packets not within normal parameters");
 			mtc.stop;
 		}
-		if (stats[0].num_pkts_rx_err_pt > 0) {
-			setverdict(fail, "RTP packets with wrong payload type received");
-			mtc.stop;
-		}
+
+		f_rtpem_stats_err_check(stats[0]);
+		f_rtpem_stats_err_check(stats[1]);
 
 		/* Tear down */
 		f_flow_delete(RTPEM[0]);
@@ -1240,10 +1210,8 @@
 			mtc.stop;
 		}
 
-		if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) {
-			setverdict(fail, "RTP packets with wrong payload type received");
-			mtc.stop;
-		}
+		f_rtpem_stats_err_check(stats[0]);
+		f_rtpem_stats_err_check(stats[0]);
 
 		setverdict(pass);
 	}
@@ -1308,10 +1276,9 @@
 			mtc.stop;
 		}
 
-		if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) {
-			setverdict(fail, "RTP packets with wrong payload type received");
-			mtc.stop;
-		}
+		f_rtpem_stats_err_check(stats[0]);
+		f_rtpem_stats_err_check(stats[1]);
+		f_rtpem_stats_err_check(stats[2]);
 
 		setverdict(pass);
 	}