@ -9,10 +9,10 @@
# include "rocksdb/slice.h"
# include "rocksdb/slice.h"
# include "table/block.h"
# include "table/block.h"
# include "table/block_based_table_reader.h"
# include "table/block_builder.h"
# include "table/block_builder.h"
# include "table/data_block_hash_index.h"
# include "table/data_block_hash_index.h"
# include "table/get_context.h"
# include "table/get_context.h"
# include "table/block_based_table_reader.h"
# include "util/testharness.h"
# include "util/testharness.h"
# include "util/testutil.h"
# include "util/testutil.h"
@ -95,7 +95,6 @@ TEST(DataBlockHashIndex, DataBlockHashTestSmall) {
buffer2 = buffer ; // test for the correctness of relative offset
buffer2 = buffer ; // test for the correctness of relative offset
Slice s ( buffer2 ) ;
Slice s ( buffer2 ) ;
DataBlockHashIndex index ;
DataBlockHashIndex index ;
uint16_t map_offset ;
uint16_t map_offset ;
@ -290,7 +289,6 @@ TEST(DataBlockHashIndex, BlockRestartIndexExceedMax) {
BlockBasedTableOptions : : kDataBlockBinaryAndHash ) ;
BlockBasedTableOptions : : kDataBlockBinaryAndHash ) ;
}
}
builder . Reset ( ) ;
builder . Reset ( ) ;
// #restarts > 253. HashIndex is not used
// #restarts > 253. HashIndex is not used
@ -404,8 +402,8 @@ TEST(DataBlockHashIndex, BlockTestSingleKey) {
may_exist = iter - > SeekForGet ( seek_ikey . Encode ( ) . ToString ( ) ) ;
may_exist = iter - > SeekForGet ( seek_ikey . Encode ( ) . ToString ( ) ) ;
ASSERT_TRUE ( may_exist ) ;
ASSERT_TRUE ( may_exist ) ;
ASSERT_TRUE ( iter - > Valid ( ) ) ;
ASSERT_TRUE ( iter - > Valid ( ) ) ;
ASSERT_EQ ( options . comparator - > Compare (
ASSERT_EQ (
iter - > key ( ) , ikey . Encode ( ) . ToString ( ) ) , 0 ) ;
options . comparator - > Compare ( iter - > key ( ) , ikey . Encode ( ) . ToString ( ) ) , 0 ) ;
ASSERT_EQ ( iter - > value ( ) , value ) ;
ASSERT_EQ ( iter - > value ( ) , value ) ;
}
}
@ -419,8 +417,8 @@ TEST(DataBlockHashIndex, BlockTestSingleKey) {
ASSERT_TRUE ( iter - > Valid ( ) ) ;
ASSERT_TRUE ( iter - > Valid ( ) ) ;
// user key should match
// user key should match
ASSERT_EQ ( options . comparator - > Compare (
ASSERT_EQ ( options . comparator - > Compare ( ExtractUserKey ( iter - > key ( ) ) , ukey ) ,
ExtractUserKey ( iter - > key ( ) ) , ukey ) , 0 ) ;
0 ) ;
// seek_key seqno number should be greater than that of iter result
// seek_key seqno number should be greater than that of iter result
ASSERT_GT ( GetInternalKeySeqno ( seek_ikey . Encode ( ) ) ,
ASSERT_GT ( GetInternalKeySeqno ( seek_ikey . Encode ( ) ) ,