File: test-fm.at

package info (click to toggle)
fmtools 2.0.8
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 220 kB
  • sloc: sh: 2,196; ansic: 687; makefile: 54
file content (133 lines) | stat: -rw-r--r-- 3,088 bytes parent folder | download | duplicates (2)
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
m4_define([RUN_FM], [fm -c rc -d m4_if([$1], [], test, ['test $1'])])

AT_BANNER([fm])

AT_SETUP(["on" command])
AT_CHECK([RUN_FM on], [0], [Radio on at 50.00% volume
])
AT_CLEANUP

AT_SETUP(["on" command (no volume control)])
AT_CHECK([RUN_FM([-1]) on], [0], [Radio on (radio does not support volume control)
])
AT_CLEANUP

AT_SETUP(["on" command (quiet)])
AT_CHECK([RUN_FM -q on])
AT_CLEANUP

AT_SETUP(["off" command])
AT_CHECK([RUN_FM off], [0], [Radio muted
])
AT_CLEANUP

AT_SETUP(["off" command (quiet)])
AT_CHECK([RUN_FM -q off])
AT_CLEANUP

AT_SETUP(["+" command, no volume control])
AT_CHECK([RUN_FM([-1]) +], [1], [], [fm: Radio does not support volume control
])
AT_CLEANUP

AT_SETUP(["+" command, in-range])
AT_CHECK([RUN_FM +], [0], [Setting volume to 60.00%
])
AT_CLEANUP

AT_SETUP(["+" command, in-range (muted)])
AT_CHECK([RUN_FM([50 1]) +], [0], 
  [Setting volume to 60.00% (radio is muted, use "fm on" to unmute)
])
AT_CLEANUP

AT_SETUP(["+" command, in-range (quiet)])
AT_CHECK([RUN_FM -q +])
AT_CLEANUP

AT_SETUP(["+" command, in-range, customized increment])
AT_DATA([rc], [INCR 25
])
AT_CHECK([RUN_FM +], [0], [Setting volume to 75.00%
])
AT_CLEANUP

AT_SETUP(["+" command, clamp to 100%])
AT_CHECK([RUN_FM([99]) +], [0], [Setting volume to 100.00%
])
AT_CLEANUP

AT_SETUP(["-" command, no volume control])
AT_CHECK([RUN_FM([-1]) -], [1], [], [fm: Radio does not support volume control
])
AT_CLEANUP

AT_SETUP(["-" command, in-range])
AT_CHECK([RUN_FM -], [0], [Setting volume to 40.00%
])
AT_CLEANUP

AT_SETUP(["-" command, in-range (quiet)])
AT_CHECK([RUN_FM -q -])
AT_CLEANUP

AT_SETUP(["-" command, in-range, customized increment])
AT_DATA([rc], [INCR 15
])
AT_CHECK([RUN_FM -], [0], [Setting volume to 35.00%
])
AT_CLEANUP

AT_SETUP(["-" command, clamp to 0%])
AT_CHECK([RUN_FM([5]) -], [0], [Setting volume to 0.00%
])
AT_CLEANUP

AT_SETUP([tune valid freq, default volume])
AT_CHECK([RUN_FM 90], [0], [Radio tuned to 90.00 MHz at 12.50% volume
])
AT_CLEANUP

AT_SETUP([tune valid freq, default volume])
AT_CHECK([RUN_FM 90], [0], [Radio tuned to 90.00 MHz at 12.50% volume
])
AT_CLEANUP

AT_SETUP([tune valid freq, muted])
AT_CHECK([RUN_FM([50 1]) 90], [0], 
  [Radio tuned to 90.00 MHz at 12.50% volume (radio is muted, use "fm on" to unmute)
])
AT_CLEANUP

AT_SETUP([tune valid freq, default volume (quiet) ])
AT_CHECK([RUN_FM -q 90])
AT_CLEANUP

AT_SETUP([tune valid freq, customized default volume])
AT_DATA([rc], [VOL 80
])
AT_CHECK([RUN_FM 90], [0], [Radio tuned to 90.00 MHz at 80.00% volume
])
AT_CLEANUP

AT_SETUP([tune and wait 1 second])
AT_CHECK([RUN_FM -T 1s 90], [0], [Radio tuned to 90.00 MHz at 12.50% volume
Sleeping for 1 second(s)
])
AT_CLEANUP

AT_SETUP([tune valid freq, specific volume])
AT_CHECK([RUN_FM 90 55], [0], [Radio tuned to 90.00 MHz at 55.00% volume
])
AT_CLEANUP

AT_SETUP([tune invalid freq])
AT_CHECK([RUN_FM 80], [1], [], 
  [fm: Frequency 80.0 MHz out of range (89.0 - 91.0 MHz)
])
AT_CLEANUP

AT_SETUP([override tune invalid freq])
AT_CHECK([RUN_FM -o 80], [0], [Radio tuned to 80.00 MHz at 12.50% volume
])
AT_CLEANUP