osmith has uploaded this change for review. ( https://gerrit.osmocom.org/12410


Change subject: GSUP: add end marker to enum osmo_gsup_iei
......................................................................

GSUP: add end marker to enum osmo_gsup_iei

Simplify gsup_test.c by defining an end marker in gsup.h. No need to
manually update the last element every time anymore.

Change-Id: I2aab7245e209f0ebd2f33a83d4d181dd3339cb17
---
M include/osmocom/gsm/gsup.h
M tests/gsup/gsup_test.c
2 files changed, 3 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/12410/1

diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h
index 74631ec..14abcae 100644
--- a/include/osmocom/gsm/gsup.h
+++ b/include/osmocom/gsm/gsup.h
@@ -101,6 +101,8 @@

        OSMO_GSUP_IMEI_IE                       = 0x50,
        OSMO_GSUP_IMEI_RESULT_IE                = 0x51,
+
+       OSMO_GSUP_IEI_END_MARKER
 };

 /*! GSUP message type */
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index 7c9ee60..7012399 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -434,11 +434,7 @@
                                        osmo_hexdump(t->data + j, ie_end - j));

                                OSMO_ASSERT(j <= ie_end - 2);
-                               /**
-                                * FIXME: share the maximal IE value somehow
-                                * in order to avoid manual updating of this
-                                */
-                               OSMO_ASSERT(t->data[j+0] <= 
OSMO_GSUP_IMEI_RESULT_IE);
+                               OSMO_ASSERT(t->data[j+0] <= 
OSMO_GSUP_IEI_END_MARKER - 1);
                                OSMO_ASSERT(t->data[j+1] <= ie_end - j - 2);

                                ie_end = j;

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2aab7245e209f0ebd2f33a83d4d181dd3339cb17
Gerrit-Change-Number: 12410
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>

Reply via email to