<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/25205">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">tests/stats: show how last item sent may be wrong<br><br>Extend the test to illustrate the bug described in the related issue,<br>which will be fixed with the next patch.<br><br>Related: OS#5215<br>Change-Id: I1d26867ac1b837bea6a9754a3203e53c147e7a5f<br>---<br>M tests/stats/stats_test.c<br>M tests/stats/stats_test.err<br>2 files changed, 12 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/25205/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/stats/stats_test.c b/tests/stats/stats_test.c</span><br><span>index 15f50d2..6702131 100644</span><br><span>--- a/tests/stats/stats_test.c</span><br><span>+++ b/tests/stats/stats_test.c</span><br><span>@@ -442,6 +442,16 @@</span><br><span>         osmo_stats_report();</span><br><span>         OSMO_ASSERT(send_count == 2);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     fprintf(stderr, "report (group 1, no update, send last item (!= last max), OS#5215):\n");</span><br><span style="color: hsl(120, 100%, 40%);">+   send_count = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+       osmo_stats_report();</span><br><span style="color: hsl(120, 100%, 40%);">+  OSMO_ASSERT(send_count == 0); /* BUG: should be 2! */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       fprintf(stderr, "report (group 1, no update, nothing to send):\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ send_count = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+       osmo_stats_report();</span><br><span style="color: hsl(120, 100%, 40%);">+  OSMO_ASSERT(send_count == 0);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>      fprintf(stderr, "report (remove statg1, ctrg1):\n");</span><br><span>       /* force single flush */</span><br><span>     srep1->force_single_flush = 1;</span><br><span>diff --git a/tests/stats/stats_test.err b/tests/stats/stats_test.err</span><br><span>index 69104d9..f76783c 100644</span><br><span>--- a/tests/stats/stats_test.err</span><br><span>+++ b/tests/stats/stats_test.err</span><br><span>@@ -115,6 +115,8 @@</span><br><span> report (group 1, item 1 update twice, check max):</span><br><span>   test2: item p= g=test.one i=1 n=item.a v=20 u=ma</span><br><span>   test1: item p= g=test.one i=1 n=item.a v=20 u=ma</span><br><span style="color: hsl(120, 100%, 40%);">+report (group 1, no update, send last item (!= last max), OS#5215):</span><br><span style="color: hsl(120, 100%, 40%);">+report (group 1, no update, nothing to send):</span><br><span> report (remove statg1, ctrg1):</span><br><span>   test2: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0</span><br><span>   test1: counter p= g=ctr-test:one_dot i=3 n=ctr:a v=0 d=0</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/25205">change 25205</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/c/libosmocore/+/25205"/><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-Change-Id: I1d26867ac1b837bea6a9754a3203e53c147e7a5f </div>
<div style="display:none"> Gerrit-Change-Number: 25205 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>