aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-02-14 14:18:51 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-10 09:22:24 +0100
commit7503540959f421917a702174616655e9fdd11a24 (patch)
tree5c30c3f0ab2ecb501b0110b5055f8a0feb19745b /tests
parent2d725e77f7270550d7173a7c86f30aa1c7b01e5e (diff)
agch/pch: Use PCH for AGCH msgs
This patch extends paging_gen_msg() by adding an output parameter is_empty that is true, if only a paging message with dummy entries has been placed into buffer. This feature is then used by bts_ccch_copy_msg() to insert an AGCH message if is_empty is true. Ticket: SYS#224 Sponsored-by: On-Waves ehf
Diffstat (limited to 'tests')
-rw-r--r--tests/agch/agch_test.ok2
-rw-r--r--tests/paging/paging_test.c17
2 files changed, 16 insertions, 3 deletions
diff --git a/tests/agch/agch_test.ok b/tests/agch/agch_test.ok
index e8d29bff..f781383f 100644
--- a/tests/agch/agch_test.ok
+++ b/tests/agch/agch_test.ok
@@ -19,5 +19,5 @@ T BCCH slots
50 28 14 28 28 28
Testing AGCH messages queue handling.
AGCH filled: count 720, imm.ass 80, imm.ass.rej 640 (refs 640), queue limit 32, occupied 720, dropped 0, merged 0, rejected 0, ag-res 0, non-res 0
-AGCH drained: multiframes 721, imm.ass 80, imm.ass.rej 640 (refs 640), queue limit 32, occupied 0, dropped 0, merged 0, rejected 0, ag-res 720, non-res 0
+AGCH drained: multiframes 241, imm.ass 80, imm.ass.rej 641 (refs 641), queue limit 32, occupied 0, dropped 0, merged 0, rejected 0, ag-res 240, non-res 480
Success
diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c
index 95f1eba3..a6f8cfaf 100644
--- a/tests/paging/paging_test.c
+++ b/tests/paging/paging_test.c
@@ -47,6 +47,7 @@ static void test_paging_smoke(void)
int rc;
uint8_t out_buf[GSM_MACBLOCK_LEN];
struct gsm_time g_time;
+ int is_empty = -1;
printf("Testing that paging messages expire.\n");
/* add paging entry */
@@ -59,12 +60,22 @@ static void test_paging_smoke(void)
g_time.t1 = 0;
g_time.t2 = 0;
g_time.t3 = 6;
- rc = paging_gen_msg(btsb->paging_state, out_buf, &g_time);
+ rc = paging_gen_msg(btsb->paging_state, out_buf, &g_time, &is_empty);
ASSERT_TRUE(rc == 13);
+ ASSERT_TRUE(is_empty == 0);
ASSERT_TRUE(paging_group_queue_empty(btsb->paging_state, 0));
ASSERT_TRUE(paging_queue_length(btsb->paging_state) == 0);
+ /* now test the empty queue */
+ g_time.fn = 0;
+ g_time.t1 = 0;
+ g_time.t2 = 0;
+ g_time.t3 = 6;
+ rc = paging_gen_msg(btsb->paging_state, out_buf, &g_time, &is_empty);
+ ASSERT_TRUE(rc == 6);
+ ASSERT_TRUE(is_empty == 1);
+
/*
* TODO: test all the cases of different amount tmsi/imsi and check
* if we fill the slots in a optimal way.
@@ -76,6 +87,7 @@ static void test_paging_sleep(void)
int rc;
uint8_t out_buf[GSM_MACBLOCK_LEN];
struct gsm_time g_time;
+ int is_empty = -1;
printf("Testing that paging messages expire with sleep.\n");
/* add paging entry */
@@ -91,8 +103,9 @@ static void test_paging_sleep(void)
g_time.t1 = 0;
g_time.t2 = 0;
g_time.t3 = 6;
- rc = paging_gen_msg(btsb->paging_state, out_buf, &g_time);
+ rc = paging_gen_msg(btsb->paging_state, out_buf, &g_time, &is_empty);
ASSERT_TRUE(rc == 13);
+ ASSERT_TRUE(is_empty == 0);
ASSERT_TRUE(paging_group_queue_empty(btsb->paging_state, 0));
ASSERT_TRUE(paging_queue_length(btsb->paging_state) == 0);