5
if test -z $BINDIR ; then
6
BINDIR=drizzled/message
10
bytes=`${BINDIR}/length --hex --encode $1`
13
if test "$bytes" != "$expected"; then
14
failed=`expr $failed + 1`
15
echo "Got '$bytes' but expected '$expected'"
20
bytes=`${BINDIR}/length --encode $value`
21
result=`${BINDIR}/length --decode $bytes`
22
if test $result -ne $value; then
23
failed=`expr $failed + 1`
24
echo "Got $result but expected $value"
28
# check that the encoding is correct
31
check_encode 256 0x0 0x0 0x1
32
check_encode 65535 0x0 0xff 0xff
34
# Check that we can decode what we have encoded
35
for value in 2 255 256 65535 65536 \
37
`expr 16 "*" 65536 + 255`
39
check_invertible $value