From: Andre Noll Date: Sun, 10 Apr 2016 21:46:02 +0000 (+0200) Subject: Merge branch 'refs/heads/t/attribute_fix' X-Git-Tag: v0.5.6~41 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=4ad8a5536d7cea1e63137933b242c52e57bd53d6;hp=ab51fc9c72dc51e76ccabbc150413c8031751436 Merge branch 'refs/heads/t/attribute_fix' com_setatt() was broken if more than 32 attributes are defined. The branch merged in this commit contains a fix for this bug, and a new test that exercises the code related to attributes. Was cooking in next for six weeks. * refs/heads/t/attribute_fix: manual: Add realpath to list of packages. Add test that exercises attribute code. test-lib: Canonicalize test_dir. attribute: Avoid shifting 32 bit integers. --- diff --git a/attribute.c b/attribute.c index f3f8ea7a..4cb29828 100644 --- a/attribute.c +++ b/attribute.c @@ -437,13 +437,13 @@ err: static int att_logical_or(struct osl_row *row, void *data) { - uint64_t *att_mask = data; + uint64_t *att_mask = data, one = 1; struct osl_object bitnum_obj; int ret = osl_get_object(attribute_table, row, ATTCOL_BITNUM, &bitnum_obj); if (ret < 0) return ret; - *att_mask |= 1 << *(unsigned char *)bitnum_obj.data; + *att_mask |= one << *(unsigned char *)bitnum_obj.data; return 0; } diff --git a/t/t0004-server.sh b/t/t0004-server.sh index 76128512..3cb37d42 100755 --- a/t/t0004-server.sh +++ b/t/t0004-server.sh @@ -48,6 +48,30 @@ required_objects[$i]='ogg_afh' cmdline[$i]="ls -l=v ${oggs_base[@]}" good[$i]='^basename:' +let i++ +commands[$i]='addatt' +required_objects[$i]='' +cmdline[$i]="addatt $(seq 64 | tr '\n' ' ')" +bad[$i]='.' + +let i++ +commands[$i]='lsatt' +required_objects[$i]='' +cmdline[$i]="lsatt" +good[$i]='^1$' + +let i++ +commands[$i]='setatt' +required_objects[$i]='ogg_afh' +cmdline[$i]="setatt 33+ ${oggs[@]}" +bad[$i]='.' + +let i++ +commands[$i]="ls" +required_objects[$i]='ogg_afh' +cmdline[$i]="ls -l=v -p ${oggs[@]}" +good[$i]='^attributes_txt: 33' + let i++ commands[$i]="term" cmdline[$i]="term" diff --git a/t/test-lib.sh b/t/test-lib.sh index 0e702b53..99e575d3 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -272,7 +272,7 @@ fixup_dirs() { local wd=$(pwd) - test_dir="$wd/${0%/*}" + test_dir="$(realpath $wd/${0%/*})" test_audio_file_dir="$test_dir/audio_files" [[ -z "$o_results_dir" ]] && o_results_dir="$test_dir/test-results" diff --git a/web/manual.m4 b/web/manual.m4 index 59abc538..addc2458 100644 --- a/web/manual.m4 +++ b/web/manual.m4 @@ -208,7 +208,7 @@ For the impatient: cd osl && make && sudo make install && sudo ldconfig sudo apt-get install autoconf libssl-dev help2man gengetopt \ libmad0-dev libid3tag0-dev libasound2-dev libvorbis-dev \ - libfaad-dev libspeex-dev libFLAC-dev libsamplerate-dev \ + libfaad-dev libspeex-dev libFLAC-dev libsamplerate-dev realpath \ libasound2-dev libao-dev libreadline-dev libncurses-dev \ libopus-dev