File: test_pulse.scm

package info (click to toggle)
aiscm 0.20.1-1
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 7,084 kB
  • sloc: lisp: 7,406; sh: 4,184; ansic: 3,613; makefile: 266
file content (38 lines) | stat: -rw-r--r-- 1,569 bytes parent folder | download
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
;; AIscm - Guile extension for numerical arrays and tensors.
;; Copyright (C) 2013, 2014, 2015, 2016, 2017, 2018, 2019 Jan Wedekind <jan@wedesoft.de>
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
;;
(use-modules (srfi srfi-64)
             (oop goops)
             (aiscm core)
             (aiscm pulse))


(test-begin "aiscm pulse")

(test-eqv "convert unsigned byte to Pulse audio type"
  PA_SAMPLE_U8 (type->pulse-type <ubyte>))
(test-eqv "convert short integer to Pulse audio type"
  PA_SAMPLE_S16LE (type->pulse-type <sint>))
(test-eqv "convert integer to Pulse audio type"
  PA_SAMPLE_S32LE (type->pulse-type <int>))
(test-eqv "convert floating-point to Pulse audio type"
  PA_SAMPLE_FLOAT32LE (type->pulse-type <float>))
(test-error "throw error if type not supported by Pulse audio"
  'misc-error (type->pulse-type <usint>))
(test-eq "convert Pulse audio short integer to integer type"
  <sint> (pulse-type->type PA_SAMPLE_S16LE))

(test-end "aiscm pulse")