aboutsummaryrefslogtreecommitdiff
path: root/test/004-two-tracks.test
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-03-15 12:21:10 +1300
committerDavid Phillips <dbphillipsnz@gmail.com>2016-03-15 12:21:10 +1300
commit259e64c31f72bf54a7f54544c10472107e8c752c (patch)
treed99dc3367b425ded8b7a65c99a840c5a9979b66d /test/004-two-tracks.test
parent1e161f2c7ae3602d2cf70e693ef3cee67ae786e9 (diff)
downloadcue-bin-split-259e64c31f72bf54a7f54544c10472107e8c752c.tar.xz
Add simplified test for multiple tracks
Diffstat (limited to 'test/004-two-tracks.test')
-rw-r--r--test/004-two-tracks.test/run.sh18
-rw-r--r--test/004-two-tracks.test/stdout.expected4
-rw-r--r--test/004-two-tracks.test/track_1.raw.expected1
-rw-r--r--test/004-two-tracks.test/track_2.raw.expected1
-rw-r--r--test/004-two-tracks.test/track_3.raw.expected1
-rw-r--r--test/004-two-tracks.test/track_4.raw.expected1
6 files changed, 26 insertions, 0 deletions
diff --git a/test/004-two-tracks.test/run.sh b/test/004-two-tracks.test/run.sh
new file mode 100644
index 0000000..7bb987c
--- /dev/null
+++ b/test/004-two-tracks.test/run.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# create large file
+echo 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ > raw
+
+echo -e '0:0:0\n0:1:0\n0:4:0\n0:10:0' | ${EXECUTABLE} -r 1 -c 1 -s 1 -i raw -f track_%d.raw
+
+
+for track in track_{1..4}.raw ; do
+ diff $track $track.expected >/dev/null
+ if [ $? -eq 0 ] ; then
+ rm $track
+ else
+ exit 1
+ fi
+done
+
+rm raw
diff --git a/test/004-two-tracks.test/stdout.expected b/test/004-two-tracks.test/stdout.expected
new file mode 100644
index 0000000..fc02f0b
--- /dev/null
+++ b/test/004-two-tracks.test/stdout.expected
@@ -0,0 +1,4 @@
+track_1.raw starts 0.000000 s, finishes 1.000000 s
+track_2.raw starts 1.000000 s, finishes 4.000000 s
+track_3.raw starts 4.000000 s, finishes 10.000000 s
+track_4.raw starts 10.000000 s, finishes EOF
diff --git a/test/004-two-tracks.test/track_1.raw.expected b/test/004-two-tracks.test/track_1.raw.expected
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ b/test/004-two-tracks.test/track_1.raw.expected
@@ -0,0 +1 @@
+0 \ No newline at end of file
diff --git a/test/004-two-tracks.test/track_2.raw.expected b/test/004-two-tracks.test/track_2.raw.expected
new file mode 100644
index 0000000..d800886
--- /dev/null
+++ b/test/004-two-tracks.test/track_2.raw.expected
@@ -0,0 +1 @@
+123 \ No newline at end of file
diff --git a/test/004-two-tracks.test/track_3.raw.expected b/test/004-two-tracks.test/track_3.raw.expected
new file mode 100644
index 0000000..be01025
--- /dev/null
+++ b/test/004-two-tracks.test/track_3.raw.expected
@@ -0,0 +1 @@
+456789 \ No newline at end of file
diff --git a/test/004-two-tracks.test/track_4.raw.expected b/test/004-two-tracks.test/track_4.raw.expected
new file mode 100644
index 0000000..72d007b
--- /dev/null
+++ b/test/004-two-tracks.test/track_4.raw.expected
@@ -0,0 +1 @@
+ABCDEFGHIJKLMNOPQRSTUVWXYZ