From 5fbff3b6690813652ffe1af2344761374278e445 Mon Sep 17 00:00:00 2001
From: simon
Date: Thu, 6 Aug 2009 07:26:23 +0000
Subject: updated INIT_FillSCI2LibCDirs added sci2c test for FFTshift

---
 .../ToolInitialization/INIT_FillSCI2LibCDirs.sci   |  2 +-
 tests/unit_tests/test_double_FFTShift.sci          | 37 ++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 tests/unit_tests/test_double_FFTShift.sci

diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index 301459b0..2de3fadb 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -2448,7 +2448,7 @@ PrintStringInfo('z2d0'+ArgSeparator+'z2',ClassFileName,'file','y');
 PrintStringInfo('z2g2'+ArgSeparator+'z2',ClassFileName,'file','y');
 
 // --- Annotation Function And Function List Function. ---
-FunctionName = 'fftshift';
+FunctionName = 'fftshift'; // AS : Done
 PrintStringInfo('      Adding Function: '+FunctionName+'.',GeneralReport,'both','y');
 INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
 INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
diff --git a/tests/unit_tests/test_double_FFTShift.sci b/tests/unit_tests/test_double_FFTShift.sci
new file mode 100644
index 00000000..205669c7
--- /dev/null
+++ b/tests/unit_tests/test_double_FFTShift.sci
@@ -0,0 +1,37 @@
+function test_double_FFTShift()
+	
+	disp(fftshift(5.3));// d0*d0
+	disp(fftshift(5.3*%i));// z0*z0
+	disp(fftshift(5.3  + 5.6*%i ));// z0*z0
+
+
+	a = fft ([10 1 15 3.5 ]);
+	disp(fftshift(a)); 
+	
+	b = [ 14 15 2 6 ; 1 2 6 4 ; 48.5 3 9.3 1 ];
+	disp(fftshift(b)); 
+	disp(fftshift(b , 1)); 
+	disp(fftshift(b , 2)); 
+	//disp(fftshift(b , "all")); 
+
+
+	c = [10 1 15 3.5 ]*%i;
+	disp(fftshift(c)); 
+	
+	d = [ 14 15 2 6 ; 1 2 6 4 ; 48.5 3 9.3 1 ]*%i;
+	disp(fftshift(b)); 
+	disp(fftshift(b , 1)); 
+	disp(fftshift(b , 2)); 
+	//disp(fftshift(b , "all")); 
+
+
+	e = c +  [10 1 15 3.5 ]*%i;
+	disp(fftshift(e)); 
+	
+	f = [ 18 15 7 6 ; 1 5 6 4 ; 43.5 1 9.3 1 ] + [ 14 15 2 6 ; 1 2 6 4 ; 48.5 3 9.3 1 ]*%i;
+	disp(fftshift(f)); 
+	disp(fftshift(f , 1)); 
+	disp(fftshift(f , 2)); 
+	//disp(fftshift(f , "all")); 
+
+endfunction 
-- 
cgit