Skip to content

Commit

Permalink
Use 'printf' with 'wc'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Dec 17, 2023
1 parent 367fc34 commit 6e9f831
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/asm/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ for i in *.asm; do
desired_binname=${i%.asm}.out.bin
if [ -f "$desired_binname" ]; then
"$RGBLINK" -o "$gb" "$o"
rom_size=$(wc -c < "$desired_binname")
rom_size=$(printf %s $(wc -c <"$desired_binname"))
dd if="$gb" count=1 bs="$rom_size" >"$output" 2>/dev/null
tryCmp "$desired_binname" "$output" gb
(( our_rc = our_rc || $? ))
Expand Down
4 changes: 2 additions & 2 deletions test/link/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tryCmp () {
fi
}
tryCmpRom () {
rom_size=$(wc -c <"$1")
rom_size=$(printf %s $(wc -c <"$1"))
dd if="$gbtemp" count=1 bs="$rom_size" >"$otemp" 2>/dev/null
tryCmp "$1" "$otemp"
}
Expand Down Expand Up @@ -152,7 +152,7 @@ rgblinkQuiet -o "$gbtemp" -S romx=3 "$otemp" >"$outtemp" 2>&1
tryDiff scramble-romx/out.err "$outtemp"
(( rc = rc || $? ))
# This test does not compare its exact output with 'tryCmpRom' because no scrambling order is guaranteed
rom_size=$(wc -c <"$gbtemp")
rom_size=$(printf %s $(wc -c <"$gbtemp"))
test "$rom_size" = 65536 # Check for exactly 3 ROMX banks
(( rc = rc || $? ))

Expand Down

0 comments on commit 6e9f831

Please sign in to comment.