aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/btree
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahoo-inc.com>2017-06-19 13:48:23 +0000
committerTor Egge <Tor.Egge@yahoo-inc.com>2017-06-19 13:48:23 +0000
commit444f47447bf8031c9c05b213a6d03c9c285b5ffd (patch)
treecb1263ce15df3595cd5bad8a0acc6c7d672860e9 /searchlib/src/tests/btree
parent1b2a95b6d8f0b0219c7a8bfcea4f07ad310ab619 (diff)
Make stealSomethingFrom{Left,Right}Node steal one more slot if sum of valid
slots is odd. This will allow the methods to be used for rebalancing during insertion too.
Diffstat (limited to 'searchlib/src/tests/btree')
-rw-r--r--searchlib/src/tests/btree/btreeaggregation_test.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/searchlib/src/tests/btree/btreeaggregation_test.cpp b/searchlib/src/tests/btree/btreeaggregation_test.cpp
index e07de5cd9d5..50ef7f21c4c 100644
--- a/searchlib/src/tests/btree/btreeaggregation_test.cpp
+++ b/searchlib/src/tests/btree/btreeaggregation_test.cpp
@@ -588,11 +588,11 @@ Test::requireThatNodeStealWorks()
"[60:160,70:170,80:180[min=160,max=180]]"
"[min=110,max=180]]", t));
t.remove(60);
- EXPECT_TRUE(assertTree("[40:"
- "[10:110,20:120,30:130,40:140"
- "[min=110,max=140]]"
+ EXPECT_TRUE(assertTree("[30:"
+ "[10:110,20:120,30:130"
+ "[min=110,max=130]]"
",80:"
- "[50:150,70:170,80:180[min=150,max=180]]"
+ "[40:140,50:150,70:170,80:180[min=140,max=180]]"
"[min=110,max=180]]", t));
}
{ // steal some from right
@@ -615,12 +615,12 @@ Test::requireThatNodeStealWorks()
"[min=150,max=190]]"
"[min=110,max=190]]", t));
t.remove(20);
- EXPECT_TRUE(assertTree("[50:"
- "[10:110,30:130,50:150"
- "[min=110,max=150]]"
+ EXPECT_TRUE(assertTree("[60:"
+ "[10:110,30:130,50:150,60:160"
+ "[min=110,max=160]]"
",90:"
- "[60:160,70:170,80:180,90:190"
- "[min=160,max=190]]"
+ "[70:170,80:180,90:190"
+ "[min=170,max=190]]"
"[min=110,max=190]]", t));
}
}