Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/13977


Change subject: sms_queue_test: assert return value of osmo_use_count_get_put()
......................................................................

sms_queue_test: assert return value of osmo_use_count_get_put()

Change-Id: I9381e88435ccd856ec619135ca9999c15c25d436
Fixes: CID#198416
---
M tests/sms_queue/sms_queue_test.c
1 file changed, 4 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/77/13977/1

diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c
index 495e078..25fc312 100644
--- a/tests/sms_queue/sms_queue_test.c
+++ b/tests/sms_queue/sms_queue_test.c
@@ -96,7 +96,7 @@
        static struct vlr_subscr arbitrary_vsub = {};
        static bool arbitrary_vsub_set_up = false;
        struct gsm_sms *sms;
-       int i;
+       int i, rc = 0;
        printf("     hitting database: looking for MSISDN > '%s', 
failed_attempts <= %d\n",
               last_msisdn, max_failed);

@@ -110,9 +110,10 @@
         * may call vlr_subscr_put() on our arbitrary_vsub, what would
         * lead to a segfault if its use_count <= 0. To prevent this,
         * let's ensure a big enough initial value. */
-       osmo_use_count_get_put(&arbitrary_vsub.use_count, 
VSUB_USE_SMS_RECEIVER, 1000);
-       osmo_use_count_get_put(&arbitrary_vsub.use_count, VSUB_USE_SMS_PENDING, 
1000);
+       rc += osmo_use_count_get_put(&arbitrary_vsub.use_count, 
VSUB_USE_SMS_RECEIVER, 1000);
+       rc += osmo_use_count_get_put(&arbitrary_vsub.use_count, 
VSUB_USE_SMS_PENDING, 1000);
        arbitrary_vsub.lu_complete = true;
+       OSMO_ASSERT(rc == 0);

        for (i = 0; i < ARRAY_SIZE(fake_sms_db); i++) {
                if (!fake_sms_db[i].nr_of_sms)

--
To view, visit https://gerrit.osmocom.org/13977
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9381e88435ccd856ec619135ca9999c15c25d436
Gerrit-Change-Number: 13977
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <[email protected]>

Reply via email to