diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-08-16 14:19:52 +0200 |
---|---|---|
committer | Philipp Maier <pmaier@sysmocom.de> | 2018-08-16 18:14:10 +0200 |
commit | 1c3240c2f13d8e7bc2849c001ba794a446366adc (patch) | |
tree | 39efbb3d46c1c52e05b621817cfbc4100e12cadf /tests/meas/meas_testcases.h | |
parent | 22220915600248007fec4cf78d9346fad4769120 (diff) |
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
Diffstat (limited to 'tests/meas/meas_testcases.h')
-rw-r--r-- | tests/meas/meas_testcases.h | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/tests/meas/meas_testcases.h b/tests/meas/meas_testcases.h new file mode 100644 index 00000000..ff74a207 --- /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, + }, +}; |