[PATCH libosmocore 4/8] smscb test: support a list of L1 messages to test
Alex Badea
vamposdecampos at gmail.com
Sat Jan 5 20:26:28 CET 2013
Signed-off-by: Alex Badea <vamposdecampos at gmail.com>
---
tests/smscb/smscb_test.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/tests/smscb/smscb_test.c b/tests/smscb/smscb_test.c
index de88b0a..80cf69c 100644
--- a/tests/smscb/smscb_test.c
+++ b/tests/smscb/smscb_test.c
@@ -38,10 +38,13 @@
static struct log_info info = {};
-static uint8_t smscb_null_l1_msg[] = {
- 0x2f, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
- 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
- 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+static uint8_t smscb_test_messages[][23] = {
+ /* NULL message */
+ {
+ 0x2f, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+ 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+ 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+ },
};
static int l3_cb(struct msgb *msg, struct smscb_entity *se, void *ctx)
@@ -82,10 +85,12 @@ static int smscb_send(struct smscb_entity *se, const void *data, size_t len)
static void test_reassembly(void)
{
struct smscb_entity se;
+ int k;
smscb_init(&se);
smscb_set_l3(&se, l3_cb, NULL);
- smscb_send(&se, smscb_null_l1_msg, sizeof(smscb_null_l1_msg));
+ for (k = 0; k < ARRAY_SIZE(smscb_test_messages); k++)
+ smscb_send(&se, smscb_test_messages[k], sizeof(smscb_test_messages[k]));
smscb_exit(&se);
}
--
1.7.0.4
More information about the baseband-devel
mailing list