<p>In <a href="https://github.com/mlpack/mlpack/pull/683#discussion_r66124752">src/mlpack/tests/ind2sub_test.cpp</a>:</p>
<pre style='color:#555'>> +//#include <mlpack/methods/edge_boxes/structured_tree.hpp>
> +
> +#include <boost/test/unit_test.hpp>
> +#include "old_boost_test_definitions.hpp"
> +BOOST_AUTO_TEST_SUITE(ind2sub_test);
> +
> +/**
> + * This tests handles the case wherein only one class exists in the input
> + * labels. It checks whether the only class supplied was the only class
> + * predicted.
> + */
> +BOOST_AUTO_TEST_CASE(ind2sub_test)
> +{
> + arma::mat A = arma::randu(5,5);
> + arma::uvec u = arma::ind2sub(arma::size(A), 3);
> + u.print();
</pre>
<p>Hmm, this test doesn't actually test anything, do you think that we can test the output with <code>BOOST_REQUIRE_EQUAL</code>? I don't know what the output values of u are supposed to be, but maybe something like</p>
<pre><code>BOOST_REQUIRE_EQUAL(u(0), 0);
BOOST_REQUIRE_EQUAL(u(1), 3);
</code></pre>
<p>Technically I don't think we need to test Armadillo support since Armadillo should already be testing that, but, one nice thing this test <em>does</em> do is ensure that ind2sub() compiles correctly. If you like, we can also add a very simple test like this for sub2ind().</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, <a href="https://github.com/mlpack/mlpack/pull/683/files/1dfb208c7f4d652a2d194d8e5159e816cf629cb8#r66124752">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFMO9Eu2DD68gM4T7nn7B-snHf4Sjks5qJbX_gaJpZM4IvUrl">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFH2ULCtyiMIaoteurj4bGX6qPviYks5qJbX_gaJpZM4IvUrl.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/683/files/1dfb208c7f4d652a2d194d8e5159e816cf629cb8#r66124752"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>