
echo "testing clock line..."

pass=1

./slop -i 0x37A 8
sleep 1
foo=`./slop -i 0x379`
if (( (16#$foo & 8) == 0)); then
  echo "failed clock high test, pin 15."
  pass=0 
else
  echo "passed clock high test"
fi

if (($pass==1)); then
  ./slop -i 0x37A 0
  sleep 1
  foo=`./slop -i 0x379`
  if (( (16#$foo & 8) == 0)); then
    echo "passed clock low test" 
  else
    echo "failed clock low test, pin 15"
    pass=0        
  fi
fi

echo "testing data line..."

if (($pass==1)); then
  ./slop -i 0x378 128
  sleep 1
  foo=`./slop -i 0x379`
  if (( (16#$foo & 128) == 0)); then
    echo "passed data high test" 
  else
    echo "failed data high test, pin 11"
    pass=0
  fi
fi

if (($pass==1)); then
  ./slop -i 0x378 0
  sleep 1
  foo=`./slop -i 0x379`
  if (( (16#$foo & 128) == 0)); then
    echo "failed data low test, pin 11"
    pass=0
  else
    echo "passed data low test" 
  fi
fi

if (($pass==1)); then
  echo "Passed."
fi



