diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-25 16:31:44 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-25 16:31:44 +0400 |
commit | 377d971c5d5220735d104884ea3fdf8320f64761 (patch) | |
tree | 14c372da8f72c8f9fda26fdd55c03aa79c29f552 /mert/OptimizerFactoryTest.cpp | |
parent | ac5ba83ec873491e72c406679aa386fd8924dabf (diff) |
Use assertions in the test case.
Diffstat (limited to 'mert/OptimizerFactoryTest.cpp')
-rw-r--r-- | mert/OptimizerFactoryTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mert/OptimizerFactoryTest.cpp b/mert/OptimizerFactoryTest.cpp index 7fb1bdc0b..645360129 100644 --- a/mert/OptimizerFactoryTest.cpp +++ b/mert/OptimizerFactoryTest.cpp @@ -7,14 +7,14 @@ namespace { -inline void CheckBuildOptimizer(unsigned dim, +inline bool CheckBuildOptimizer(unsigned dim, const vector<unsigned>& to_optimize, const vector<parameter_t>& start, const string& type, unsigned int num_random) { boost::scoped_ptr<Optimizer> optimizer( OptimizerFactory::BuildOptimizer(dim, to_optimize, start, type, num_random)); - BOOST_CHECK(optimizer.get() != NULL); + return optimizer.get() != NULL; } } // namespace @@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(optimizer_build) { start.push_back(0.2); const unsigned int num_random = 1; - CheckBuildOptimizer(dim, to_optimize, start, "powell", num_random); - CheckBuildOptimizer(dim, to_optimize, start, "random", num_random); - CheckBuildOptimizer(dim, to_optimize, start, "random-direction", num_random); + BOOST_CHECK(CheckBuildOptimizer(dim, to_optimize, start, "powell", num_random)); + BOOST_CHECK(CheckBuildOptimizer(dim, to_optimize, start, "random", num_random)); + BOOST_CHECK(CheckBuildOptimizer(dim, to_optimize, start, "random-direction", num_random)); } |