aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-14 04:15:40 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-15 15:50:43 +0700
commit52d6e43d0ec45e9456a66ab1c59582419f57ce28 (patch)
tree001bbc3648db99e1f6b883494c01d89523fe9d52
parent8d56806c655d469b749cf0fbc3668be5890e69dc (diff)
tests/power_test: do not assert in apply_power_test()
Instead, print the actual vs expected values. Change-Id: Ie88e275ba78cef7a9ba20d34c269881216fb0ce3 Related: SYS#4916
-rw-r--r--tests/power/power_test.c13
-rw-r--r--tests/power/power_test.ok72
2 files changed, 57 insertions, 28 deletions
diff --git a/tests/power/power_test.c b/tests/power/power_test.c
index 0d3457a4..c3bfdf98 100644
--- a/tests/power/power_test.c
+++ b/tests/power/power_test.c
@@ -55,11 +55,16 @@ static void init_test(const char *name)
static inline void apply_power_test(struct gsm_lchan *lchan, int rxlev, int exp_ret, uint8_t exp_current)
{
- int ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, rxlev);
+ uint8_t old;
+ int ret;
- printf("power control [%d]: MS current power %u\n", ret, lchan->ms_power_ctrl.current);
- OSMO_ASSERT(ret == exp_ret);
- OSMO_ASSERT(lchan->ms_power_ctrl.current == exp_current);
+ old = lchan->ms_power_ctrl.current;
+ ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, rxlev);
+
+ printf("lchan_ms_pwr_ctrl(RxLvl=%d dBm) returns %d (expected %d)\n",
+ rxlev, ret, exp_ret);
+ printf("\tMS current power %u -> %u (expected %u)\n",
+ old, lchan->ms_power_ctrl.current, exp_current);
}
static void test_power_loop(void)
diff --git a/tests/power/power_test.ok b/tests/power/power_test.ok
index e325bb78..6b7a0d46 100644
--- a/tests/power/power_test.ok
+++ b/tests/power/power_test.ok
@@ -1,28 +1,52 @@
Testing power loop...
Starting test case 'test_power_loop'
-power control [0]: MS current power 15
-power control [1]: MS current power 13
-power control [1]: MS current power 11
-power control [1]: MS current power 9
-power control [1]: MS current power 7
-power control [1]: MS current power 5
-power control [0]: MS current power 5
-power control [1]: MS current power 3
-power control [1]: MS current power 2
-power control [0]: MS current power 2
-power control [1]: MS current power 0
-power control [0]: MS current power 0
-power control [1]: MS current power 30
-power control [1]: MS current power 29
-power control [0]: MS current power 29
-power control [0]: MS current power 29
-power control [1]: MS current power 1
-power control [1]: MS current power 5
-power control [1]: MS current power 9
-power control [1]: MS current power 10
-power control [1]: MS current power 9
-power control [1]: MS current power 14
-power control [0]: MS current power 14
-power control [1]: MS current power 15
+lchan_ms_pwr_ctrl(RxLvl=-60 dBm) returns 0 (expected 0)
+ MS current power 15 -> 15 (expected 15)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 15 -> 13 (expected 13)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 13 -> 11 (expected 11)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 11 -> 9 (expected 9)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 9 -> 7 (expected 7)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 7 -> 5 (expected 5)
+lchan_ms_pwr_ctrl(RxLvl=-75 dBm) returns 0 (expected 0)
+ MS current power 5 -> 5 (expected 5)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 5 -> 3 (expected 3)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 3 -> 2 (expected 2)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 0 (expected 0)
+ MS current power 2 -> 2 (expected 2)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 2 -> 0 (expected 0)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 0 (expected 0)
+ MS current power 0 -> 0 (expected 0)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 0 -> 30 (expected 30)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
+ MS current power 30 -> 29 (expected 29)
+lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 0 (expected 0)
+ MS current power 29 -> 29 (expected 29)
+lchan_ms_pwr_ctrl(RxLvl=-75 dBm) returns 0 (expected 0)
+ MS current power 29 -> 29 (expected 29)
+lchan_ms_pwr_ctrl(RxLvl=-45 dBm) returns 1 (expected 1)
+ MS current power 29 -> 1 (expected 1)
+lchan_ms_pwr_ctrl(RxLvl=-45 dBm) returns 1 (expected 1)
+ MS current power 1 -> 5 (expected 5)
+lchan_ms_pwr_ctrl(RxLvl=-45 dBm) returns 1 (expected 1)
+ MS current power 5 -> 9 (expected 9)
+lchan_ms_pwr_ctrl(RxLvl=-73 dBm) returns 1 (expected 1)
+ MS current power 9 -> 10 (expected 10)
+lchan_ms_pwr_ctrl(RxLvl=-77 dBm) returns 1 (expected 1)
+ MS current power 10 -> 9 (expected 9)
+lchan_ms_pwr_ctrl(RxLvl=-73 dBm) returns 1 (expected 1)
+ MS current power 9 -> 14 (expected 14)
+lchan_ms_pwr_ctrl(RxLvl=-60 dBm) returns 0 (expected 0)
+ MS current power 14 -> 14 (expected 14)
+lchan_ms_pwr_ctrl(RxLvl=-40 dBm) returns 1 (expected 1)
+ MS current power 14 -> 15 (expected 15)
Power loop test OK