# HG changeset patch # User Andreas Weber # Date 1420304274 -3600 # Node ID 4f615cd9a68d0e6a0c2517934570d81bf26e3ccb # Parent 651f12640c90a49f7c2cf850d8a334bb2f110cf6 Use "testif HAVE_PORTAUDIO" for new audio function tests diff -r 651f12640c90 -r 4f615cd9a68d libinterp/dldfcn/audiodevinfo.cc --- 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); diff -r 651f12640c90 -r 4f615cd9a68d scripts/audio/@audioplayer/audioplayer.m --- 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); diff -r 651f12640c90 -r 4f615cd9a68d scripts/audio/@audiorecorder/audiorecorder.m --- 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);