From 8ffe191403b5afe0062c68a3b910e8cd0e15156a Mon Sep 17 00:00:00 2001 From: Jonathan Leto Date: Tue, 30 Sep 2008 20:22:32 -0700 Subject: [PATCH] Better error message in double * typemap and refactor FFT tests --- gsl_typemaps.i | 4 ++-- t/FFT.t | 44 +++++++++----------------------------------- 2 files changed, 11 insertions(+), 37 deletions(-) mode change 100644 => 100755 t/FFT.t diff --git a/gsl_typemaps.i b/gsl_typemaps.i index 42886b1..08eb6c2 100644 --- a/gsl_typemaps.i +++ b/gsl_typemaps.i @@ -5,9 +5,9 @@ int i; SV **tv; if (!SvROK($input)) - croak("Math::GSL : $input is not a reference!"); + croak("Math::GSL : $$1_name is not a reference!"); if (SvTYPE(SvRV($input)) != SVt_PVAV) - croak("Math::GSL : $input is not an array ref!"); + croak("Math::GSL : $$1_name is not an array ref!"); tempav = (AV*)SvRV($input); len = av_len(tempav); diff --git a/t/FFT.t b/t/FFT.t old mode 100644 new mode 100755 index 4e46898..16e584b --- a/t/FFT.t +++ b/t/FFT.t @@ -19,41 +19,15 @@ sub teardown : Test(teardown) { sub FFT_REAL_RADIX2_TRANSFORM : Tests { my $data = [ (0) x 5, (1) x 22, (0) x 5 ]; - my ($status1, $pass1 ) = gsl_fft_real_radix2_transform ($data, 1, 32); - ok_status($status1); - ok_similar( $pass1, [ - 22, - -8.44205264582682, - -4.64465605976076, - -0.643126602526688, - 1.70710678118655, - 1.8349201998544, - 0.572726230154202, - -0.676964287646119, - -1, - -0.455944707054924, - 0.255700894591988, - 0.524240654352147, - 0.292893218813453, - -0.059180002187481, - -0.183771064985432, - -0.0818926089645147, - 0, - -0.831469612302545, - -0.923879532511287, - -0.195090322016128, - 0.707106781186547, - 0.98078528040323, - 0.38268343236509, - -0.555570233019602, - -1, - -0.555570233019602, - 0.38268343236509, - 0.980785280403231, - 0.707106781186547, - -0.195090322016128, - -0.923879532511287, - -0.831469612302545 + my ($status, $pass ) = gsl_fft_real_radix2_transform ($data, 1, 32); + ok_status($status); + ok_similar( $pass, [ + 22, -8.44205264582682, -4.64465605976076, -0.643126602526688, 1.70710678118655, 1.8349201998544, + 0.572726230154202, -0.676964287646119, -1, -0.455944707054924, 0.255700894591988, 0.524240654352147, + 0.292893218813453, -0.059180002187481, -0.183771064985432, -0.0818926089645147, 0, -0.831469612302545, + -0.923879532511287, -0.195090322016128, 0.707106781186547, 0.98078528040323, 0.38268343236509, + -0.555570233019602, -1, -0.555570233019602, 0.38268343236509, 0.980785280403231, 0.707106781186547, + -0.195090322016128, -0.923879532511287, -0.831469612302545 ]); } -- 2.11.4.GIT