Revision c8c05ed9b72d8a7871cc9cc2930989fd703511fb authored by Aleksander Guryanov on 19 October 2020, 21:41:27 UTC, committed by GitHub on 19 October 2020, 21:41:27 UTC
SDL Docs say:

===
 int Mix_PlayMusic(Mix_Music *music, int loops)

music
    Pointer to Mix_Music to play. 
loops
    number of times to play through the music.
    0 plays the music zero times...
    -1 plays the music forever (or as close as it can get to that) 
===

So we should not play at all with 0, but it turns out SDL actually does
in practice. So don't change that. And for 1, we should play one time and
stop, and not loop forever, which this patch fixes.
1 parent 37b5cfa
Raw File
test.sh
# e.g.
#   ~/Dev/emscripten/tests/fuzz$ CSMITH=~/Dev/csmith/src/csmith CSMITH_PATH=~/Dev/csmith python ./csmith_driver.py
# to find failures, then check those out with this script

echo "builds"
rm *.out *.bc *.js
gcc $@ -m32 -I/home/alon/Dev/csmith/runtime -o n1.out &> /dev/null
/home/alon/Dev/fastcomp/build/Release+Asserts/bin/clang -m32 -I/home/alon/Dev/csmith/runtime -o n2.out $@ &> /dev/null
/home/alon/Dev/fastcomp/build/Release+Asserts/bin/clang -m32 -I/home/alon/Dev/csmith/runtime -emit-llvm -c -o bc.bc $@ &> o
~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js --memory-init-file 0 -profiling &> /dev/null
~/Dev/emscripten/emcc $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o fc-sh.out.js &> /dev/null
echo "run n1"
./n1.out &> n1
echo "run n2"
./n2.out &> n2
echo "run bc"
/home/alon/Dev/fastcomp/build/Release+Asserts/bin/lli bc.bc &> bc
#echo "run js"
#mozjs js.out.js &> js
#echo "run ua"
#mozjs ua.out.js &> ua
#echo "run sh"
#mozjs sh.out.js &> sh
echo "run fc"
mozjs fc.out.js &> fc
echo "run fc-sh"
mozjs fc-sh.out.js &> fc-sh
echo "n/n"
diff n1 n2
echo "n/bc"
diff n1 bc
#echo "n/js"
#diff n1 js | grep -v warning
#echo "n/js-ua"
#diff n1 ua | grep -v warning
#echo "n/js-sh"
#diff n1 sh | grep -v warning
#echo "js/fc"
#diff fc js | grep -v warning
echo "native/fc"
grep -v warning fc > fclean
diff -U5 n1 fclean | grep -v warning
echo "native2/fc"
grep -v warning fc > fclean
diff -U5 n2 fclean | grep -v warning
echo "js/fc-sh"
diff -U5 fc fc-sh | grep -v warning

back to top