#!/bin/sh

SWFMILL=../../src/swfmill

file=$1
swf=`basename ${file}`.swf
target=${swf}.xml

$SWFMILL xml2swf ${file} ${swf}
$SWFMILL swf2xml ${swf} ${target}

if [ ! -e ${swf} -o ! -e ${target} ]; then
	exit 1
fi

diff -q ${file} ${target}
ret=$?

if [ ${ret} -ne 0 ]; then
	exit 1
fi
