summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-25 17:27:15 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-25 17:33:30 +0100
commitbe8e775776b2f39fe8a31412a4fcaaf5dcaae25e (patch)
treea8e5ae6df8371bca1d5d586a669e60a291944054
parent98a95ac17f701d94d2fa62d91cfe42a5beef4f23 (diff)
db: Extend the test to mark a SMS as delivered and verify it
Mark the SMS as delivered, then free it and try to get an undelivered SMS to that subscriber again and make sure it is failing.
-rw-r--r--openbsc/tests/db/db_test.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c
index 62fbb732e..a02d1f801 100644
--- a/openbsc/tests/db/db_test.c
+++ b/openbsc/tests/db/db_test.c
@@ -116,6 +116,13 @@ static void test_sms(void)
OSMO_ASSERT(sms->user_data_len == strlen("UserData123"));
OSMO_ASSERT(strcmp((char *) sms->user_data, "UserData123") == 0);
+ /* Mark the SMS as delivered */
+ db_sms_mark_delivered(sms);
+ sms_free(sms);
+
+ sms = db_sms_get_unsent_for_subscr(subscr);
+ OSMO_ASSERT(!sms);
+
subscr_put(subscr);
}