<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12410">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">GSUP: add end marker to enum osmo_gsup_iei<br><br>Simplify gsup_test.c by defining an end marker in gsup.h. No need to<br>manually update the last element every time anymore.<br><br>Change-Id: I2aab7245e209f0ebd2f33a83d4d181dd3339cb17<br>---<br>M include/osmocom/gsm/gsup.h<br>M tests/gsup/gsup_test.c<br>2 files changed, 3 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/12410/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h</span><br><span>index 74631ec..14abcae 100644</span><br><span>--- a/include/osmocom/gsm/gsup.h</span><br><span>+++ b/include/osmocom/gsm/gsup.h</span><br><span>@@ -101,6 +101,8 @@</span><br><span> </span><br><span>       OSMO_GSUP_IMEI_IE                       = 0x50,</span><br><span>      OSMO_GSUP_IMEI_RESULT_IE                = 0x51,</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     OSMO_GSUP_IEI_END_MARKER</span><br><span> };</span><br><span> </span><br><span> /*! GSUP message type */</span><br><span>diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c</span><br><span>index 7c9ee60..7012399 100644</span><br><span>--- a/tests/gsup/gsup_test.c</span><br><span>+++ b/tests/gsup/gsup_test.c</span><br><span>@@ -434,11 +434,7 @@</span><br><span>                                   osmo_hexdump(t->data + j, ie_end - j));</span><br><span> </span><br><span>                               OSMO_ASSERT(j <= ie_end - 2);</span><br><span style="color: hsl(0, 100%, 40%);">-                                /**</span><br><span style="color: hsl(0, 100%, 40%);">-                              * FIXME: share the maximal IE value somehow</span><br><span style="color: hsl(0, 100%, 40%);">-                             * in order to avoid manual updating of this</span><br><span style="color: hsl(0, 100%, 40%);">-                             */</span><br><span style="color: hsl(0, 100%, 40%);">-                             OSMO_ASSERT(t->data[j+0] <= OSMO_GSUP_IMEI_RESULT_IE);</span><br><span style="color: hsl(120, 100%, 40%);">+                          OSMO_ASSERT(t->data[j+0] <= OSMO_GSUP_IEI_END_MARKER - 1);</span><br><span>                             OSMO_ASSERT(t->data[j+1] <= ie_end - j - 2);</span><br><span> </span><br><span>                               ie_end = j;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12410">change 12410</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/12410"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I2aab7245e209f0ebd2f33a83d4d181dd3339cb17 </div>
<div style="display:none"> Gerrit-Change-Number: 12410 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>