mdbx-test: minor refine stochastic script to be able use arithmetic in the arguments.

This commit is contained in:
Leonid Yuriev 2021-07-13 09:47:28 +03:00
parent ebfffe3f2b
commit f749b3deee

View File

@ -47,7 +47,7 @@ do
SKIP_MAKE=yes SKIP_MAKE=yes
;; ;;
--from) --from)
FROM="$2" FROM=$(($2))
if [ -z "$FROM" -o "$FROM" -lt 1 ]; then if [ -z "$FROM" -o "$FROM" -lt 1 ]; then
echo "Invalid value '$FROM' for --from option" echo "Invalid value '$FROM' for --from option"
exit -2 exit -2
@ -55,7 +55,7 @@ do
shift shift
;; ;;
--upto) --upto)
UPTO="$2" UPTO=$(($2))
if [ -z "$UPTO" -o "$UPTO" -lt 1 ]; then if [ -z "$UPTO" -o "$UPTO" -lt 1 ]; then
echo "Invalid value '$UPTO' for --upto option" echo "Invalid value '$UPTO' for --upto option"
exit -2 exit -2
@ -63,7 +63,7 @@ do
shift shift
;; ;;
--loops) --loops)
LOOPS="$2" LOOPS=$(($2))
if [ -z "$LOOPS" -o "$LOOPS" -lt 1 -o "$LOOPS" -gt 99 ]; then if [ -z "$LOOPS" -o "$LOOPS" -lt 1 -o "$LOOPS" -gt 99 ]; then
echo "Invalid value '$LOOPS' for --loops option" echo "Invalid value '$LOOPS' for --loops option"
exit -2 exit -2
@ -79,7 +79,7 @@ do
shift shift
;; ;;
--db-upto-mb) --db-upto-mb)
DB_UPTO_MB="$2" DB_UPTO_MB=$(($2))
if [ -z "$DB_UPTO_MB" -o "$DB_UPTO_MB" -lt 1 -o "$DB_UPTO_MB" -gt 4194304 ]; then if [ -z "$DB_UPTO_MB" -o "$DB_UPTO_MB" -lt 1 -o "$DB_UPTO_MB" -gt 4194304 ]; then
echo "Invalid value '$DB_UPTO_MB' for --db-upto-mb option" echo "Invalid value '$DB_UPTO_MB' for --db-upto-mb option"
exit -2 exit -2