From ea401b7dd3ac7b46c217ca9f738370bf5b0a2f24 Mon Sep 17 00:00:00 2001 From: jeffinsam Date: Sun, 3 Nov 2019 11:24:16 +0530 Subject: [PATCH] Add callback test for lmnn --- src/mlpack/tests/lmnn_test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mlpack/tests/lmnn_test.cpp b/src/mlpack/tests/lmnn_test.cpp index 43e772691b..fb0e7f2fc5 100644 --- a/src/mlpack/tests/lmnn_test.cpp +++ b/src/mlpack/tests/lmnn_test.cpp @@ -357,7 +357,10 @@ BOOST_AUTO_TEST_CASE(LMNNSGDSimpleDatasetTest) LMNN<> lmnn(dataset, labels, 1); arma::mat outputMatrix; - lmnn.LearnDistance(outputMatrix); + std::stringstream stream; + + lmnn.LearnDistance(outputMatrix, ens::ProgressBar(70, stream)); + BOOST_REQUIRE_GT(stream.str().length(), 0); // Ensure that the objective function is better now. LMNNFunction<> lmnnfn(dataset, labels, 1, 0.6, 1);