diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/002-missing_arguments.sh | 2 | ||||
| -rw-r--r-- | tests/003-too_many_arguments.sh | 2 | ||||
| -rw-r--r-- | tests/004-unknown_option.sh | 2 | ||||
| -rw-r--r-- | tests/005-missing_argument_for_option.sh | 2 | ||||
| -rw-r--r-- | tests/006-incorrect_buffer_size.sh | 4 | ||||
| -rw-r--r-- | tests/100-cannot_open_files.sh | 6 | ||||
| -rw-r--r-- | tests/400-successful_backup_restore.sh | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/tests/002-missing_arguments.sh b/tests/002-missing_arguments.sh index c3aaa1b..2ebbd55 100644 --- a/tests/002-missing_arguments.sh +++ b/tests/002-missing_arguments.sh @@ -4,7 +4,7 @@ source ./assert.sh PROGRAM_EXEC="$1" -assert "Usage" "missing input file" 1 $PROGRAM_EXEC backup +assert "Usage" "missing input file" 1 $PROGRAM_EXEC create assert "Usage" "missing diff file" 1 $PROGRAM_EXEC restore exit 0 diff --git a/tests/003-too_many_arguments.sh b/tests/003-too_many_arguments.sh index 2891afd..dc53a69 100644 --- a/tests/003-too_many_arguments.sh +++ b/tests/003-too_many_arguments.sh @@ -4,7 +4,7 @@ source ./assert.sh PROGRAM_EXEC="$1" -assert "Usage" "too many arguments" 1 $PROGRAM_EXEC backup -i arg1 -b arg2 -o arg3 arg4 +assert "Usage" "too many arguments" 1 $PROGRAM_EXEC create -i arg1 -b arg2 -o arg3 arg4 assert "Usage" "too many arguments" 1 $PROGRAM_EXEC restore -d arg1 -o arg2 arg3 exit 0 diff --git a/tests/004-unknown_option.sh b/tests/004-unknown_option.sh index 452d904..9ed0d66 100644 --- a/tests/004-unknown_option.sh +++ b/tests/004-unknown_option.sh @@ -4,7 +4,7 @@ source ./assert.sh PROGRAM_EXEC="$1" -assert "Usage" "unknown option '-x'" 1 $PROGRAM_EXEC backup -x -i in -b base -o out +assert "Usage" "unknown option '-x'" 1 $PROGRAM_EXEC create -x -i in -b base -o out assert "Usage" "unknown option '-x'" 1 $PROGRAM_EXEC restore -x -d diff -o out exit 0 diff --git a/tests/005-missing_argument_for_option.sh b/tests/005-missing_argument_for_option.sh index 26569bc..6fdf18e 100644 --- a/tests/005-missing_argument_for_option.sh +++ b/tests/005-missing_argument_for_option.sh @@ -4,7 +4,7 @@ source ./assert.sh PROGRAM_EXEC="$1" -assert "Usage" "missing argument for option '-B'" 1 $PROGRAM_EXEC backup -B +assert "Usage" "missing argument for option '-B'" 1 $PROGRAM_EXEC create -B assert "Usage" "missing argument for option '-B'" 1 $PROGRAM_EXEC restore -B diff --git a/tests/006-incorrect_buffer_size.sh b/tests/006-incorrect_buffer_size.sh index 9c9b4ea..f104ebb 100644 --- a/tests/006-incorrect_buffer_size.sh +++ b/tests/006-incorrect_buffer_size.sh @@ -4,8 +4,8 @@ source ./assert.sh PROGRAM_EXEC="$1" -assert "Usage" "incorrect buffer size" 1 $PROGRAM_EXEC backup -B abc123 -i in -b base -o out -assert "Usage" "buffer size cannot be 0" 1 $PROGRAM_EXEC backup -B 0 -i in -b base -o out +assert "Usage" "incorrect buffer size" 1 $PROGRAM_EXEC create -B abc123 -i in -b base -o out +assert "Usage" "buffer size cannot be 0" 1 $PROGRAM_EXEC create -B 0 -i in -b base -o out assert "Usage" "incorrect buffer size" 1 $PROGRAM_EXEC restore -B abc123 -d diff -o out assert "Usage" "buffer size cannot be 0" 1 $PROGRAM_EXEC restore -B 0 -d diff -o out diff --git a/tests/100-cannot_open_files.sh b/tests/100-cannot_open_files.sh index e0a59d3..3ef74a6 100644 --- a/tests/100-cannot_open_files.sh +++ b/tests/100-cannot_open_files.sh @@ -6,18 +6,18 @@ PROGRAM_EXEC="$1" rm -f input base out touch base out -assert "" "cannot open input file" 1 $PROGRAM_EXEC backup -i input -b base -o out +assert "" "cannot open input file" 1 $PROGRAM_EXEC create -i input -b base -o out rm -f input base out touch input out -assert "" "cannot open base file" 1 $PROGRAM_EXEC backup -i input -b base -o out +assert "" "cannot open base file" 1 $PROGRAM_EXEC create -i input -b base -o out rm -f input base out rmdir outdir 2>/dev/null touch input base mkdir outdir chmod -w outdir -assert "" "cannot open output file" 1 $PROGRAM_EXEC backup -i input -b base -o outdir/out +assert "" "cannot open output file" 1 $PROGRAM_EXEC create -i input -b base -o outdir/out rm -f input base out rmdir outdir diff --git a/tests/400-successful_backup_restore.sh b/tests/400-successful_backup_restore.sh index f1a07c5..a10853b 100644 --- a/tests/400-successful_backup_restore.sh +++ b/tests/400-successful_backup_restore.sh @@ -29,7 +29,7 @@ printf '\xFF' | dd of=input bs=1 count=1 seek=$(( (512 * 3) - 1 )) conv=notrunc # The fourth sector will have the middle byte changed printf '\xFF' | dd of=input bs=1 count=1 seek=$(( (512 * 4) - (512 / 2) )) conv=notrunc 1>/dev/null 2>&1 -assert "" "" 0 $PROGRAM_EXEC backup -i input -b base -o out +assert "" "" 0 $PROGRAM_EXEC create -i input -b base -o out if ! files_are_the_same out 400-expected_backup_output.bin; then echo "assert: Backup output file differs from the expected one" |
