<p>In <a href="https://github.com/mlpack/mlpack/pull/581#discussion_r57175342">src/mlpack/tests/cosine_tree_test.cpp</a>:</p>
<pre style='color:#555'>> + numMax2Errors++;
> +
> + for (j = 0, k = i; j < rightIndices.size(); j++, k++)
> + if(cosineMax2 - cosines(k) <= cosines(k) - cosineMin - precision)
> + numMax2Errors++;
> +
> + if(numMax1Errors > 0 && numMax2Errors > 0)
> + {
> + // cosineMax and cosineMax2 do not match
> + // we should report the problem
> +         for (i = 0; i < leftIndices.size(); i++)
> + BOOST_CHECK_LT(cosineMax - cosines(i), cosines(i) - cosineMin);
> +
> + for (j = 0, k = i; j < rightIndices.size(); j++, k++)
> + BOOST_CHECK_GT(cosineMax - cosines(k), cosines(k) - cosineMin);
> + }
</pre>
<p>Do you think we could replace this if block with just</p>
<pre><code>BOOST_REQUIRE_EQUAL(numMax1Errors, 0);
BOOST_REQUIRE_EQUAL(numMax2Errors, 0);
</code></pre>
<p>If that fails, it won't print as much information, but even so the <code>BOOST_CHECK_LT</code> calls won't print enough useful information to debug the problem without digging deeper.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/581/files/e5076dbce032c7f66f295b10729f375ccfe89cec#r57175342">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFPQgZzapVvXqp5ht7rrVCMwOho7qks5pwVd2gaJpZM4HzbKc.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/581/files/e5076dbce032c7f66f295b10729f375ccfe89cec#r57175342"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>