<p style="white-space: pre-wrap; word-wrap: break-word;">nice idea to add general tests helpers. Things that complicate the idea:</p><ul><li>tests often have different output scenarios: {printf,LOG}x{stdout,stderr}x{checked,unchecked} so I usually end up tailoring the debug output to the specific test. fprintf(stdout) is ok in test.c but not in libosmocore API.</li></ul><ul><li>when an error occurs, I sometimes needed the position of the difference indicated (usually only during development cycles)</li></ul><ul><li>usually when I write tests, I use hex strings instead of buffers, because they are easily editable and imply the length.</li></ul><p style="white-space: pre-wrap; word-wrap: break-word;">It's not so easy to accomodate all current test styles, but we could with this API define how tests should be written from now on. Could add hex string API (in a later patch?) and could add difference position indicator (in a later patch?).</p><p style="white-space: pre-wrap; word-wrap: break-word;">Might be interesting to take a look through other msgb/buffer printing routines flying around in various tests today? Maybe figure out a smaller set of API satisfying all cases?</p><p>Patch set 5:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #d4ffd4;">Code-Review +1</span></p><p><a href="https://gerrit.osmocom.org/12017">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/12017/5/src/msgb.c">File src/msgb.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/12017/5/src/msgb.c@198">Patch Set #5, Line 198:</a> <code style="font-family:monospace,monospace">printf</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">ACK</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">one slight problem with LOGP could be that in regression tests, we often only check stdout.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/12017">change 12017</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/12017"/><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: comment </div>
<div style="display:none"> Gerrit-Change-Id: I3bc95f2f5ab6e3f4b502647fb3e0aaaf1f7c4cf5 </div>
<div style="display:none"> Gerrit-Change-Number: 12017 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </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: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 03 Dec 2018 17:48:15 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>