Mercurial > hg > sonic-annotator
changeset 188:cbbf8a838b47
Add test for Turtle output encoding (must be UTF-8)
author | Chris Cannam |
---|---|
date | Wed, 25 Feb 2015 10:20:17 +0000 |
parents | 889f770abff3 |
children | 089f1a13963d |
files | tests/audio/id3v2-iso-8859-1.mp3 tests/audio/id3v2-ucs-2.mp3 tests/audio/id3v24-iso-8859-1.mp3 tests/audio/id3v24-ucs-2.mp3 tests/test-multiple-audio/expected/all-files.csv tests/test-rdf-writer/test-rdf-writer.sh tests/test-supportprogs/test-supportprogs.sh |
diffstat | 7 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-multiple-audio/expected/all-files.csv Wed Feb 25 09:31:39 2015 +0000 +++ b/tests/test-multiple-audio/expected/all-files.csv Wed Feb 25 10:20:17 2015 +0000 @@ -26,3 +26,11 @@ ,0.000000000,9.961360543,median,169,"(median value, continuous-time average)" ,0.000000000,9.961360543,mode,164,"(modal value, continuous-time average)" ,0.000000000,9.961360543,mean,698.921,"(mean value, continuous-time average)" +"./../audio/id3v2-iso-8859-1.mp3",0.000000000,5.015510203,mean,170.655,"(mean value, continuous-time average)" +,0.000000000,5.015510203,median,171,"(median value, continuous-time average)" +,0.000000000,5.015510203,mode,171,"(modal value, continuous-time average)" +,0.000000000,5.015510203,mean,690.028,"(mean value, continuous-time average)" +"./../audio/id3v2-ucs-2.mp3",0.000000000,5.061950112,mean,169.206,"(mean value, continuous-time average)" +,0.000000000,5.061950112,median,170,"(median value, continuous-time average)" +,0.000000000,5.061950112,mode,162,"(modal value, continuous-time average)" +,0.000000000,5.061950112,mean,699.101,"(mean value, continuous-time average)"
--- a/tests/test-rdf-writer/test-rdf-writer.sh Wed Feb 25 09:31:39 2015 +0000 +++ b/tests/test-rdf-writer/test-rdf-writer.sh Wed Feb 25 10:20:17 2015 +0000 @@ -49,4 +49,11 @@ done +# Check the output encoding -- should be valid UTF-8 always + +for code in ucs-2 iso-8859-1; do + $r -t $transformdir/onsets.n3 -w rdf --rdf-stdout $audiopath/id3v2-$code.mp3 2>/dev/null | uconv --from-code utf-8 --to-code utf-8 --from-callback stop >/dev/null || + fail "RDF/Turtle output from $code input is not valid utf-8 according to uconv" +done + exit 0
--- a/tests/test-supportprogs/test-supportprogs.sh Wed Feb 25 09:31:39 2015 +0000 +++ b/tests/test-supportprogs/test-supportprogs.sh Wed Feb 25 10:20:17 2015 +0000 @@ -11,6 +11,9 @@ rapper --version >/dev/null || \ fail "Can't find required rapper program" +uconv --version >/dev/null || \ + fail "Can't find required uconv program" + echo '{}' | json_verify >/dev/null || \ fail "Can't find required json_verify program, or it doesn't seem to work"