clean up code by emulating perl's 'die' command
[platform/upstream/flac.git] / test / test_libFLAC++.sh
index e9e39d8..db3857d 100755 (executable)
 #  along with this program; if not, write to the Free Software
 #  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
+die ()
+{
+       echo $* 1>&2
+       exit 1
+}
+
 LD_LIBRARY_PATH=../src/libFLAC++/.libs:../src/libFLAC/.libs:../obj/release/lib:../obj/debug/lib:$LD_LIBRARY_PATH
 export LD_LIBRARY_PATH
 PATH=../src/test_libFLAC++:../obj/release/bin:../obj/debug/bin:$PATH
@@ -31,7 +37,4 @@ run_test_libFLACpp ()
        fi
 }
 
-if run_test_libFLACpp ; then : ; else
-       echo "ERROR during test_libFLAC++" 1>&2
-       exit 1
-fi
+run_test_libFLACpp || die "ERROR during test_libFLAC++"