diff scripts/audio/@audiorecorder/audiorecorder.m @ 23361:7fbf0d4e48c9

skip some audio tests if no audio devices are available * audioplayer.m, audiorecorder.m: Skip tests that require audio devices if devices are not available.
author John W. Eaton <jwe@octave.org>
date Fri, 07 Apr 2017 09:05:56 -0400
parents 092078913d54
children 194eb4bd202b
line wrap: on
line diff
--- a/scripts/audio/@audiorecorder/audiorecorder.m	Thu Apr 06 15:16:19 2017 -0400
+++ b/scripts/audio/@audiorecorder/audiorecorder.m	Fri Apr 07 09:05:56 2017 -0400
@@ -69,7 +69,7 @@
 
 ## Tests of audiorecorder must not actually record anything.
 
-%!testif HAVE_PORTAUDIO
+%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0
 %! recorder = audiorecorder (44100, 16, 2);
 %! data = getaudiodata (recorder, "int16");
 %! assert (strcmp (class (data), "int16"));
@@ -80,14 +80,14 @@
 %! assert (size (data)(1), recorder.TotalSamples);
 %! assert (size (data)(2), 2);
 
-%!testif HAVE_PORTAUDIO
+%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0
 %! recorder = audiorecorder;
 %! set (recorder, {"SampleRate", "Tag", "UserData"}, {8000, "tag", [1, 2; 3, 4]});
 %! assert (recorder.SampleRate, 8000);
 %! assert (recorder.Tag, "tag");
 %! assert (recorder.UserData, [1, 2; 3, 4]);
 
-%!testif HAVE_PORTAUDIO
+%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0
 %! recorder = audiorecorder;
 %! settable = set (recorder);
 %! settable.SampleRate = 8000;
@@ -98,7 +98,7 @@
 %! assert (recorder.Tag, "tag");
 %! assert (recorder.UserData, [1, 2; 3, 4]);
 
-%!testif HAVE_PORTAUDIO
+%!testif HAVE_PORTAUDIO; audiodevinfo (1) > 0
 %! recorder = audiorecorder;
 %! recorder.SampleRate = 8000;
 %! recorder.Tag = "tag";