<p><a href="https://gerrit.osmocom.org/12556">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12556/9/tests/trans/trans_test.c">File tests/trans/trans_test.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12556/9/tests/trans/trans_test.c@68">Patch Set #9, Line 68:</a> <code style="font-family:monospace,monospace">base_callref</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">What's the point of using static counter? What would be the advantage compared to explicitly passing […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">We would avoid one meaningless parameter ;)</p><p style="white-space: pre-wrap; word-wrap: break-word;">As a bonus, you could reflect values of this static counter in the logging output,<br>instead of counting the amount of allocated transactions manually.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12556/9/tests/trans/trans_test.c@94">Patch Set #9, Line 94:</a> <code style="font-family:monospace,monospace">vlr_subscr_name</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I don't think we have function to print ran-conn itself and there's 1:1 mapping between VLR subscrib […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Ok, I see. What about this?</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  LOG_RAN_CONN_CAT(t->conn, DCC, LOGL_DEBUG, "Connection assigned to transaction\n");</pre><p style="white-space: pre-wrap; word-wrap: break-word;">Off-topic: Now I think that we need something like LOG_TRANS and LOG_TRANS_CAT() for transactions.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/12556/9/tests/trans/trans_test.c@134">Patch Set #9, Line 134:</a> <code style="font-family:monospace,monospace">base_callref</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">>> The key idea is that allocating multiple transactions with<br>>> same callref is wrong, and we shouldn't do this at least<br>>> in tests.<br>><br>> I strongly disagree. We should never try to "fix" issues by<br>> making tests behave differently from the code.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Actually, your test case behaves differently from the code.<br>You won't see any existing code parts, which *intentionally<br>use same callref* for new transactions. Despite potentially<br>this may happen (e.g. triggered by external MNCC / EUSE).</p><p style="white-space: pre-wrap; word-wrap: break-word;">So, I don't ask you to fix trans_alloc(), I ask you not to use<br>the same callref value for multiple transactions.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">The right way is to add test which illustrate current code<br>behavior (even if it's wrong), than fix the code and update<br>the test accordingly.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Yes, and this is what I would like to see in this (or in a<br>subsequent) change. Please illustrate the current behavior<br>(e.g. in a separate test_trans_callref function) by allocating<br>a few transactions with same callref, and print some warning<br>until trans_alloc() is fixed.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12556">change 12556</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/12556"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I78dfb7cd35073a305cf668beda7d9d58d5a5a713 </div>
<div style="display:none"> Gerrit-Change-Number: 12556 </div>
<div style="display:none"> Gerrit-PatchSet: 9 </div>
<div style="display:none"> Gerrit-Owner: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 15 Jan 2019 12:10:41 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>