@ -586,10 +586,10 @@ TEST(DBIteratorTest, DBIteratorUseSkip) {
}
}
TEST ( DBIteratorTest , DBIterator ) {
TEST ( DBIteratorTest , DBIterator1 ) {
Options options ;
options . merge_operator = MergeOperators : : CreateFromStringId ( " stringappend " ) ;
{
TestIterator * internal_iter = new TestIterator ( BytewiseComparator ( ) ) ;
internal_iter - > AddPut ( " a " , " 0 " ) ;
internal_iter - > AddPut ( " b " , " 0 " ) ;
@ -598,9 +598,8 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " b " , " 2 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 1 ,
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter , 1 ,
options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -611,7 +610,10 @@ TEST(DBIteratorTest, DBIterator) {
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
}
{
TEST ( DBIteratorTest , DBIterator2 ) {
Options options ;
options . merge_operator = MergeOperators : : CreateFromStringId ( " stringappend " ) ;
TestIterator * internal_iter = new TestIterator ( BytewiseComparator ( ) ) ;
internal_iter - > AddPut ( " a " , " 0 " ) ;
internal_iter - > AddPut ( " b " , " 0 " ) ;
@ -620,9 +622,8 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " b " , " 2 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 0 ,
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter , 0 ,
options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -632,7 +633,10 @@ TEST(DBIteratorTest, DBIterator) {
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
}
{
TEST ( DBIteratorTest , DBIterator3 ) {
Options options ;
options . merge_operator = MergeOperators : : CreateFromStringId ( " stringappend " ) ;
TestIterator * internal_iter = new TestIterator ( BytewiseComparator ( ) ) ;
internal_iter - > AddPut ( " a " , " 0 " ) ;
internal_iter - > AddPut ( " b " , " 0 " ) ;
@ -641,9 +645,8 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " b " , " 2 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 2 ,
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter , 2 ,
options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -652,8 +655,10 @@ TEST(DBIteratorTest, DBIterator) {
db_iter - > Next ( ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
}
TEST ( DBIteratorTest , DBIterator4 ) {
Options options ;
options . merge_operator = MergeOperators : : CreateFromStringId ( " stringappend " ) ;
{
TestIterator * internal_iter = new TestIterator ( BytewiseComparator ( ) ) ;
internal_iter - > AddPut ( " a " , " 0 " ) ;
internal_iter - > AddPut ( " b " , " 0 " ) ;
@ -662,9 +667,8 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " b " , " 2 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 4 ,
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter , 4 ,
options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToFirst ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -678,7 +682,9 @@ TEST(DBIteratorTest, DBIterator) {
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
}
{
TEST ( DBIteratorTest , DBIterator5 ) {
Options options ;
options . merge_operator = MergeOperators : : CreateFromStringId ( " stringappend " ) ;
{
TestIterator * internal_iter = new TestIterator ( BytewiseComparator ( ) ) ;
internal_iter - > AddMerge ( " a " , " merge_1 " ) ;
@ -690,10 +696,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 0 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
0 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -713,10 +718,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 1 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
1 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -736,10 +740,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 2 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
2 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -759,10 +762,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 3 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
3 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -782,10 +784,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 4 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
4 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -805,10 +806,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 5 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
5 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -828,10 +828,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 6 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
6 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -841,7 +840,9 @@ TEST(DBIteratorTest, DBIterator) {
}
}
{
TEST ( DBIteratorTest , DBIterator6 ) {
Options options ;
options . merge_operator = MergeOperators : : CreateFromStringId ( " stringappend " ) ;
{
TestIterator * internal_iter = new TestIterator ( BytewiseComparator ( ) ) ;
internal_iter - > AddMerge ( " a " , " merge_1 " ) ;
@ -853,10 +854,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 0 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
0 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -876,10 +876,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 1 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
1 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -899,10 +898,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 2 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
2 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -922,10 +920,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 3 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
3 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
}
@ -941,10 +938,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 4 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
4 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -964,10 +960,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 5 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
5 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -987,10 +982,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddMerge ( " a " , " merge_6 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 6 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
6 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1000,7 +994,9 @@ TEST(DBIteratorTest, DBIterator) {
}
}
{
TEST ( DBIteratorTest , DBIterator7 ) {
Options options ;
options . merge_operator = MergeOperators : : CreateFromStringId ( " stringappend " ) ;
{
TestIterator * internal_iter = new TestIterator ( BytewiseComparator ( ) ) ;
internal_iter - > AddMerge ( " a " , " merge_1 " ) ;
@ -1024,10 +1020,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddDeletion ( " c " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 0 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
0 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
@ -1059,10 +1054,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddDeletion ( " c " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 2 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
2 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1100,10 +1094,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddDeletion ( " c " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 4 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
4 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1141,10 +1134,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddDeletion ( " c " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 5 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
5 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1187,10 +1179,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddDeletion ( " c " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 6 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
6 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1234,10 +1225,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddDeletion ( " c " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 7 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
7 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1275,10 +1265,9 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > AddDeletion ( " c " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 9 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
9 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1323,9 +1312,8 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 13 ,
options . max_sequential_skip_in_iterations ) ) ;
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
13 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1371,9 +1359,8 @@ TEST(DBIteratorTest, DBIterator) {
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 14 ,
options . max_sequential_skip_in_iterations ) ) ;
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
14 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
@ -1389,18 +1376,19 @@ TEST(DBIteratorTest, DBIterator) {
ASSERT_TRUE ( ! db_iter - > Valid ( ) ) ;
}
}
TEST ( DBIteratorTest , DBIterator8 ) {
Options options ;
options . merge_operator = MergeOperators : : CreateFromStringId ( " stringappend " ) ;
{
TestIterator * internal_iter = new TestIterator ( BytewiseComparator ( ) ) ;
internal_iter - > AddDeletion ( " a " ) ;
internal_iter - > AddPut ( " a " , " 0 " ) ;
internal_iter - > AddPut ( " b " , " 0 " ) ;
internal_iter - > Finish ( ) ;
std : : unique_ptr < Iterator > db_iter (
NewDBIterator ( env_ , ImmutableCFOptions ( options ) ,
BytewiseComparator ( ) , internal_iter , 10 ,
options . max_sequential_skip_in_iterations ) ) ;
std : : unique_ptr < Iterator > db_iter ( NewDBIterator (
env_ , ImmutableCFOptions ( options ) , BytewiseComparator ( ) , internal_iter ,
10 , options . max_sequential_skip_in_iterations ) ) ;
db_iter - > SeekToLast ( ) ;
ASSERT_TRUE ( db_iter - > Valid ( ) ) ;
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " b " ) ;
@ -1411,7 +1399,6 @@ TEST(DBIteratorTest, DBIterator) {
ASSERT_EQ ( db_iter - > key ( ) . ToString ( ) , " a " ) ;
ASSERT_EQ ( db_iter - > value ( ) . ToString ( ) , " 0 " ) ;
}
}
} // namespace rocksdb