1 m4_define([RUN_FM], [fm -c rc -d m4_if([$1], [], test, ['test $1'])])
5 AT_SETUP(["on" command])
6 AT_CHECK([RUN_FM on], [0], [Radio on at 50.00% volume
10 AT_SETUP(["on" command (no volume control)])
11 AT_CHECK([RUN_FM([-1]) on], [0], [Radio on (radio does not support volume control)
15 AT_SETUP(["on" command (quiet)])
16 AT_CHECK([RUN_FM -q on])
19 AT_SETUP(["off" command])
20 AT_CHECK([RUN_FM off], [0], [Radio muted
24 AT_SETUP(["off" command (quiet)])
25 AT_CHECK([RUN_FM -q off])
28 AT_SETUP(["+" command, no volume control])
29 AT_CHECK([RUN_FM([-1]) +], [1], [], [fm: Radio does not support volume control
33 AT_SETUP(["+" command, in-range])
34 AT_CHECK([RUN_FM +], [0], [Setting volume to 60.00%
38 AT_SETUP(["+" command, in-range (muted)])
39 AT_CHECK([RUN_FM([50 1]) +], [0],
40 [Setting volume to 60.00% (radio is muted, use "fm on" to unmute)
44 AT_SETUP(["+" command, in-range (quiet)])
45 AT_CHECK([RUN_FM -q +])
48 AT_SETUP(["+" command, in-range, customized increment])
49 AT_DATA([rc], [INCR 25
51 AT_CHECK([RUN_FM +], [0], [Setting volume to 75.00%
55 AT_SETUP(["+" command, clamp to 100%])
56 AT_CHECK([RUN_FM([99]) +], [0], [Setting volume to 100.00%
60 AT_SETUP(["-" command, no volume control])
61 AT_CHECK([RUN_FM([-1]) -], [1], [], [fm: Radio does not support volume control
65 AT_SETUP(["-" command, in-range])
66 AT_CHECK([RUN_FM -], [0], [Setting volume to 40.00%
70 AT_SETUP(["-" command, in-range (quiet)])
71 AT_CHECK([RUN_FM -q -])
74 AT_SETUP(["-" command, in-range, customized increment])
75 AT_DATA([rc], [INCR 15
77 AT_CHECK([RUN_FM -], [0], [Setting volume to 35.00%
81 AT_SETUP(["-" command, clamp to 0%])
82 AT_CHECK([RUN_FM([5]) -], [0], [Setting volume to 0.00%
86 AT_SETUP([tune valid freq, default volume])
87 AT_CHECK([RUN_FM 90], [0], [Radio tuned to 90.00 MHz at 12.50% volume
91 AT_SETUP([tune valid freq, default volume])
92 AT_CHECK([RUN_FM 90], [0], [Radio tuned to 90.00 MHz at 12.50% volume
96 AT_SETUP([tune valid freq, muted])
97 AT_CHECK([RUN_FM([50 1]) 90], [0],
98 [Radio tuned to 90.00 MHz at 12.50% volume (radio is muted, use "fm on" to unmute)
102 AT_SETUP([tune valid freq, default volume (quiet) ])
103 AT_CHECK([RUN_FM -q 90])
106 AT_SETUP([tune valid freq, customized default volume])
107 AT_DATA([rc], [VOL 80
109 AT_CHECK([RUN_FM 90], [0], [Radio tuned to 90.00 MHz at 80.00% volume
113 AT_SETUP([tune and wait 1 second])
114 AT_CHECK([RUN_FM -T 1s 90], [0], [Radio tuned to 90.00 MHz at 12.50% volume
115 Sleeping for 1 second(s)
119 AT_SETUP([tune valid freq, specific volume])
120 AT_CHECK([RUN_FM 90 55], [0], [Radio tuned to 90.00 MHz at 55.00% volume
124 AT_SETUP([tune invalid freq])
125 AT_CHECK([RUN_FM 80], [1], [],
126 [fm: Frequency 80.0 MHz out of range (89.0 - 91.0 MHz)
130 AT_SETUP([override tune invalid freq])
131 AT_CHECK([RUN_FM -o 80], [0], [Radio tuned to 80.00 MHz at 12.50% volume