File: audio.test

package info (click to toggle)
snack 2.2.10-dfsg1-12.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,024 kB
  • sloc: ansic: 35,473; sh: 8,557; tcl: 1,065; python: 701; makefile: 565
file content (50 lines) | stat: -rw-r--r-- 1,429 bytes parent folder | download | duplicates (9)
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
# Commands covered: snack::audio
#

package require -exact snack 2.2

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import ::tcltest::*
}

test audio-1.1 {snack::audio command with unknow sub-command} {
  catch {snack::audio junk} msg
  set msg
} {bad option "junk": must be outputDevices, inputDevices, selectOutput, selectInput, formats, frequencies, active, play_gain, record_gain, elapsedTime, currentSound, playLatency, scaling, encodings, rates, play, stop, or pause}

test audio-1.2 {snack::audio outputDevices command} {
  set devs [snack::audio outputDevices]
  set res [expr [string length $devs] > 0]
  set res
} 1

test audio-1.3 {snack::audio inputDevices command} {
  set devs [snack::audio inputDevices]
  set res [expr [string length $devs] > 0]
  set res
} 1

test audio-1.4 {snack::audio selectOutput command} {
  catch {snack::audio selectOutput junk} msg
  set msg
} {No such device: junk}

test audio-1.5 {snack::audio selectOutput command} {
  set dev [lindex [snack::audio outputDevices] 0]
  catch {snack::audio selectOutput $dev}
} 0

test audio-1.6 {snack::audio selectInput command} {
  catch {snack::audio selectInput junk} msg
  set msg
} {No such device: junk}

test audio-1.7 {snack::audio selectInput command} {
  set dev [lindex [snack::audio inputDevices] 0]
  catch {snack::audio selectInput $dev}
} 0

# cleanup
::tcltest::cleanupTests
return