Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2012-04-12 04:16:27 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2012-04-12 04:16:27 +0400
commit0e9b5fd9d0b7458a938a02fd73f23b07b462a3ba (patch)
tree89d55526b81cd54ed49f1e9ad07787f9594cc8c0 /mert/BleuScorerTest.cpp
parent366d427ce68e1cd922c0629667dc3ee05e8183c1 (diff)
Add const to return values of overloaded operators.
* This commit prevents developers from doing mistakes like: Point p1, p2, p4; if (p1 + p2 = p4) { // Bang! We actually wanted to compare // the result of two points: (p1 + p2 == p4). // do something. } See, e.g., http://www.gotw.ca/gotw/006.htm for details. * Add more test cases according to this change. * Move a helper function to compare floating point numbers to Util.h.
Diffstat (limited to 'mert/BleuScorerTest.cpp')
-rw-r--r--mert/BleuScorerTest.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/mert/BleuScorerTest.cpp b/mert/BleuScorerTest.cpp
index a40949d78..6b01da0ce 100644
--- a/mert/BleuScorerTest.cpp
+++ b/mert/BleuScorerTest.cpp
@@ -111,19 +111,6 @@ void SetUpReferences(BleuScorer& scorer) {
}
}
-const float kEPS = 0.0001f;
-
-template <typename T>
-bool IsAlmostEqual(T expected, T actual) {
- if (abs(expected - actual) < kEPS) {
- return true;
- } else {
- cerr << "Fail: expected = " << expected
- << " (actual = " << actual << ")" << endl;
- return false;
- }
-}
-
} // namespace
BOOST_AUTO_TEST_CASE(bleu_reference_type) {