about summary refs log tree commit diff
path: root/test/ppmrough-parameters.test
blob: fb67424ee6c1042581b7fbdd1ac66d120309bcbc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#! /bin/sh
# This script tests: ppmrough
# Also requires:

tmpdir=${tmpdir:-/tmp}
test_out=${tmpdir}/test_out


# Test Invalid
echo "Test Invalid"

echo 1>&2
echo "Invalid command-line argument combinations." 1>&2
echo "Error messages should appear below the line." 1>&2
echo "-----------------------------------------------------------" 1>&2

ppmrough -h 10 -w 10 -top -1 > ${test_out} || \
  printf "Expected failure 1 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -h 10 -w 100 -top 11 > ${test_out} || \
  printf "Expected failure 2 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}


ppmrough -h 10 -w 10 -bottom -1 > ${test_out} || \
  printf "Expected failure 3 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -h 10 -w 1000 -bottom 11 > ${test_out} || \
  printf "Expected failure 4 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -h 10 -w 10 -left -1 > ${test_out} || \
  printf "Expected failure 5 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -h 10 -w 100 -left 101 > ${test_out} || \
  printf "Expected failure 6 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}


ppmrough -h 10 -w 10 -right -1 > ${test_out} || \
  printf "Expected failure 7 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -h 10 -w 1000 -right 1001 > ${test_out} || \
  printf "Expected failure 8 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}


ppmrough -width 0.1 > ${test_out} || \
  printf "Expected failure 9 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -width -1 > ${test_out} || \
  printf "Expected failure 10 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -width > ${test_out} || \
  printf "Expected failure 11 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}


ppmrough -height 0.1 > ${test_out} || \
  printf "Expected failure 12 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -height -1 > ${test_out} || \
  printf "Expected failure 13 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -height > ${test_out} || \
  printf "Expected failure 14 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}


ppmrough -randomseed 0.1 > ${test_out} || \
  printf "Expected failure 15 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -randomseed -1 > ${test_out} || \
  printf "Expected failure 16 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -randomseed > ${test_out} || \
  printf "Expected failure 17 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}



ppmrough -var A > ${test_out} || \
  printf "Expected failure 20 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -var -1 > ${test_out} || \
  printf "Expected failure 18 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -var > ${test_out} || \
  printf "Expected failure 19 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}


ppmrough -bg redmint > ${test_out} || \
  printf "Expected failure 20 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -bg > ${test_out} || \
  printf "Expected failure 21 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}


ppmrough -fg redmint > ${test_out} || \
  printf "Expected failure 22 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}

ppmrough -fg > ${test_out} || \
  printf "Expected failure 23 "
  test -s ${test_out} && echo "unexpected output" || echo "(no output)"
  rm -f ${test_out}