#! /bin/sh

#
# Check addrxlat_map_t handling
#

name=xlatmap
resultfile="out/${name}.result"
expectfile="$srcdir/$name.expect"

mkdir -p out

echo -n "Checking... "
./xlatmap >"$resultfile"
rc=$?
if [ $rc -gt 1 ]; then
    echo ERROR
    echo "Cannot perform test" >&2
    exit $rc
elif [ $rc -ne 0 ]; then
    echo FAILED
    exit $rc
elif ! diff "$expectfile" "$resultfile"; then
    echo FAILED
    echo "Result does not match" >&2
    exit 1
else
    echo OK
fi

exit 0
