-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix dos33.c getopt for BSAVE arguments
#18 - tested on OSX and Debian arm64 - bugfix display of length when `-d` debug is used - small fixes to usage terms
- Loading branch information
Showing
3 changed files
with
116 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
./test.sh | ||
./test_undelete2.sh | ||
./test_undelete.sh | ||
./test_bsave.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
echo "Testing dos33 BSAVE" | ||
|
||
fail() { | ||
echo "$1" >&2 | ||
num_failed=$(($num_failed + 1)) | ||
} | ||
num_failed=0 | ||
|
||
tempfile=$(mktemp -t temp.XXXXXXXXXX) | ||
run_test() { | ||
cmd_args=$1 | ||
shift | ||
expect_strings="$@" | ||
# run and assert return code is zero | ||
../dos33 -d ./test.dsk $cmd_args >"$tempfile" 2>&1 || fail "Command failed: $(cat "$tempfile")" | ||
# assert all expected strings are present in output | ||
for expect_str in $expect_strings | ||
do | ||
grep "$expect_str" "$tempfile" >/dev/null || fail "Command output missing expected string, '$expect_str'" | ||
done | ||
} | ||
|
||
cp empty.dsk test.dsk | ||
run_test "BSAVE SINCOS" \ | ||
"type=b" "Local filename: SINCOS" "Apple filename: SINCOS" | ||
run_test "BSAVE SINCOS EX1" \ | ||
"type=b" "Local filename: SINCOS" "Apple filename: EX1" | ||
run_test "BSAVE -a 0x2000 SINCOS EX2" \ | ||
"type=b" "Local filename: SINCOS" "Apple filename: EX2" "Address=8192" | ||
run_test "BSAVE -a 0x2000 -l 146 SINCOS EX3" \ | ||
"type=b" "Local filename: SINCOS" "Apple filename: EX3" "Address=8192" "Length=146" | ||
rm "$tempfile" | ||
if [ "$num_failed" -gt 0 ]; then | ||
echo "Test failed. $num_failed tests failed." | ||
exit 1 | ||
fi |