File: swap.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 (31 lines) | stat: -rw-r--r-- 646 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
# Commands covered: sound swap
#

package require -exact snack 2.2

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

test swap-1.1 {swap command} {
  set s1 [snack::sound s1 -load ex1.wav]
  set s2 [snack::sound s2]

  $s1 swap $s2
  set res [$s1 info],[$s2 info]
  $s1 destroy
  $s2 destroy
  set res
} {0 16000 0 0 Lin16 1 WAV 44,15820 16000 14264 -8288 Lin16 1 RAW 0}

test swap-1.2 {swap command, syntax check} {
  set s [snack::sound snd]
  catch {$s swap} msg
  $s destroy
  set msg
} {wrong # args: should be "snd swap sound"}

# cleanup
::tcltest::cleanupTests
return