diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-26 15:25:30 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-26 15:25:30 +0300 |
commit | eba9bddc89a584a646fc4b8f0ef27451d43a331e (patch) | |
tree | 4e7e7e15019980da383cc70e8918208c71a6c78e /moses/WordsBitmapTest.cpp | |
parent | f82a79d59652abd4a4430126969270ea37fe94ec (diff) |
unit test. Doesn't run on my machine
Diffstat (limited to 'moses/WordsBitmapTest.cpp')
-rw-r--r-- | moses/WordsBitmapTest.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/moses/WordsBitmapTest.cpp b/moses/WordsBitmapTest.cpp index 0a7bd7324..579edcb77 100644 --- a/moses/WordsBitmapTest.cpp +++ b/moses/WordsBitmapTest.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <vector> -#include "WordsBitmap.h" +#include "Bitmap.h" using namespace Moses; using namespace std; @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_SUITE(bitmap) BOOST_AUTO_TEST_CASE(initialise) { - WordsBitmap wbm(5); + Bitmap wbm(5); BOOST_CHECK_EQUAL(wbm.GetSize(),5); for (size_t i = 0; i < 5; ++i) { BOOST_CHECK_EQUAL(wbm.GetValue(i),false); @@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE(initialise) bitvec[3] = true; bitvec[7] = true; - WordsBitmap wbm2(7,bitvec); + Bitmap wbm2(7,bitvec); BOOST_CHECK_EQUAL(wbm2.GetSize(),7); for (size_t i = 0; i < 7; ++i) { if (i != 2 && i != 3) { @@ -54,17 +54,17 @@ BOOST_AUTO_TEST_CASE(initialise) bitvec[0] = true; bitvec[1] = true; - WordsBitmap wbm3(7,bitvec); + Bitmap wbm3(7,bitvec); BOOST_CHECK_EQUAL(wbm3.GetFirstGapPos(),4); - WordsBitmap wbm4(4,bitvec); + Bitmap wbm4(4,bitvec); BOOST_CHECK_EQUAL(wbm4.GetFirstGapPos(),NOT_FOUND); } BOOST_AUTO_TEST_CASE(getset) { - WordsBitmap wbm(6); + Bitmap wbm(6); wbm.SetValue(1,true); BOOST_CHECK_EQUAL(wbm.GetValue(1),true); BOOST_CHECK_EQUAL(wbm.GetValue(2),false); @@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE(getset) BOOST_CHECK_EQUAL(wbm.GetValue(3),true); BOOST_CHECK_EQUAL(wbm.GetValue(4),false); - WordsBitmap wbm2(6); + Bitmap wbm2(6); WordsRange wr(2,4); wbm2.SetValue(wr,true); BOOST_CHECK_EQUAL(wbm2.GetValue(2),true); @@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(getset) BOOST_AUTO_TEST_CASE(covered) { - WordsBitmap wbm(10); + Bitmap wbm(10); BOOST_CHECK_EQUAL(wbm.GetNumWordsCovered(), 0); wbm.SetValue(1,true); wbm.SetValue(2,true); @@ -110,7 +110,7 @@ BOOST_AUTO_TEST_CASE(covered) BOOST_AUTO_TEST_CASE(positions) { - WordsBitmap wbm(10); + Bitmap wbm(10); wbm.SetValue(0,true); wbm.SetValue(1,true); wbm.SetValue(3,true); @@ -133,12 +133,12 @@ BOOST_AUTO_TEST_CASE(positions) wbm.SetValue(wr,false); BOOST_CHECK_EQUAL(wbm.GetFirstGapPos(),2); - WordsBitmap wbm2(2); + Bitmap wbm2(2); wbm2.SetValue(0,true); wbm2.SetValue(1,true); BOOST_CHECK_EQUAL(wbm2.GetFirstGapPos(), NOT_FOUND); - WordsBitmap wbm3(5); + Bitmap wbm3(5); BOOST_CHECK_EQUAL(wbm3.GetFirstGapPos(), 0); BOOST_CHECK_EQUAL(wbm3.GetLastGapPos(), 4); BOOST_CHECK_EQUAL(wbm3.GetLastPos(), NOT_FOUND); |