diff options
Diffstat (limited to 'indexlib/tests/ifile-test.cpp')
-rw-r--r-- | indexlib/tests/ifile-test.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/indexlib/tests/ifile-test.cpp b/indexlib/tests/ifile-test.cpp index 955098663..9b9f92832 100644 --- a/indexlib/tests/ifile-test.cpp +++ b/indexlib/tests/ifile-test.cpp @@ -37,17 +37,17 @@ void simple() { cleanup(); ifile ifi( fname ); ifi.add( "this", "doc" ); - BOOST_CHECK_ETQUAL( ifi.search( "this" )->list().size(), 1u ); - BOOST_CHECK_ETQUAL( ifi.search( "this" )->list()[ 0 ], 0 ); - BOOST_CHECK_ETQUAL( ifi.lookup_docname( ifi.search( "this" )->list()[ 0 ] ), "doc" ); + BOOST_CHECK_EQUAL( ifi.search( "this" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "this" )->list()[ 0 ], 0 ); + BOOST_CHECK_EQUAL( ifi.lookup_docname( ifi.search( "this" )->list()[ 0 ] ), "doc" ); ifi.add( "that", "doc2" ); - BOOST_CHECK_ETQUAL( ifi.search( "this" )->list().size(), 1u ); - BOOST_CHECK_ETQUAL( ifi.search( "this" )->list()[ 0 ], 0 ); - BOOST_CHECK_ETQUAL( ifi.lookup_docname( ifi.search( "this" )->list()[ 0 ] ), "doc" ); + BOOST_CHECK_EQUAL( ifi.search( "this" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "this" )->list()[ 0 ], 0 ); + BOOST_CHECK_EQUAL( ifi.lookup_docname( ifi.search( "this" )->list()[ 0 ] ), "doc" ); - BOOST_CHECK_ETQUAL( ifi.search( "that" )->list().size(), 1u ); - BOOST_CHECK_ETQUAL( ifi.search( "that" )->list()[ 0 ], 1 ); - BOOST_CHECK_ETQUAL( ifi.lookup_docname( ifi.search( "that" )->list()[ 0 ] ), "doc2" ); + BOOST_CHECK_EQUAL( ifi.search( "that" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "that" )->list()[ 0 ], 1 ); + BOOST_CHECK_EQUAL( ifi.lookup_docname( ifi.search( "that" )->list()[ 0 ] ), "doc2" ); } void ndocs() { @@ -55,16 +55,16 @@ void ndocs() { ifile ifi( fname ); ifi.add( "one", "one" ); ifi.add( "one", "two" ); - BOOST_CHECK_ETQUAL( ifi.ndocs(), 2 ); + BOOST_CHECK_EQUAL( ifi.ndocs(), 2 ); ifi.add( "one", "three" ); ifi.add( "one", "four" ); - BOOST_CHECK_ETQUAL( ifi.ndocs(), 4 ); - BOOST_CHECK_ETQUAL( ifi.lookup_docname( 0 ), std::string( "one" ) ); - BOOST_CHECK_ETQUAL( ifi.lookup_docname( 1 ), std::string( "two" ) ); - BOOST_CHECK_ETQUAL( ifi.lookup_docname( 2 ), std::string( "three" ) ); - BOOST_CHECK_ETQUAL( ifi.lookup_docname( 3 ), std::string( "four" ) ); + BOOST_CHECK_EQUAL( ifi.ndocs(), 4 ); + BOOST_CHECK_EQUAL( ifi.lookup_docname( 0 ), std::string( "one" ) ); + BOOST_CHECK_EQUAL( ifi.lookup_docname( 1 ), std::string( "two" ) ); + BOOST_CHECK_EQUAL( ifi.lookup_docname( 2 ), std::string( "three" ) ); + BOOST_CHECK_EQUAL( ifi.lookup_docname( 3 ), std::string( "four" ) ); } void space() { @@ -72,7 +72,7 @@ void space() { ifile ifi( fname ); ifi.add( "one two three", "doc" ); - BOOST_CHECK_ETQUAL( ifi.search( "two" )->list().size(), 1 ); + BOOST_CHECK_EQUAL( ifi.search( "two" )->list().size(), 1 ); } void numbers() { @@ -80,10 +80,10 @@ void numbers() { ifile ifi( fname ); ifi.add( "one 123 123456789 four444 five", "doc" ); - BOOST_CHECK_ETQUAL( ifi.search( "123" )->list().size(), 1 ); - BOOST_CHECK_ETQUAL( ifi.search( "123456789" )->list().size(), 1 ); - BOOST_CHECK_ETQUAL( ifi.search( "four444" )->list().size(), 1 ); - BOOST_CHECK_ETQUAL( ifi.search( "five" )->list().size(), 1 ); + BOOST_CHECK_EQUAL( ifi.search( "123" )->list().size(), 1 ); + BOOST_CHECK_EQUAL( ifi.search( "123456789" )->list().size(), 1 ); + BOOST_CHECK_EQUAL( ifi.search( "four444" )->list().size(), 1 ); + BOOST_CHECK_EQUAL( ifi.search( "five" )->list().size(), 1 ); } void partial() { @@ -91,17 +91,17 @@ void partial() { ifile ifi( fname ); ifi.add( "longword", "doc_0" ); - BOOST_CHECK_ETQUAL( ifi.search( "l" )->list().size(), 1u ); - BOOST_CHECK_ETQUAL( ifi.search( "long" )->list().size(), 1u ); - BOOST_CHECK_ETQUAL( ifi.search( "longword" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "l" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "long" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "longword" )->list().size(), 1u ); - BOOST_CHECK_ETQUAL( ifi.search( "longword" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "longword" )->list().size(), 1u ); ifi.add( "longnord", "doc_1" ); - BOOST_CHECK_ETQUAL( ifi.search( "l" )->list().size(), 2u ); - BOOST_CHECK_ETQUAL( ifi.search( "long" )->list().size(), 2u ); - BOOST_CHECK_ETQUAL( ifi.search( "longw" )->list().size(), 1u ); - BOOST_CHECK_ETQUAL( ifi.search( "longn" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "l" )->list().size(), 2u ); + BOOST_CHECK_EQUAL( ifi.search( "long" )->list().size(), 2u ); + BOOST_CHECK_EQUAL( ifi.search( "longw" )->list().size(), 1u ); + BOOST_CHECK_EQUAL( ifi.search( "longn" )->list().size(), 1u ); } void several() { @@ -115,15 +115,15 @@ void several() { ifi.add( "else something", "5" ); ifi.add( "else four", "6" ); - BOOST_CHECK_ETQUAL( count_results( ifi, "one" ), 1u ); - BOOST_CHECK_ETQUAL( count_results( ifi, "one two three four" ), 1u ); - BOOST_CHECK_ETQUAL( count_results( ifi, "two three four" ), 2u ); + BOOST_CHECK_EQUAL( count_results( ifi, "one" ), 1u ); + BOOST_CHECK_EQUAL( count_results( ifi, "one two three four" ), 1u ); + BOOST_CHECK_EQUAL( count_results( ifi, "two three four" ), 2u ); - BOOST_CHECK_ETQUAL( count_results( ifi, "one two" ), 1u ); - BOOST_CHECK_ETQUAL( count_results( ifi, "one" ), 1u ); + BOOST_CHECK_EQUAL( count_results( ifi, "one two" ), 1u ); + BOOST_CHECK_EQUAL( count_results( ifi, "one" ), 1u ); - BOOST_CHECK_ETQUAL( count_results( ifi, "something else" ), 2u ); - BOOST_CHECK_ETQUAL( count_results( ifi, "something two" ), 2u ); + BOOST_CHECK_EQUAL( count_results( ifi, "something else" ), 2u ); + BOOST_CHECK_EQUAL( count_results( ifi, "something two" ), 2u ); } void remove_doc() { @@ -137,7 +137,7 @@ void remove_doc() { BOOST_CHECK( check_results( ifi, "one", "0", NULL ) ); BOOST_CHECK( check_results( ifi, "two", "0", NULL ) ); BOOST_CHECK( check_results( ifi, "three", "0", "2", NULL ) ); - BOOST_CHECK_ETQUAL( count_results( ifi, "four" ), 0u ); + BOOST_CHECK_EQUAL( count_results( ifi, "four" ), 0u ); } test_suite* get_suite() { |