Commit d03cdeec authored by Vesa Oikonen's avatar Vesa Oikonen
Browse files

continued

parent f169066c
......@@ -361,8 +361,8 @@ int main(int argc, char **argv)
tac1.w[tac1.sampleNr]=tac2.w[i];
tac1.sampleNr++;
}
/* Sort by sample time, if there was overlap */
if(isOverlap) tacSortByTime(&tac1, NULL);
/* Sort by sample time */
tacSortByTime(&tac1, NULL);
/* Add interfile type header contents that are stored as comments in file 2 */
iftCopyItems(&tac1.h, &tac2.h, 1, 1, 2, NULL);
......
#!/bin/bash
#: Title : test_taccat
#: Date : 2021-02-11
#: Date : 2021-02-16
#: Author : "Vesa Oikonen" <vesa.oikonen@utu.fi>
#: Options : None
......@@ -240,7 +240,72 @@ printf "\n passed. \n\n"
printf "\n --------------------------------------\n"
printf "\n 2.0.0 \n"
printf " Test case: Overlapping TAC data in simple text format. \n"
printf " Test case 2: No options. \n"
printf " Expected result: Error. \n\n"
rm -f output.dat
$PROGRAM test2a.dat test2b.dat output.dat
if [ $? -eq 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
iftisval stdout.txt Error "overlapping sample times."
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
printf "\n 2.0.1 \n"
printf " Test case: Overlapping TAC data in simple text format, units missing from the first file. \n"
printf " Test case 2: Option -both. \n"
printf " Expected result: Warning on missing units. \n"
printf " Expected result 2: Error on non-compatible units. \n\n"
rm -f output.dat stdout.txt
$PROGRAM -both test2a.dat test2b.dat output.dat &> stdout.txt
if [ $? -eq 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
iftisval stdout.txt Warning "unknown time units."
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
iftisval stdout.txt Warning "unknown concentration units."
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
iftisval stdout.txt Error "non-compatible TAC concentration units."
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
printf "\n 2.1.0 \n"
printf " Test case: Overlapping TAC data in simple text format. \n"
printf " Test case 2: Options -both and -force. \n"
printf " Test case 3: Units and other information as comments in either file. \n"
printf " Expected result: Warning of overlap. \n"
printf " Expected result 2: Correctly catenated data is written in new file. \n"
printf " Expected result 3: Important comments from both files retained. \n\n"
rm -f output.dat stdout.txt
$PROGRAM -both -force test2a.dat test2b.dat output.dat &> stdout.txt
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
iftisval stdout.txt Warning "overlap in sample times is ignored."
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
tacmatch -abs=0.1 -rel=0.1 -xunit=y -yunit=y correct_output2a.dat output.dat
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
iftmatch test2a.dat output.dat injection_time
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
iftmatch test2b.dat output.dat unit
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
iftmatch test2b.dat output.dat isotope
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
......@@ -342,25 +407,6 @@ printf "\n===================================================================\n"
printf "\n===================================================================\n"
printf "\n2.0.0 combine overlapping curves without option -both \n\n"
rm -f output.kbq
$PROGRAM test2a.kbq test2b.kbq output.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
tacmatch -abs=0.1 -rel=1 correct_output2a.kbq output.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \n\n"
printf "\n2.0.1 combine overlapping curves with option -both \n\n"
rm -f output.kbq
$PROGRAM -both test2a.kbq test2b.kbq output.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n ok \n"
tacmatch -abs=0.1 -rel=1 correct_output2b.kbq output.kbq
if [ $? -ne 0 ] ; then printf "Failed!\n" ; exit 1 ; fi
printf "\n passed. \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