diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-02-14 14:18:51 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-03-10 09:22:24 +0100 |
commit | 7503540959f421917a702174616655e9fdd11a24 (patch) | |
tree | 5c30c3f0ab2ecb501b0110b5055f8a0feb19745b /tests/paging | |
parent | 2d725e77f7270550d7173a7c86f30aa1c7b01e5e (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/paging')
-rw-r--r-- | tests/paging/paging_test.c | 17 |
1 files changed, 15 insertions, 2 deletions
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); |