diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-05-31 13:57:24 +0200 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-05-31 13:57:24 +0200 |
commit | 6f6601111710aa67eee5169e5b7d89102cc33bb8 (patch) | |
tree | 0872544abd6bc76162f3f80eb3920999afbf2c34 /dpmert/lo_test.cc | |
parent | 8cee8b565a9c56a7732365e9563f52ff3c4ff7fd (diff) | |
parent | 090a64e73f94a6a35e5364a9d416dcf75c0a2938 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'dpmert/lo_test.cc')
-rw-r--r-- | dpmert/lo_test.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dpmert/lo_test.cc b/dpmert/lo_test.cc index d47a95b5..2daf87bb 100644 --- a/dpmert/lo_test.cc +++ b/dpmert/lo_test.cc @@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE(TestConvexHullInside) { if (!d) break; cerr << log(d->score) << " ||| " << TD::GetString(d->yield) << " ||| " << d->feature_values << endl; } - for (int i = 0; i < segs.size(); ++i) { + for (unsigned i = 0; i < segs.size(); ++i) { cerr << "seg=" << i << endl; vector<WordID> trans; segs[i]->ConstructTranslation(&trans); @@ -118,13 +118,15 @@ BOOST_AUTO_TEST_CASE( TestS1) { to_optimize.push_back(fPhraseModel_1); to_optimize.push_back(fPhraseModel_2); + std::string path(boost::unit_test::framework::master_test_suite().argc == 2 ? boost::unit_test::framework::master_test_suite().argv[1] : "test_data"); + Hypergraph hg; - ReadFile rf("./test_data/0.json.gz"); + ReadFile rf(path + "/0.json.gz"); HypergraphIO::ReadFromJSON(rf.stream(), &hg); hg.Reweight(wts); Hypergraph hg2; - ReadFile rf2("./test_data/1.json.gz"); + ReadFile rf2(path + "/1.json.gz"); HypergraphIO::ReadFromJSON(rf2.stream(), &hg2); hg2.Reweight(wts); @@ -149,7 +151,7 @@ BOOST_AUTO_TEST_CASE( TestS1) { &rng, &axes); assert(axes.size() == 10 + to_optimize.size()); - for (int i = 0; i < axes.size(); ++i) + for (unsigned i = 0; i < axes.size(); ++i) cerr << axes[i] << endl; const SparseVector<double>& axis = axes[0]; |