<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">I usually end up tailoring the debug output to the specific test. </p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">You can continue doing that. I use those helpers in tests in 2 different patches in this series and it seem to work quite fine. I don't intend to accommodate to every imaginable use-case.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">when an error occurs, I sometimes needed the position of the difference indicated (usually only during development cycles)</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">That was main motivation for me as well.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Could add hex string API (in a later patch?)</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I'm not really sure how this should look like so I think it's better to be expanded by the person who'd use it that way. It's simply more efficient than me trying to guess someone else's use-case and devise API for it.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">and could add difference position indicator (in a later patch?).</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">It's already there - the position is indicated by !! sign when printing msgb and data arrays side-by-side.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><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></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I'd rather not spend too much time on this. This patch emerged as a simple way to aid in testing LCLS-related encoders/decoders where I've got to compare rather long arrays and wanted to be able to easily see where they differ.</p><p style="white-space: pre-wrap; word-wrap: break-word;">It would be nice to digg through msgb API but I'm afraid there're more pressing tasks ATM.</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;">one slight problem with LOGP could be that in regression tests, we often only check stdout.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">That should be fixed by additional patches before this one in latest revision.</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: Tue, 04 Dec 2018 12:01:28 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>