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 (quiet)])
11 AT_CHECK([RUN_FM -q on])
14 AT_SETUP(["off" command])
15 AT_CHECK([RUN_FM off], [0], [Radio muted
19 AT_SETUP(["off" command (quiet)])
20 AT_CHECK([RUN_FM -q off])
23 AT_SETUP(["+" command, in-range])
24 AT_CHECK([RUN_FM +], [0], [Setting volume to 60.00%
28 AT_SETUP(["+" command, in-range (quiet)])
29 AT_CHECK([RUN_FM -q +])
32 AT_SETUP(["+" command, in-range, customized increment])
33 AT_DATA([rc], [INCR 25
35 AT_CHECK([RUN_FM +], [0], [Setting volume to 75.00%
39 AT_SETUP(["+" command, clamp to 100%])
40 AT_CHECK([RUN_FM([99]) +], [0], [Setting volume to 100.00%
44 AT_SETUP(["-" command, in-range])
45 AT_CHECK([RUN_FM -], [0], [Setting volume to 40.00%
49 AT_SETUP(["-" command, in-range (quiet)])
50 AT_CHECK([RUN_FM -q -])
53 AT_SETUP(["-" command, in-range, customized increment])
54 AT_DATA([rc], [INCR 15
56 AT_CHECK([RUN_FM -], [0], [Setting volume to 35.00%
60 AT_SETUP(["-" command, clamp to 0%])
61 AT_CHECK([RUN_FM([5]) -], [0], [Setting volume to 0.00%
65 AT_SETUP([tune valid freq, default volume])
66 AT_CHECK([RUN_FM 90], [0], [Radio tuned to 90.00 MHz at 12.50% volume
70 AT_SETUP([tune valid freq, default volume (quiet) ])
71 AT_CHECK([RUN_FM -q 90])
74 AT_SETUP([tune valid freq, customized default volume])
77 AT_CHECK([RUN_FM 90], [0], [Radio tuned to 90.00 MHz at 80.00% volume
81 AT_SETUP([tune and wait 1 second])
82 AT_CHECK([RUN_FM -T 1s 90], [0], [Radio tuned to 90.00 MHz at 12.50% volume
83 Sleeping for 1 second(s)
87 AT_SETUP([tune valid freq, specific volume])
88 AT_CHECK([RUN_FM 90 55], [0], [Radio tuned to 90.00 MHz at 55.00% volume
92 AT_SETUP([tune invalid freq])
93 AT_CHECK([RUN_FM 80], [1], [],
94 [fm: Frequency 80.0 MHz out of range (89.0 - 91.0 MHz)
98 AT_SETUP([override tune invalid freq])
99 AT_CHECK([RUN_FM -o 80], [0], [Radio tuned to 80.00 MHz at 12.50% volume