#!/bin/sh

# Stops the execution, if a command has an error 
set -e

# Hive file to read
NTUSER="./debian/tests/testfiles/ntuser.dat"

# Temporary file to hold the retrieved results
ACTUAL="tmp"

# Expected result
TARGET="./debian/tests/testfiles/ntuser-result.txt"


# Parse hivefile an 
regripper -r ${NTUSER} -a >${ACTUAL} 2> /dev/null

if  ! cmp --silent ${ACTUAL} ${TARGET} > /dev/null 2>&1 
then
    echo "Resulting output differs"
    diff ${ACTUAL} ${TARGET}
    rm ${ACTUAL}
    exit 1
fi

rm ${ACTUAL}
exit 0
