changeset 19562:4f615cd9a68d

Use "testif HAVE_PORTAUDIO" for new audio function tests
author Andreas Weber <andy.weber.aw@gmail.com>
date Sat, 03 Jan 2015 17:57:54 +0100
parents 651f12640c90
children 65f4d9e1206c
files libinterp/dldfcn/audiodevinfo.cc scripts/audio/@audioplayer/audioplayer.m scripts/audio/@audiorecorder/audiorecorder.m
diffstat 3 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/audiodevinfo.cc	Sat Jan 03 02:17:19 2015 -0500
+++ b/libinterp/dldfcn/audiodevinfo.cc	Sat Jan 03 17:57:54 2015 +0100
@@ -396,19 +396,19 @@
 }
 
 /*
-%!test
+%!testif HAVE_PORTAUDIO
 %! devinfo = audiodevinfo;
 %! assert (rows (devinfo.input), 1);
 %! assert (rows (devinfo.output), 1);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! devinfo = audiodevinfo;
 %! nout = audiodevinfo (0);
 %! nin = audiodevinfo (1);
 %! assert (columns (devinfo.output), nout);
 %! assert (columns (devinfo.input), nin);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! devinfo = audiodevinfo;
 %! nout = audiodevinfo (0);
 %! nin = audiodevinfo (1);
@@ -419,7 +419,7 @@
 %!   assert (devinfo.input(i).Name, audiodevinfo (1, devinfo.input(i).ID))
 %! endfor
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! devinfo = audiodevinfo;
 %! nout = audiodevinfo (0);
 %! nin = audiodevinfo (1);
--- a/scripts/audio/@audioplayer/audioplayer.m	Sat Jan 03 02:17:19 2015 -0500
+++ b/scripts/audio/@audioplayer/audioplayer.m	Sat Jan 03 17:57:54 2015 +0100
@@ -101,7 +101,7 @@
 
 endfunction
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! mono = randn (1, 44100) - 0.5;
 %! stereo = randn (2, 44100) - 0.5;
 %! fs = 44100;
@@ -116,7 +116,7 @@
 %! playblocking (player1);
 %! playblocking (player2);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! audio = randn (2, 88200) - 0.5;
 %! fs = 44100;
 %! player = audioplayer (audio, fs);
@@ -131,7 +131,7 @@
 %! assert (isplaying (player));
 %! sleep (1);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! audio = randn (2, 88200) - 0.5;
 %! fs = 44100;
 %! player = audioplayer (audio, fs);
@@ -144,7 +144,7 @@
 %! assert (!isplaying (player));
 %! assert (player.CurrentSample, 0);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! audio = randn (2, 44100) - 0.5;
 %! fs = 44100;
 %! player = audioplayer (audio, fs);
@@ -153,7 +153,7 @@
 %! assert (player.Tag, "tag");
 %! assert (player.UserData, [1, 2; 3, 4]);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! audio = randn (2, 44100) - 0.5;
 %! fs = 44100;
 %! player = audioplayer (audio, fs);
@@ -166,7 +166,7 @@
 %! assert (player.Tag, "tag");
 %! assert (player.UserData, [1, 2; 3, 4]);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! audio = randn (2, 44100) - 0.5;
 %! fs = 44100;
 %! player = audioplayer (audio, fs);
@@ -181,14 +181,14 @@
 %!  status = 0;
 %!endfunction
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! player = audioplayer (@callback, 44100);
 %! play (player);
 %! sleep (2);
 %! stop (player);
 %! assert (1);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! player = audioplayer ("callback", 44100, 16);
 %! play (player);
 %! sleep (2);
--- a/scripts/audio/@audiorecorder/audiorecorder.m	Sat Jan 03 02:17:19 2015 -0500
+++ b/scripts/audio/@audiorecorder/audiorecorder.m	Sat Jan 03 17:57:54 2015 +0100
@@ -44,7 +44,7 @@
 
 endfunction
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! recorder = audiorecorder (44100, 16, 2);
 %! recordblocking (recorder, 1);
 %! data = getaudiodata (recorder, "int16");
@@ -57,7 +57,7 @@
 %! assert (size (data)(2), 2);
 %! assert (size (data)(1) != 0);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! recorder = audiorecorder (44100, 16, 2);
 %! record (recorder, 1)
 %! sleep (2);
@@ -66,7 +66,7 @@
 %! data = getaudiodata (recorder);
 %! assert (size (data)(1) < 44100 * 2);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! recorder = audiorecorder (44100, 16, 2);
 %! record (recorder, 1);
 %! sleep (2);
@@ -79,14 +79,14 @@
 %! assert (player1.TotalSamples, recorder.TotalSamples);
 %! assert (player2.TotalSamples, recorder.TotalSamples);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! 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]);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! recorder = audiorecorder;
 %! settable = set (recorder);
 %! settable.SampleRate = 8000;
@@ -97,7 +97,7 @@
 %! assert (recorder.Tag, "tag");
 %! assert (recorder.UserData, [1, 2; 3, 4]);
 
-%!test
+%!testif HAVE_PORTAUDIO
 %! recorder = audiorecorder;
 %! recorder.SampleRate = 8000;
 %! recorder.Tag = "tag";
@@ -114,7 +114,7 @@
 #%!  status = 0;
 #%!endfunction
 
-#%!test
+#%!testif HAVE_PORTAUDIO
 #%! recorder = audiorecorder (@callback_record, 44100);
 #%! unlink ("record.txt")
 #%! record (recorder);
@@ -123,7 +123,7 @@
 #%! s = stat ("record.txt");
 #%! assert (s.size > 0);
 
-#%!test
+#%!testif HAVE_PORTAUDIO
 #%! recorder = audiorecorder (@callback_record, 44100);
 #%! unlink ("record.txt")
 #%! record (recorder);