~ubuntu-branches/ubuntu/precise/flac/precise-updates

« back to all changes in this revision

Viewing changes to test/test_seeking.sh

  • Committer: Bazaar Package Importer
  • Author(s): Joshua Kwan
  • Date: 2007-05-29 22:56:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529225636-ljeff8xxip09qaap
Tags: 1.1.4-1
* New upstream release. closes: #405167, #411311
  - libOggFLAC and libOggFLAC++ have been merged into libFLAC, so
    remove their corresponding packages.
  - Because of the API changes required to effect the above, there has
    been yet another soname bump. libflac7 -> libflac8 and
    libflac++5 -> libflac++6. Emails have been dispatched to the
    maintainers of dependent packages.
* Some notes on patches that were removed:
  - 02_stdin_stdout, 06_manpage_mention_utf8_convert: merged upstream
  - 08_manpage_warnings: Upstream has changed the manpage so it defintely
    can't fit in in 80 cols, so just forget about it. We'll live.
  - 05_eof_warnings_are_errors: Upstream decided to add a -w option to
    flac to treat all warnings as errors. I am going to defer to that
    for now, but if people think it's stupid let me know and I'll port
    the patch forward.
  - 04_stack_smasher: was a backport from 1.1.3, so it's obsolete.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
3
3
#  FLAC - Free Lossless Audio Codec
4
 
#  Copyright (C) 2004,2005  Josh Coalson
 
4
#  Copyright (C) 2004,2005,2006,2007  Josh Coalson
5
5
#
6
6
#  This file is part the FLAC project.  FLAC is comprised of several
7
7
#  components distributed under difference licenses.  The codec libraries
30
30
fi
31
31
 
32
32
LD_LIBRARY_PATH=../src/libFLAC/.libs:$LD_LIBRARY_PATH
33
 
LD_LIBRARY_PATH=../src/libOggFLAC/.libs:$LD_LIBRARY_PATH
34
33
LD_LIBRARY_PATH=../obj/$BUILD/lib:$LD_LIBRARY_PATH
35
34
export LD_LIBRARY_PATH
36
35
PATH=../src/flac:$PATH
44
43
 
45
44
run_flac ()
46
45
{
47
 
        if [ x"$FLAC__VALGRIND" = xyes ] ; then
 
46
        if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
 
47
                echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=100 flac $*" >>test_seeking.valgrind.log
48
48
                valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 flac $* 4>>test_seeking.valgrind.log
49
49
        else
50
50
                flac $*
53
53
 
54
54
run_metaflac ()
55
55
{
56
 
        if [ x"$FLAC__VALGRIND" = xyes ] ; then
 
56
        if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
 
57
                echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=100 metaflac $*" >>test_seeking.valgrind.log
57
58
                valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 metaflac $* 4>>test_seeking.valgrind.log
58
59
        else
59
60
                metaflac $*
62
63
 
63
64
run_test_seeking ()
64
65
{
65
 
        if [ x"$FLAC__VALGRIND" = xyes ] ; then
 
66
        if [ x"$FLAC__TEST_WITH_VALGRIND" = xyes ] ; then
 
67
                echo "valgrind --leak-check=yes --show-reachable=yes --num-callers=100 test_seeking $*" >>test_seeking.valgrind.log
66
68
                valgrind --leak-check=yes --show-reachable=yes --num-callers=100 --logfile-fd=4 test_seeking $* 4>>test_seeking.valgrind.log
67
69
        else
68
70
                test_seeking $*
85
87
fi
86
88
 
87
89
echo "generating FLAC files for seeking:"
88
 
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 --output-name=tiny.flac noise8m32.raw || die "ERROR generating FLAC file"
89
 
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 --output-name=small.flac noise.raw || die "ERROR generating FLAC file"
90
 
echo "generating Ogg FLAC files for seeking:"
91
 
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 --output-name=tiny.ogg --ogg noise8m32.raw || die "ERROR generating Ogg FLAC file"
92
 
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 --output-name=small.ogg --ogg noise.raw || die "ERROR generating Ogg FLAC file"
93
 
 
94
 
echo "testing tiny.flac:"
95
 
if run_test_seeking tiny.flac 100 ; then : ; else
96
 
        die "ERROR: during test_seeking"
97
 
fi
98
 
 
99
 
echo "testing small.flac:"
100
 
if run_test_seeking small.flac 1000 ; then : ; else
101
 
        die "ERROR: during test_seeking"
102
 
fi
103
 
 
104
 
echo "removing sample count from tiny.flac and small.flac:"
105
 
if run_metaflac --no-filename --set-total-samples=0 tiny.flac small.flac ; then : ; else
106
 
        die "ERROR: during metaflac"
107
 
fi
108
 
 
109
 
echo "testing tiny.flac with total_samples=0:"
110
 
if run_test_seeking tiny.flac 100 ; then : ; else
111
 
        die "ERROR: during test_seeking"
112
 
fi
113
 
 
114
 
echo "testing small.flac with total_samples=0:"
115
 
if run_test_seeking small.flac 1000 ; then : ; else
116
 
        die "ERROR: during test_seeking"
117
 
fi
 
90
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 -S- --output-name=tiny.flac noise8m32.raw || die "ERROR generating FLAC file"
 
91
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 -S- --output-name=small.flac noise.raw || die "ERROR generating FLAC file"
 
92
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 -S10x --output-name=tiny-s.flac noise8m32.raw || die "ERROR generating FLAC file"
 
93
run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 -S10x --output-name=small-s.flac noise.raw || die "ERROR generating FLAC file"
 
94
 
 
95
tiny_samples=`metaflac --show-total-samples tiny.flac`
 
96
small_samples=`metaflac --show-total-samples small.flac`
 
97
 
 
98
for suffix in '' '-s' ; do
 
99
        echo "testing tiny$suffix.flac:"
 
100
        if run_test_seeking tiny$suffix.flac 100 $tiny_samples ; then : ; else
 
101
                die "ERROR: during test_seeking"
 
102
        fi
 
103
 
 
104
        echo "testing small$suffix.flac:"
 
105
        if run_test_seeking small$suffix.flac 1000 $small_samples ; then : ; else
 
106
                die "ERROR: during test_seeking"
 
107
        fi
 
108
 
 
109
        echo "removing sample count from tiny$suffix.flac and small$suffix.flac:"
 
110
        if run_metaflac --no-filename --set-total-samples=0 tiny$suffix.flac small$suffix.flac ; then : ; else
 
111
                die "ERROR: during metaflac"
 
112
        fi
 
113
 
 
114
        echo "testing tiny$suffix.flac with total_samples=0:"
 
115
        if run_test_seeking tiny$suffix.flac 100 $tiny_samples ; then : ; else
 
116
                die "ERROR: during test_seeking"
 
117
        fi
 
118
 
 
119
        echo "testing small$suffix.flac with total_samples=0:"
 
120
        if run_test_seeking small$suffix.flac 1000 $small_samples ; then : ; else
 
121
                die "ERROR: during test_seeking"
 
122
        fi
 
123
done
118
124
 
119
125
if [ $has_ogg = "yes" ] ; then
120
126
 
 
127
        echo "generating Ogg FLAC files for seeking:"
 
128
        run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=8 --channels=1 --blocksize=576 --output-name=tiny.ogg --ogg noise8m32.raw || die "ERROR generating Ogg FLAC file"
 
129
        run_flac --verify --force --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 --blocksize=576 --output-name=small.ogg --ogg noise.raw || die "ERROR generating Ogg FLAC file"
 
130
        # seek tables are not used in Ogg FLAC
 
131
 
121
132
        echo "testing tiny.ogg:"
122
 
        if run_test_seeking tiny.ogg 100 ; then : ; else
 
133
        if run_test_seeking tiny.ogg 100 $tiny_samples ; then : ; else
123
134
                die "ERROR: during test_seeking"
124
135
        fi
125
136
 
126
137
        echo "testing small.ogg:"
127
 
        if run_test_seeking small.ogg 1000 ; then : ; else
 
138
        if run_test_seeking small.ogg 1000 $small_samples ; then : ; else
128
139
                die "ERROR: during test_seeking"
129
140
        fi
130
141
 
131
142
fi
132
143
 
133
 
rm -f tiny.flac tiny.ogg small.flac small.ogg
 
144
rm -f tiny.flac tiny.ogg small.flac small.ogg tiny-s.flac small-s.flac