History

add fate test

lieff committed 8 years ago

Commit 2797d8a1 parent 5ce2e4d3 files · +30 −5Browse files

Unified · Split

3 files
  1. .travis.yml +4 −1
  2. minimp3.c +5 −4
  3. scripts/build.sh +21 −0
.travis.yml+4−1
@@ -6,5 +6,8 @@ os: · 5 unmodified lines
66 compiler:
77 - gcc
88
9+before_install:
10+ - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y wget; fi
11+
912 script:
10− - gcc -Dminimp3_test -O2 -g -o minimp3 minimp3.c
13+ - scripts/build.sh
minimp3.c+5−4
@@ -1639,7 +1639,7 @@ void decode_file(FILE *file_mp3, FILE *file_wav) · 1638 unmodified lines
16391639
16401640 mp3dec_init(&mp3d);
16411641
1642− fwrite(wav_header(0, 0, 0, 0), 1, 44, file_wav);
1642+ //fwrite(wav_header(0, 0, 0, 0), 1, 44, file_wav);
16431643
16441644 do
16451645 {
@@ -1649,13 +1649,14 @@ void decode_file(FILE *file_mp3, FILE *file_wav) · 3 unmodified lines
16491649 if (samples)
16501650 {
16511651 fwrite(pcm, samples, 2*info.channels, file_wav);
1652− }
1652+ } else if (0 == info.frame_bytes) info.frame_bytes = nbuf;
1653+
16531654 memmove(buf, buf + info.frame_bytes, nbuf -= info.frame_bytes);
16541655 } while (nbuf);
16551656
16561657 data_bytes = ftell(file_wav) - 44;
1657− rewind(file_wav);
1658− fwrite(wav_header(info.hz, info.channels, 16, data_bytes), 1, 44, file_wav);
1658+ //rewind(file_wav);
1659+ //fwrite(wav_header(info.hz, info.channels, 16, data_bytes), 1, 44, file_wav);
16591660 fclose(file_wav);
16601661 fclose(file_mp3);
16611662 }
scripts/build.sh+21−0
@@ -0,0 +1,21 @@
1+set -e
2+
3+if [ ! -d "fate-suite.ffmpeg.org" ]; then
4+ wget -np -r --level=1 http://fate-suite.ffmpeg.org/mp3-conformance/
5+fi
6+
7+gcc -Dminimp3_test -O2 -g -o minimp3 minimp3.c
8+
9+APP=./minimp3
10+
11+set +e
12+for i in fate-suite.ffmpeg.org/mp3-conformance/*.bit; do
13+$($APP $i $i.out)
14+retval=$?
15+echo $i exited with code=$retval
16+cmp -s $i $i.out > /dev/null
17+if [ $? -eq 1 ]; then
18+ echo test failed
19+ exit 1
20+fi
21+done

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t