diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2016-04-23 23:44:32 +1200 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2016-04-23 23:44:32 +1200 |
commit | 01a3d56ab3c71a065c3b827740dade5f27e95ef3 (patch) | |
tree | 4deb062bae8e342016caf3d471284038707023da | |
parent | 69b95d4a4a3cfdac9eb0a8f03c7bf381eac3a3e1 (diff) | |
download | cue-bin-split-01a3d56ab3c71a065c3b827740dade5f27e95ef3.tar.xz |
Improved test coverage
-rw-r--r-- | cue-bin-split.c | 1 | ||||
-rwxr-xr-x | test/005-invalid-arg.test/run.sh | 8 | ||||
-rwxr-xr-x | test/006-bad-format.test/run.sh | 8 | ||||
-rwxr-xr-x | test/007-unreadable-infile.test/run.sh | 13 | ||||
-rw-r--r-- | test/007-unreadable-infile.test/stderr.expected | 1 | ||||
-rwxr-xr-x | test/008-unwritable-outfile.test/run.sh | 13 | ||||
-rw-r--r-- | test/008-unwritable-outfile.test/stderr.expected | 1 |
7 files changed, 44 insertions, 1 deletions
diff --git a/cue-bin-split.c b/cue-bin-split.c index 17635f6..4ebd843 100644 --- a/cue-bin-split.c +++ b/cue-bin-split.c @@ -49,7 +49,6 @@ void args_collect(int *argc, char ***argv, int *rate, int *channels, int *sample case '?': default: die_help(); - break; } } diff --git a/test/005-invalid-arg.test/run.sh b/test/005-invalid-arg.test/run.sh new file mode 100755 index 0000000..3afc848 --- /dev/null +++ b/test/005-invalid-arg.test/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +${EXECUTABLE} -Q seventeen +if [ $? -eq 0 ]; then + exit 1 +else + exit 0 +fi diff --git a/test/006-bad-format.test/run.sh b/test/006-bad-format.test/run.sh new file mode 100755 index 0000000..e53f7d6 --- /dev/null +++ b/test/006-bad-format.test/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +${EXECUTABLE} -r 1 -c 1 -i /dev/zero -s 1 +if [ $? -eq 0 ]; then + exit 1 +else + exit 0 +fi diff --git a/test/007-unreadable-infile.test/run.sh b/test/007-unreadable-infile.test/run.sh new file mode 100755 index 0000000..0d8262d --- /dev/null +++ b/test/007-unreadable-infile.test/run.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +touch foo.in +chmod -r foo.in + +${EXECUTABLE} -r 1 -c 1 -i foo.in -s 1 -f track%2d.raw + +if [ $? -eq 0 ]; then + exit 1 +else + rm -f foo.in + exit 0 +fi diff --git a/test/007-unreadable-infile.test/stderr.expected b/test/007-unreadable-infile.test/stderr.expected new file mode 100644 index 0000000..58b22e3 --- /dev/null +++ b/test/007-unreadable-infile.test/stderr.expected @@ -0,0 +1 @@ +Failed to open 'foo.in': fopen: Permission denied diff --git a/test/008-unwritable-outfile.test/run.sh b/test/008-unwritable-outfile.test/run.sh new file mode 100755 index 0000000..c8f1b4c --- /dev/null +++ b/test/008-unwritable-outfile.test/run.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +touch track.raw +chmod -w track.raw + +echo -e '0:0:0\n1:0:0' | ${EXECUTABLE} -r 1 -c 1 -i /dev/null -s 1 -f track.raw + +if [ $? -eq 0 ]; then + exit 1 +else + rm -f track.raw + exit 0 +fi diff --git a/test/008-unwritable-outfile.test/stderr.expected b/test/008-unwritable-outfile.test/stderr.expected new file mode 100644 index 0000000..37328e8 --- /dev/null +++ b/test/008-unwritable-outfile.test/stderr.expected @@ -0,0 +1 @@ +Failed to open 'track.raw': fopen: Permission denied |