summaryrefslogtreecommitdiffstats
path: root/tests/conv
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-01-19 17:01:15 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2017-04-30 02:59:42 +0700
commit33e03065a508f1238056f36841b97d38083ac18b (patch)
tree70d51d4763293829835b53d71dca1113920f788a /tests/conv
parentf74cfd35acadbebe7ccd9fc02d05920958f43ad3 (diff)
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
Diffstat (limited to 'tests/conv')
-rw-r--r--tests/conv/conv.h4
-rw-r--r--tests/conv/conv_gsm0503_test.c28
-rw-r--r--tests/conv/conv_gsm0503_test.ok304
3 files changed, 334 insertions, 2 deletions
diff --git a/tests/conv/conv.h b/tests/conv/conv.h
index 676c5aff..0604859c 100644
--- a/tests/conv/conv.h
+++ b/tests/conv/conv.h
@@ -1,7 +1,7 @@
#pragma once
-#define MAX_LEN_BITS 512
-#define MAX_LEN_BYTES (512/8)
+#define MAX_LEN_BITS 2048
+#define MAX_LEN_BYTES (2048 / 8)
struct conv_test_vector {
const char *name;
diff --git a/tests/conv/conv_gsm0503_test.c b/tests/conv/conv_gsm0503_test.c
new file mode 100644
index 00000000..67041290
--- /dev/null
+++ b/tests/conv/conv_gsm0503_test.c
@@ -0,0 +1,28 @@
+#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 "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 00000000..e6e25727
--- /dev/null
+++ b/tests/conv/conv_gsm0503_test.ok
@@ -0,0 +1,304 @@
+[+] 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_cs2_np
+[.] Input length : ret = 290 exp = 290 -> OK
+[.] Output length : ret = 588 exp = 588 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_cs3_np
+[.] Input length : ret = 334 exp = 334 -> OK
+[.] Output length : ret = 676 exp = 676 -> 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
+
+[+] Testing: gsm0503_mcs1
+[.] Input length : ret = 190 exp = 190 -> OK
+[.] Output length : ret = 588 exp = 588 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs2
+[.] Input length : ret = 238 exp = 238 -> OK
+[.] Output length : ret = 732 exp = 732 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs3
+[.] Input length : ret = 310 exp = 310 -> OK
+[.] Output length : ret = 948 exp = 948 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs4
+[.] Input length : ret = 366 exp = 366 -> OK
+[.] Output length : ret = 1116 exp = 1116 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs5_dl_hdr
+[.] Input length : ret = 33 exp = 33 -> OK
+[.] Output length : ret = 99 exp = 99 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs5_ul_hdr
+[.] Input length : ret = 45 exp = 45 -> OK
+[.] Output length : ret = 135 exp = 135 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs5
+[.] Input length : ret = 462 exp = 462 -> OK
+[.] Output length : ret = 1404 exp = 1404 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs6
+[.] Input length : ret = 606 exp = 606 -> OK
+[.] Output length : ret = 1836 exp = 1836 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs7_dl_hdr
+[.] Input length : ret = 45 exp = 45 -> OK
+[.] Output length : ret = 135 exp = 135 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs7_ul_hdr
+[.] Input length : ret = 54 exp = 54 -> OK
+[.] Output length : ret = 162 exp = 162 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs7
+[.] Input length : ret = 462 exp = 462 -> OK
+[.] Output length : ret = 1404 exp = 1404 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs8
+[.] Input length : ret = 558 exp = 558 -> OK
+[.] Output length : ret = 1692 exp = 1692 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+
+[+] Testing: gsm0503_mcs9
+[.] Input length : ret = 606 exp = 606 -> OK
+[.] Output length : ret = 1836 exp = 1836 -> OK
+[.] Random vector checks:
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+[..] Encoding / Decoding cycle : OK
+