[mlpack] 114/207: Added reset flag, but test fails on something else entirely?

Barak A. Pearlmutter barak+git at pearlmutter.net
Thu Mar 23 17:53:45 UTC 2017


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch master
in repository mlpack.

commit 9ef1a8d4f98db54a2195aca0cc05f93216b140df
Author: Govind Gopakumar <govind.93 at gmail.com>
Date:   Thu Mar 2 01:39:06 2017 +0530

    Added reset flag, but test fails on something else entirely?
---
 src/mlpack/tests/load_save_test.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/mlpack/tests/load_save_test.cpp b/src/mlpack/tests/load_save_test.cpp
index 8aee7d8..9806971 100644
--- a/src/mlpack/tests/load_save_test.cpp
+++ b/src/mlpack/tests/load_save_test.cpp
@@ -28,9 +28,10 @@ BOOST_AUTO_TEST_SUITE(LoadSaveTest);
 BOOST_AUTO_TEST_CASE(NoExtensionLoad)
 {
   arma::mat out;
+  bool lflag = Log::Warn.ignoreInput;
   Log::Warn.ignoreInput = true;
   BOOST_REQUIRE(data::Load("noextension", out) == false);
-//  Log::Warn.ignoreInput = false;
+  Log::Warn.ignoreInput = lflag;
 }
 
 /**
@@ -39,9 +40,10 @@ BOOST_AUTO_TEST_CASE(NoExtensionLoad)
 BOOST_AUTO_TEST_CASE(NoExtensionSave)
 {
   arma::mat out;
+  bool lflag = Log::Warn.ignoreInput;
   Log::Warn.ignoreInput = true;
   BOOST_REQUIRE(data::Save("noextension", out) == false);
- // Log::Warn.ignoreInput = false;
+  Log::Warn.ignoreInput = lflag;
 }
 
 /**
@@ -50,9 +52,10 @@ BOOST_AUTO_TEST_CASE(NoExtensionSave)
 BOOST_AUTO_TEST_CASE(NotExistLoad)
 {
   arma::mat out;
+  bool lflag = Log::Warn.ignoreInput;
   Log::Warn.ignoreInput = true;
   BOOST_REQUIRE(data::Load("nonexistentfile_______________.csv", out) == false);
-  //Log::Warn.ignoreInput = false;
+  Log::Warn.ignoreInput = lflag;
 }
 
 /**
@@ -457,9 +460,10 @@ BOOST_AUTO_TEST_CASE(LoadRawBinaryTest)
       == true);
 
   // Now reload through our interface.
+  bool lflag = Log::Warn.ignoreInput;
   Log::Warn.ignoreInput = true;
   BOOST_REQUIRE(data::Load("test_file.bin", test) == true);
-//  Log::Warn.ignoreInput = false;
+  Log::Warn.ignoreInput = lflag;
 
   BOOST_REQUIRE_EQUAL(test.n_rows, 1);
   BOOST_REQUIRE_EQUAL(test.n_cols, 8);
@@ -652,12 +656,13 @@ BOOST_AUTO_TEST_CASE(NoHDF5Test)
   test.randu(5, 5);
 
   // Stop warnings.
+  bool lflag = Log::Warn.ignoreInput;
   Log::Warn.ignoreInput = true;
   BOOST_REQUIRE(data::Save("test_file.h5", test) == false);
   BOOST_REQUIRE(data::Save("test_file.hdf5", test) == false);
   BOOST_REQUIRE(data::Save("test_file.hdf", test) == false);
   BOOST_REQUIRE(data::Save("test_file.he5", test) == false);
-//  Log::Warn.ignoreInput = false;
+  Log::Warn.ignoreInput = lflag;
 }
 #endif
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list