diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-06-14 02:34:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:08 -0500 |
commit | 5ec2c79dc58f340a9635b34400797fa85361c6ba (patch) | |
tree | f18c3302e01336572f8cfe66ee087d733bb3310e | |
parent | 3f094627193994f08afc8dcf186a7a65c1c350b9 (diff) | |
download | samba-5ec2c79dc58f340a9635b34400797fa85361c6ba.tar.gz samba-5ec2c79dc58f340a9635b34400797fa85361c6ba.tar.bz2 samba-5ec2c79dc58f340a9635b34400797fa85361c6ba.zip |
r7560: added tests for extended bitop search functions
(This used to be commit 7b58b3a9c53952f606eb75f5e916e0cf994b2d06)
-rwxr-xr-x | source4/lib/ldb/tests/test-extended.sh | 49 | ||||
-rwxr-xr-x | source4/lib/ldb/tests/test-tdb.sh | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/test-extended.sh b/source4/lib/ldb/tests/test-extended.sh new file mode 100755 index 0000000000..246b55f5b9 --- /dev/null +++ b/source4/lib/ldb/tests/test-extended.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +rm -f $LDB_URL + +cat <<EOF | bin/ldbadd - || exit 1 +dn: testrec1 +i1: 1 +i2: 0 +i3: 1234 +i4: 0x7003004 + +dn: testrec2 +i1: 0x800000 + +dn: testrec3 +i1: 0x101010101 +i1: 7 +EOF + +checkcount() { + count=$1 + expression="$2" + n=`bin/ldbsearch "$expression" | grep ^dn | wc -l` + if [ $n != $count ]; then + echo "Got $n but expected $count for $expression" + bin/ldbsearch "$expression" + exit 1 + fi + echo "OK: $count $expression" +} + +checkcount 1 '(i3=1234)' +checkcount 0 '(i3=12345)' + +checkcount 2 '(i1:1.2.840.113556.1.4.803:=1)' +checkcount 1 '(i1:1.2.840.113556.1.4.803:=3)' +checkcount 1 '(i1:1.2.840.113556.1.4.803:=7)' +checkcount 0 '(i1:1.2.840.113556.1.4.803:=15)' +checkcount 1 '(i1:1.2.840.113556.1.4.803:=0x800000)' +checkcount 1 '(i1:1.2.840.113556.1.4.803:=8388608)' + +checkcount 2 '(i1:1.2.840.113556.1.4.804:=1)' +checkcount 2 '(i1:1.2.840.113556.1.4.804:=3)' +checkcount 2 '(i1:1.2.840.113556.1.4.804:=7)' +checkcount 2 '(i1:1.2.840.113556.1.4.804:=15)' +checkcount 1 '(i1:1.2.840.113556.1.4.804:=0x800000)' +checkcount 1 '(i1:1.2.840.113556.1.4.804:=8388608)' + +rm -f $LDB_URL diff --git a/source4/lib/ldb/tests/test-tdb.sh b/source4/lib/ldb/tests/test-tdb.sh index 69b30a50b4..9c2f9cd7ba 100755 --- a/source4/lib/ldb/tests/test-tdb.sh +++ b/source4/lib/ldb/tests/test-tdb.sh @@ -7,3 +7,4 @@ rm -f tdbtest.ldb . tests/test-generic.sh +. tests/test-extended.sh |