aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2016-09-07 18:20:56 -0400
committerTom Yu <tlyu@mit.edu>2016-09-09 16:36:23 -0400
commit56e9bf0181959259eb7ead45fc5bdbbd7df49aeb (patch)
treeba6cf72e0b13d9cc95ca61291bcaf784604cd700
parente364e141e28ed6d50e859c1a81640c2e988b42fb (diff)
downloadkrb5-56e9bf0181959259eb7ead45fc5bdbbd7df49aeb.zip
krb5-56e9bf0181959259eb7ead45fc5bdbbd7df49aeb.tar.gz
krb5-56e9bf0181959259eb7ead45fc5bdbbd7df49aeb.tar.bz2
Test bt_split.c unaligned access
(back ported from commit 4613d503986f34f05ff310fcc580f65ba60eec5b) ticket: 8493 version_fixed: 1.14.4
-rw-r--r--src/plugins/kdb/db2/libdb2/test/run.test26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/plugins/kdb/db2/libdb2/test/run.test b/src/plugins/kdb/db2/libdb2/test/run.test
index b907105..d61f637 100644
--- a/src/plugins/kdb/db2/libdb2/test/run.test
+++ b/src/plugins/kdb/db2/libdb2/test/run.test
@@ -36,7 +36,7 @@ main()
find $bindir -type f -exec test -r {} \; -print | head -100 > $BINFILES
if [ $# -eq 0 ]; then
- for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20 40 41 60 61 62; do
+ for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20 40 41 60 61 62 63; do
test$t
done
else
@@ -47,7 +47,7 @@ main()
[0-9]*)
test$1;;
btree)
- for t in 1 2 3 7 8 9 10 12 13 40 41 60 61 62; do
+ for t in 1 2 3 7 8 9 10 12 13 40 41 60 61 62 63; do
test$t
done;;
hash)
@@ -970,4 +970,26 @@ test62 () {
done
}
+test63 () {
+ echo "Test 63: btree: big key, medium data, bt_split unaligned access"
+ # 488 = 512 - 20 (header) - 3 ("foo") - 1 (newline)
+ # 223 = 232 - 8 (key pointer)
+ # 232 = bt_ovflsize = (512 - 20 (header)) / 2 (DEFMINKEYPAGE)
+ # - (2 (indx_t) + 12 (NBLEAFDBT(0,0)))
+ awk 'BEGIN {
+ s = "";
+ for (i = 0; i < 488; i++) {
+ s = s "x";
+ }
+ d = "";
+ for (i = 0; i < 223; i++) {
+ d = d "x";
+ }
+ for (i = 0; i < 128; i++) {
+ printf("p\nk%s%03d\nd%s\n", s, i, d);
+ }
+ }' /dev/null > $TMP2
+ $PROG -o $TMP3 -i psize=512 btree $TMP2
+}
+
main $*