<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'>&gt; +            numMax2Errors++;
&gt; +
&gt; +        for (j = 0, k = i; j &lt; rightIndices.size(); j++, k++)
&gt; +          if(cosineMax2 - cosines(k) &lt;= cosines(k) - cosineMin - precision)
&gt; +            numMax2Errors++;
&gt; +
&gt; +        if(numMax1Errors &gt; 0 &amp;&amp; numMax2Errors &gt; 0)
&gt; +        {
&gt; +          // cosineMax and cosineMax2 do not match
&gt; +          // we should report the problem
&gt; +              for (i = 0; i &lt; leftIndices.size(); i++)
&gt; +            BOOST_CHECK_LT(cosineMax - cosines(i), cosines(i) - cosineMin);
&gt; +
&gt; +          for (j = 0, k = i; j &lt; rightIndices.size(); j++, k++)
&gt; +            BOOST_CHECK_GT(cosineMax - cosines(k), cosines(k) - cosineMin);
&gt; +        }
</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;">&mdash;<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>