File: testCalculator

package info (click to toggle)
libapfloat-java 1.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,304 kB
  • sloc: java: 57,357; xml: 1,241; sh: 103; makefile: 13
file content (20 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# autopkgtest check: tests the calculator provided by apfloat-calc.
# (C) 2020 Pierre Gruet
# Author: Pierre Gruet <pgt@debian.org>

set -e

SOURCEDIR=$(pwd)
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR

# Compute 3*sin(0.5) and compare it to 1.4 (which is the value with the default rounding).

echo "3*sin(0.5)" | java -cp /usr/share/java/apfloat-calc.jar org.apfloat.calc.Calculator | grep -q "1.4"

if [ $? -ne 0 ]; then
  exit 1
fi