From cfe2c195eaaff6f950a939cfe4edab0c3ca72d9c Mon Sep 17 00:00:00 2001 From: Prabhat Date: Sat, 3 Mar 2018 12:19:51 +0530 Subject: [PATCH] Minor change --- src/mlpack/tests/main_tests/kmeans_test.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mlpack/tests/main_tests/kmeans_test.cpp b/src/mlpack/tests/main_tests/kmeans_test.cpp index d7302310eb..e55399d764 100644 --- a/src/mlpack/tests/main_tests/kmeans_test.cpp +++ b/src/mlpack/tests/main_tests/kmeans_test.cpp @@ -231,7 +231,11 @@ BOOST_AUTO_TEST_CASE(KmClusteringEmptyClustersCheck) ResetKmSettings(); - BOOST_REQUIRE_GT(arma::accu(killEmptyOutput != allowEmptyOutput), 1); + if (killEmptyOutput.n_elem == allowEmptyOutput.n_elem) + { + BOOST_REQUIRE_GT(arma::accu(killEmptyOutput != allowEmptyOutput), 1); + BOOST_REQUIRE_GT(arma::accu(killEmptyOutput != normalOutput), 1); + } BOOST_REQUIRE_GT(arma::accu(normalOutput != allowEmptyOutput), 1); }