#!/bin/sh

test_add64() {
  result=$("${QEMU}" -B 0x80000000 -s 2k tests/math_add64.elf)
  #  3.5
  #  3.75
  #  1.25
  # -1.25
  expected=$(cat << END
00000003.80000000
00000003.C0000000
END
)

  # TODO: Ideally this test would allow calling the binary repeatedly with
  # different inputs.
  test $? -eq 0 && test "$result" = "$expected"
}

test_mul() {
  result=$("${QEMU}" -B 0x80000000 -s 2k tests/math_mul.elf)
  expected=$(cat << END
0000000F
0000003F
0063FF9C
FFFFFFEB
END
)

  # TODO: Ideally this test would allow calling the binary repeatedly with
  # different inputs.
  test $? -eq 0 && test "$result" = "$expected"
}