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/.
dexter gerrit-no-reply at lists.osmocom.orgdexter has uploaded this change for review. ( https://gerrit.osmocom.org/10480
Change subject: cosmetic: separate measurement testcase definitions
......................................................................
cosmetic: separate measurement testcase definitions
the testcase definitions in meas_test.c that define different test
situations for uplink measurement are quite large. Lets have them in a
separate file so that the code meas_test.c is easier to maintain.
- Move all mtc* and ulm* structs as well as the struct definitions
to meas_testcase.h.
Change-Id: I90139ec535056d2cea6de10e77f435d807ce496e
Related: OS#2987
---
M tests/meas/Makefile.am
M tests/meas/meas_test.c
A tests/meas/meas_testcases.h
3 files changed, 153 insertions(+), 156 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/80/10480/1
diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am
index 3c83e52..d8fa118 100644
--- a/tests/meas/Makefile.am
+++ b/tests/meas/Makefile.am
@@ -2,7 +2,7 @@
AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS)
LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS)
noinst_PROGRAMS = meas_test
-noinst_HEADERS = sysmobts_fr_samples.h
+noinst_HEADERS = sysmobts_fr_samples.h meas_testcases.h
EXTRA_DIST = meas_test.ok
meas_test_SOURCES = meas_test.c
diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c
index e889345..2ba44d3 100644
--- a/tests/meas/meas_test.c
+++ b/tests/meas/meas_test.c
@@ -21,6 +21,7 @@
};
#include "sysmobts_fr_samples.h"
+#include "meas_testcases.h"
void test_fn_sample(struct fn_sample *s, unsigned int len, uint8_t pchan, uint8_t tsmap)
{
@@ -63,161 +64,6 @@
OSMO_ASSERT(tsmap_result == tsmap);
}
-#define ULM(ber, ta, neg_rssi) \
- { .ber10k = (ber), .ta_offs_256bits = (ta), .c_i = 1.0, .is_sub = 0, .inv_rssi = (neg_rssi) }
-
-struct meas_testcase {
- const char *name;
- /* input data */
- const struct bts_ul_meas *ulm;
- unsigned int ulm_count;
- uint32_t final_fn;
- /* results */
- struct {
- int success;
- uint8_t rx_lev_full;
- uint8_t rx_qual_full;
- int16_t toa256_mean;
- int16_t toa256_min;
- int16_t toa256_max;
- uint16_t toa256_std_dev;
- } res;
-};
-
-static struct bts_ul_meas ulm1[] = {
- ULM(0, 0, 90),
- ULM(0, 256, 90),
- ULM(0, -256, 90),
-};
-static const struct meas_testcase mtc1 = {
- .name = "TOA256 Min-Max negative/positive",
- .ulm = ulm1,
- .ulm_count = ARRAY_SIZE(ulm1),
- .final_fn = 25,
- .res = {
- .success = 1,
- .rx_lev_full = 110-90,
- .rx_qual_full = 0,
- .toa256_mean = 0,
- .toa256_max = 256,
- .toa256_min = -256,
- .toa256_std_dev = 209,
- },
-};
-
-
-static struct bts_ul_meas ulm2[] = {
- ULM(0, 256, 90),
- ULM(0, 258, 90),
- ULM(0, 254, 90),
- ULM(0, 258, 90),
- ULM(0, 254, 90),
- ULM(0, 256, 90),
-};
-static const struct meas_testcase mtc2 = {
- .name = "TOA256 small jitter around 256",
- .ulm = ulm2,
- .ulm_count = ARRAY_SIZE(ulm2),
- .final_fn = 25,
- .res = {
- .success = 1,
- .rx_lev_full = 110-90,
- .rx_qual_full = 0,
- .toa256_mean = 256,
- .toa256_max = 258,
- .toa256_min = 254,
- .toa256_std_dev = 1,
- },
-};
-
-static struct bts_ul_meas ulm3[] = {
- ULM(0, 0, 90),
- ULM(0, 0, 80),
- ULM(0, 0, 80),
- ULM(0, 0, 100),
- ULM(0, 0, 100),
-};
-static const struct meas_testcase mtc3 = {
- .name = "RxLEv averaging",
- .ulm = ulm3,
- .ulm_count = ARRAY_SIZE(ulm3),
- .final_fn = 25,
- .res = {
- .success = 1,
- .rx_lev_full = 110-90,
- .rx_qual_full = 0,
- .toa256_mean = 0,
- .toa256_max = 0,
- .toa256_min = 0,
- .toa256_std_dev = 0,
- },
-};
-
-static struct bts_ul_meas ulm4[] = {
-};
-static const struct meas_testcase mtc4 = {
- .name = "Empty measurements",
- .ulm = ulm4,
- .ulm_count = ARRAY_SIZE(ulm4),
- .final_fn = 25,
- .res = {
- .success = 0,
- .rx_lev_full = 0,
- .rx_qual_full = 0,
- .toa256_mean = 0,
- .toa256_max = 0,
- .toa256_min = 0,
- .toa256_std_dev = 0,
- },
-};
-
-static struct bts_ul_meas ulm5[] = {
- /* one 104 multiframe can at max contain 26 blocks (TCH/F),
- * each of which can at maximum be 64 bits in advance (TA range) */
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
- ULM(0, 64*256, 90),
-};
-static const struct meas_testcase mtc5 = {
- .name = "TOA256 26 blocks with max TOA256",
- .ulm = ulm5,
- .ulm_count = ARRAY_SIZE(ulm5),
- .final_fn = 25,
- .res = {
- .success = 1,
- .rx_lev_full = 110-90,
- .rx_qual_full = 0,
- .toa256_mean = 64*256,
- .toa256_max = 64*256,
- .toa256_min = 64*256,
- .toa256_std_dev = 0,
- },
-};
-
-
static void reset_lchan_meas(struct gsm_lchan *lchan)
{
lchan->state = LCHAN_S_ACTIVE;
diff --git a/tests/meas/meas_testcases.h b/tests/meas/meas_testcases.h
new file mode 100644
index 0000000..ff74a20
--- /dev/null
+++ b/tests/meas/meas_testcases.h
@@ -0,0 +1,151 @@
+#define ULM(ber, ta, neg_rssi) \
+ { .ber10k = (ber), .ta_offs_256bits = (ta), .c_i = 1.0, .is_sub = 0, .inv_rssi = (neg_rssi) }
+
+struct meas_testcase {
+ const char *name;
+ /* input data */
+ const struct bts_ul_meas *ulm;
+ unsigned int ulm_count;
+ uint32_t final_fn;
+ /* results */
+ struct {
+ int success;
+ uint8_t rx_lev_full;
+ uint8_t rx_qual_full;
+ int16_t toa256_mean;
+ int16_t toa256_min;
+ int16_t toa256_max;
+ uint16_t toa256_std_dev;
+ } res;
+};
+
+static struct bts_ul_meas ulm1[] = {
+ ULM(0, 0, 90),
+ ULM(0, 256, 90),
+ ULM(0, -256, 90),
+};
+static const struct meas_testcase mtc1 = {
+ .name = "TOA256 Min-Max negative/positive",
+ .ulm = ulm1,
+ .ulm_count = ARRAY_SIZE(ulm1),
+ .final_fn = 25,
+ .res = {
+ .success = 1,
+ .rx_lev_full = 110-90,
+ .rx_qual_full = 0,
+ .toa256_mean = 0,
+ .toa256_max = 256,
+ .toa256_min = -256,
+ .toa256_std_dev = 209,
+ },
+};
+
+static struct bts_ul_meas ulm2[] = {
+ ULM(0, 256, 90),
+ ULM(0, 258, 90),
+ ULM(0, 254, 90),
+ ULM(0, 258, 90),
+ ULM(0, 254, 90),
+ ULM(0, 256, 90),
+};
+static const struct meas_testcase mtc2 = {
+ .name = "TOA256 small jitter around 256",
+ .ulm = ulm2,
+ .ulm_count = ARRAY_SIZE(ulm2),
+ .final_fn = 25,
+ .res = {
+ .success = 1,
+ .rx_lev_full = 110-90,
+ .rx_qual_full = 0,
+ .toa256_mean = 256,
+ .toa256_max = 258,
+ .toa256_min = 254,
+ .toa256_std_dev = 1,
+ },
+};
+
+static struct bts_ul_meas ulm3[] = {
+ ULM(0, 0, 90),
+ ULM(0, 0, 80),
+ ULM(0, 0, 80),
+ ULM(0, 0, 100),
+ ULM(0, 0, 100),
+};
+static const struct meas_testcase mtc3 = {
+ .name = "RxLEv averaging",
+ .ulm = ulm3,
+ .ulm_count = ARRAY_SIZE(ulm3),
+ .final_fn = 25,
+ .res = {
+ .success = 1,
+ .rx_lev_full = 110-90,
+ .rx_qual_full = 0,
+ .toa256_mean = 0,
+ .toa256_max = 0,
+ .toa256_min = 0,
+ .toa256_std_dev = 0,
+ },
+};
+
+static struct bts_ul_meas ulm4[] = {};
+static const struct meas_testcase mtc4 = {
+ .name = "Empty measurements",
+ .ulm = ulm4,
+ .ulm_count = ARRAY_SIZE(ulm4),
+ .final_fn = 25,
+ .res = {
+ .success = 0,
+ .rx_lev_full = 0,
+ .rx_qual_full = 0,
+ .toa256_mean = 0,
+ .toa256_max = 0,
+ .toa256_min = 0,
+ .toa256_std_dev = 0,
+ },
+};
+
+static struct bts_ul_meas ulm5[] = {
+ /* one 104 multiframe can at max contain 26 blocks (TCH/F),
+ * each of which can at maximum be 64 bits in advance (TA range) */
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+ ULM(0, 64*256, 90),
+};
+static const struct meas_testcase mtc5 = {
+ .name = "TOA256 26 blocks with max TOA256",
+ .ulm = ulm5,
+ .ulm_count = ARRAY_SIZE(ulm5),
+ .final_fn = 25,
+ .res = {
+ .success = 1,
+ .rx_lev_full = 110-90,
+ .rx_qual_full = 0,
+ .toa256_mean = 64*256,
+ .toa256_max = 64*256,
+ .toa256_min = 64*256,
+ .toa256_std_dev = 0,
+ },
+};
--
To view, visit https://gerrit.osmocom.org/10480
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I90139ec535056d2cea6de10e77f435d807ce496e
Gerrit-Change-Number: 10480
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180816/7b72c401/attachment.htm>