Skip to content

Commit

Permalink
Eliminated an unnecessary use of python.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdadams committed Jan 31, 2024
1 parent 717dc0b commit 67e6541
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
4 changes: 2 additions & 2 deletions test/bin/run_conformance_tests
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,17 @@ if [ "$enable_jasper_tests" -ne 0 ]; then
fi

if [ "$verbose" -ge 3 ]; then
python -c 'print("*" * 80)'
cat <<- EOF
$(repeat_string 80 '*')
test case ID: $testcase
encoded file: $enc_file
reference file: $orig_file
decoded file: $dec_file
number of components: $num_comps
size: $width $height
precision: $prec
$(repeat_string 80 '*')
EOF
python -c 'print("*" * 80)'
fi

buffer=$("$imginfo" -q < "$enc_file" 2> /dev/null)
Expand Down
30 changes: 21 additions & 9 deletions test/bin/utilities
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
#
################################################################################

function panic()
panic()
{
echo "ERROR: $@" 1>&2
exit 1
}

function eecho()
eecho()
{
echo "$@" 1>&2
}

function set_source_and_build_dirs()
set_source_and_build_dirs()
{
#eecho "JAS_ABS_TOP_BUILDDIR $JAS_ABS_TOP_BUILDDIR"
#eecho "JAS_TOP_BUILDDIR $JAS_TOP_BUILDDIR"
Expand All @@ -36,7 +36,7 @@ function set_source_and_build_dirs()
#eecho "top_srcdir=$top_srcdir"
}

function get_tmp_dir()
get_tmp_dir()
{
local package="jasper"
if [ $# -ne 1 ]; then
Expand All @@ -46,7 +46,7 @@ function get_tmp_dir()
echo "/tmp/$package-$USER@$HOSTNAME/$name-$$"
}

function make_tmp_dir()
make_tmp_dir()
{
local name
if [ $# -ge 1 ]; then
Expand All @@ -62,7 +62,7 @@ function make_tmp_dir()
echo "$tmp_dir"
}

function make_tmp_dir_2()
make_tmp_dir_2()
{
[ $# -eq 1 ] || return 1
local template="$1"
Expand All @@ -75,7 +75,7 @@ function make_tmp_dir_2()
# Image characteristics.
################################################################################

function image_which()
image_which()
{
if [ $# -ne 2 ]; then
return 2
Expand All @@ -94,7 +94,7 @@ function image_which()
echo "$file"
}

function image_info()
image_info()
{
#eecho "IMGINFO_COMMAND $IMGINFO_COMMAND"
if [ $# -ne 2 ]; then
Expand Down Expand Up @@ -234,7 +234,7 @@ tcf_gettestids()
eval declare -g -a "$name"=\("$buffer"\)
}

function evaluate_expression()
evaluate_expression()
{
[ $# -eq 1 ] || return 1
local expr="$1"
Expand All @@ -252,3 +252,15 @@ is_supported_format()
grep -q '^'"$format"'$' && supported=1
echo "$supported"
}

repeat_string()
{
[ $# -eq 2 ] || return 1
local n="$1"
local string="$2"
local buffer=
for((i = 0; i < $n; ++i)); do
buffer="$buffer$string"
done
echo "$buffer"
}

0 comments on commit 67e6541

Please sign in to comment.