Commit 1017adb5 authored by Vesa Oikonen's avatar Vesa Oikonen
Browse files

more tests

parent d697fb40
......@@ -48,6 +48,24 @@ if [ ! -f s6910vp.fit ] || [ ! -f correct_s6910vp_auc0-inf.par ] || [ ! -f corre
fi
if [ ! -f test1.fit ] || [ ! -f correct_test1_auc0-inf.par ] || [ ! -f correct_test1_auc1000-inf.par ]; then
printf "\n Make test data with exactly known results \n"
printf "FIT1 fit_dexp 0.7.7 (c) 2021 by Turku PET Centre\n" > test1.fit
printf "Date: 2021-02-04 20:10:04\n" >> test1.fit
printf "Data file: test1.bld\n" >> test1.fit
printf "Data unit: Bq/mL\n" >> test1.fit
printf "Time unit: sec\n" >> test1.fit
printf "Nr of VOIs: 1\n" >> test1.fit
printf "Region Plane Start End dataNr WSS parNr Type Parameters\n" >> test1.fit
printf "tac1 . . 120 9600 10 0 2 0301 1000 -0.001\n" >> test1.fit
printf "Parameters\tAUC[sec*Bq/mL]\n" > correct_test1_auc0-inf.par
printf "tac1\t1.0E+06\n" >> correct_test1_auc0-inf.par
printf "Parameters\tAUC[sec*Bq/mL]\n" > correct_test1_auc1000-inf.par
printf "tac1\t367879.441171\n" >> correct_test1_auc1000-inf.par
fi
......@@ -79,6 +97,60 @@ if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
printf "\n 1.0.0 \n"
printf " Test case: parameters of mono-exponential. \n"
printf " Expected result: correct AUC is obtained from zero time. \n\n"
$PROGRAM test1.fit 0 test1_auc0-inf.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
parmatch -p=y -parnames=y -parunits=y -abs=1.0E-04 correct_test1_auc0-inf.par test1_auc0-inf.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
printf "\n 1.0.1 \n"
printf " Test case: parameters of mono-exponential. \n"
printf " Expected result: correct AUC is obtained from later time. \n\n"
$PROGRAM test1.fit 1000 test1_auc1000-inf.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
parmatch -p=y -parnames=y -parunits=y -abs=1 correct_test1_auc1000-inf.par test1_auc1000-inf.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
printf "\n 1.1.0 \n"
printf " Test case: parameters in CSV PAR format. \n"
printf " Expected result: correct AUC is obtained. \n\n"
parformat -f=PAR test1.fit test1.csv
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
$PROGRAM test1.csv 0 output.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
parmatch -p=y -parnames=y -parunits=y -abs=1 correct_test1_auc0-inf.par output.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
printf "\n 1.1.1 \n"
printf " Test case: same as before but file name extension is par. \n"
printf " Expected result: correct AUC is obtained. \n\n"
cp -f test1.csv test1.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
$PROGRAM test1.par 0 output.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
parmatch -p=y -parnames=y -parunits=y -abs=1 correct_test1_auc0-inf.par output.par
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
printf "\n===================================================================\n"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment