[PATCH] libosmocore[master]: tests/conv: add GSM 05.03 specific test

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Fri Mar 17 06:08:02 UTC 2017


Hello Max, Harald Welte, Jenkins Builder,

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

    https://gerrit.osmocom.org/1628

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

tests/conv: add GSM 05.03 specific test

This change extends the convolutional code test coverage, adding
the GSM 05.03 specific test vectors, generated by the conv_gen.py.

Inspired by Tom's patch:
http://lists.osmocom.org/pipermail/openbsc/2014-April/007364.html

Change-Id: I76d1cd4032d2f74c5bb93bde4fab99aa655b7f1a
---
M .gitignore
M tests/Makefile.am
A tests/conv/conv_gsm0503_test.c
A tests/conv/conv_gsm0503_test.ok
M tests/testsuite.at
5 files changed, 229 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/1628/5

diff --git a/.gitignore b/.gitignore
index ecbcedd..4b198d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -121,6 +121,7 @@
 include/osmocom/core/crc*gen.h
 include/osmocom/core/bit*gen.h
 include/osmocom/gsm/gsm0503.h
+tests/conv/gsm0503_test_vectors.c
 
 # vi files
 *.sw?
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f8d326e..d69a72a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,7 +15,7 @@
 		 bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test	\
 		 tlv/tlv_test gsup/gsup_test oap/oap_test fsm/fsm_test	\
 		 write_queue/wqueue_test socket/socket_test		\
-		 coding/coding_test
+		 coding/coding_test conv/conv_gsm0503_test
 
 if ENABLE_MSGFILE
 check_PROGRAMS += msgfile/msgfile_test
@@ -60,6 +60,9 @@
 
 conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c
 conv_conv_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la
+
+conv_conv_gsm0503_test_SOURCES = conv/conv_gsm0503_test.c conv/conv.c conv/gsm0503_test_vectors.c
+conv_conv_gsm0503_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libgsmint.la
 
 gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c
 gsm0808_gsm0808_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la
@@ -195,9 +198,11 @@
 	     socket/socket_test.err coding/coding_test.ok		\
 	     osmo-auc-gen/osmo-auc-gen_test.sh				\
 	     osmo-auc-gen/osmo-auc-gen_test.ok				\
-	     osmo-auc-gen/osmo-auc-gen_test.err
+	     osmo-auc-gen/osmo-auc-gen_test.err				\
+	     conv/conv_gsm0503_test.ok
 
-DISTCLEANFILES = atconfig atlocal
+DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c
+BUILT_SOURCES = conv/gsm0503_test_vectors.c
 
 TESTSUITE = $(srcdir)/testsuite
 
@@ -217,3 +222,7 @@
 $(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4
 	$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
 	mv $@.tmp $@
+
+conv/gsm0503_test_vectors.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py
+	$(AM_V_GEN)python2 $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \
+		--target-path $(builddir)/conv
diff --git a/tests/conv/conv_gsm0503_test.c b/tests/conv/conv_gsm0503_test.c
new file mode 100644
index 0000000..1b0a724
--- /dev/null
+++ b/tests/conv/conv_gsm0503_test.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include <osmocom/core/bits.h>
+#include <osmocom/core/conv.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/gsm/gsm0503.h>
+#include <osmocom/tests/conv.h>
+
+/* Forward declaration of GSM 05.03 specific test vectors */
+extern const struct conv_test_vector gsm0503_vectors[];
+extern const int gsm0503_vectors_len;
+
+int main(int argc, char *argv[])
+{
+	int rc, i;
+
+	for (i = 0; i < gsm0503_vectors_len; i++) {
+		rc = do_check(&gsm0503_vectors[i]);
+		if (rc)
+			return rc;
+	}
+
+	return 0;
+}
diff --git a/tests/conv/conv_gsm0503_test.ok b/tests/conv/conv_gsm0503_test.ok
new file mode 100644
index 0000000..05761f2
--- /dev/null
+++ b/tests/conv/conv_gsm0503_test.ok
@@ -0,0 +1,183 @@
+[+] Testing: gsm0503_xcch
+[.] Input length  : ret = 224  exp = 224 -> OK
+[.] Output length : ret = 456  exp = 456 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_rach
+[.] Input length  : ret =  14  exp =  14 -> OK
+[.] Output length : ret =  36  exp =  36 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_sch
+[.] Input length  : ret =  35  exp =  35 -> OK
+[.] Output length : ret =  78  exp =  78 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_cs2
+[.] Input length  : ret = 290  exp = 290 -> OK
+[.] Output length : ret = 456  exp = 456 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_cs3
+[.] Input length  : ret = 334  exp = 334 -> OK
+[.] Output length : ret = 456  exp = 456 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_afs_12_2
+[.] Input length  : ret = 250  exp = 250 -> OK
+[.] Output length : ret = 448  exp = 448 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_afs_10_2
+[.] Input length  : ret = 210  exp = 210 -> OK
+[.] Output length : ret = 448  exp = 448 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_afs_7_95
+[.] Input length  : ret = 165  exp = 165 -> OK
+[.] Output length : ret = 448  exp = 448 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_afs_7_4
+[.] Input length  : ret = 154  exp = 154 -> OK
+[.] Output length : ret = 448  exp = 448 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_afs_6_7
+[.] Input length  : ret = 140  exp = 140 -> OK
+[.] Output length : ret = 448  exp = 448 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_afs_5_9
+[.] Input length  : ret = 124  exp = 124 -> OK
+[.] Output length : ret = 448  exp = 448 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_afs_5_15
+[.] Input length  : ret = 109  exp = 109 -> OK
+[.] Output length : ret = 448  exp = 448 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_afs_4_75
+[.] Input length  : ret = 101  exp = 101 -> OK
+[.] Output length : ret = 448  exp = 448 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_fr
+[.] Input length  : ret = 185  exp = 185 -> OK
+[.] Output length : ret = 378  exp = 378 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_hr
+[.] Input length  : ret =  98  exp =  98 -> OK
+[.] Output length : ret = 211  exp = 211 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_ahs_7_95
+[.] Input length  : ret = 129  exp = 129 -> OK
+[.] Output length : ret = 188  exp = 188 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_ahs_7_4
+[.] Input length  : ret = 126  exp = 126 -> OK
+[.] Output length : ret = 196  exp = 196 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_ahs_6_7
+[.] Input length  : ret = 116  exp = 116 -> OK
+[.] Output length : ret = 200  exp = 200 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_ahs_5_9
+[.] Input length  : ret = 108  exp = 108 -> OK
+[.] Output length : ret = 208  exp = 208 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_ahs_5_15
+[.] Input length  : ret =  97  exp =  97 -> OK
+[.] Output length : ret = 212  exp = 212 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_tch_ahs_4_75
+[.] Input length  : ret =  89  exp =  89 -> OK
+[.] Output length : ret = 212  exp = 212 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs1_dl_hdr
+[.] Input length  : ret =  36  exp =  36 -> OK
+[.] Output length : ret = 108  exp = 108 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs1_ul_hdr
+[.] Input length  : ret =  39  exp =  39 -> OK
+[.] Output length : ret = 117  exp = 117 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 64df724..afc7cff 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -45,6 +45,12 @@
 AT_CHECK([$abs_top_builddir/tests/conv/conv_test], [0], [expout])
 AT_CLEANUP
 
+AT_SETUP([conv_gsm0503])
+AT_KEYWORDS([conv_gsm0503])
+cat $abs_srcdir/conv/conv_gsm0503_test.ok > expout
+AT_CHECK([$abs_top_builddir/tests/conv/conv_gsm0503_test], [0], [expout])
+AT_CLEANUP
+
 AT_SETUP([coding])
 AT_KEYWORDS([coding])
 cat $abs_srcdir/coding/coding_test.ok > expout

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I76d1cd4032d2f74c5bb93bde4fab99aa655b7f1a
Gerrit-PatchSet: 5
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Tom Tsou <tom at tsou.cc>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: tnt <tnt at 246tNt.com>



More information about the gerrit-log mailing list