| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Go Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style | |
| 3 // license that can be found in the LICENSE file. | |
| 4 | |
| 5 // +build darwin | |
| 6 | |
| 7 package audio | |
| 8 | |
| 9 import ( | |
| 10 "testing" | |
| 11 "time" | |
| 12 ) | |
| 13 | |
| 14 func TestNoOp(t *testing.T) { | |
| 15 var p *Player | |
| 16 if err := p.Play(); err != nil { | |
| 17 t.Errorf("no-op player failed to play: %v", err) | |
| 18 } | |
| 19 if err := p.Pause(); err != nil { | |
| 20 t.Errorf("no-op player failed to pause: %v", err) | |
| 21 } | |
| 22 if err := p.Stop(); err != nil { | |
| 23 t.Errorf("no-op player failed to stop: %v", err) | |
| 24 } | |
| 25 if c := p.Current(); c != time.Duration(0) { | |
| 26 t.Errorf("no-op player returns a non-zero playback position: %v"
, c) | |
| 27 } | |
| 28 if tot := p.Total(); tot != time.Duration(0) { | |
| 29 t.Errorf("no-op player returns a non-zero total: %v", tot) | |
| 30 } | |
| 31 if vol := p.Volume(); vol != 0 { | |
| 32 t.Errorf("no-op player returns a non-zero total: %v", vol) | |
| 33 } | |
| 34 if s := p.State(); s != Unknown { | |
| 35 t.Errorf("playing state: %v", s) | |
| 36 } | |
| 37 p.SetVolume(0.1) | |
| 38 p.Seek(time.Duration(100)) | |
| 39 p.Destroy() | |
| 40 } | |
| OLD | NEW |