Index: trunk/SophyaProg/Tests/tfitsdt.cc
===================================================================
--- trunk/SophyaProg/Tests/tfitsdt.cc	(revision 2889)
+++ trunk/SophyaProg/Tests/tfitsdt.cc	(revision 2890)
@@ -8,4 +8,11 @@
 #include "datatable.h"
 #include "fitshdtable.h"
+#include "swfitsdtable.h"
+
+/* 
+   Programme de test lecture-ecriture FITS de DataTable
+    + test classe SwFitsDataTable
+      Oct 2005 - Jan 2006
+*/
 
 void test_fdtable() ; 
@@ -18,11 +25,11 @@
   }
   catch(PThrowable exc ) {
-    cerr << "tnt-main() , Catched exception: \n" << exc.Msg() << endl;
+    cerr << "tfitsdt-main() , Catched exception: \n" << exc.Msg() << endl;
   }
   catch(std::exception ex) {
-    cerr << "tnt-main() , Catched exception ! " << (string)(ex.what()) << endl;
+    cerr << "tfitsdt-main() , Catched exception ! " << (string)(ex.what()) << endl;
   }
   catch(...) {
-    cerr << "tnt-main() , Catched ... ! " << endl;
+    cerr << "tfitsdt-main() , Catched ... ! " << endl;
   }
 }
@@ -32,5 +39,7 @@
 {
   int NL = 600;
-  cout << "======= test_fdtable:  simple DataTable+FITS test ======= " << endl;
+  DataTable refdt(100); // Reference DataTable - for tests 
+
+  cout << "======= test_fdtable: Simple DataTable+FITS test ======= " << endl;
   {
     cout << "1/ Creating DataTable / Writing to FITS " << endl;
@@ -60,4 +69,6 @@
     }
     cout << dt;
+    cout << " Copying dt to refdt (refdt = dt) " << endl;
+    refdt = dt;
     cout << " Writing dt to fits file dtable.fits ... " << endl;
     FitsInOutFile fios("!dtable.fits", FitsInOutFile::Fits_Create);
@@ -67,4 +78,10 @@
     fios.SetNextExtensionName("ASC_DTable");
     fios << dt;    
+    cout << "1.b/ Creating SwFitsDataTable (file swdtable.fits) " << endl;
+    FitsInOutFile swf("!swdtable.fits", FitsInOutFile::Fits_Create);
+    SwFitsDataTable swdt(swf, 64);
+    cout << " Copying from DataTable dt ..." << endl;
+    swdt = dt;
+    cout << swdt;
   }
   {
@@ -80,5 +97,5 @@
     for(int k = 0; k<NL; k+=NL/12) 
       cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ;  
-    cout << "2.c/  Reading from ASCII table   " << endl;
+    cout << "2.b/  Reading from ASCII table   " << endl;
     DataTable dtra;
     fios >> dtra;
@@ -87,7 +104,16 @@
     for(int k = 0; k<NL; k+=NL/12) 
       cout << "Line[" << k << "] " << dtra.LineToString(k) << endl ;  
-    
+
+    cout << "2.c/  Reading SwFitsDataTable from  swdtable.fits  " << endl;   
+    SwFitsDataTable swdtr;
+    FitsInOutFile swf("swdtable.fits", FitsInOutFile::Fits_RO);   
+    swf.MoveAbsToHDU(2);  
+    swf >> swdtr;
+    cout << swdtr;
+    cout << swdtr.LineHeaderToString() << endl;
+    for(int k = 0; k<NL; k+=NL/12) 
+      cout << "Line[" << k << "] " << swdtr.LineToString(k) << endl ;  
   }
-  cout << "============ FIN  test_fdtable ======== ======= " << endl;  
+  cout << "============ FIN  test_fdtable =============== " << endl;  
 }
 
Index: trunk/SophyaProg/Tests/tswfits.cc
===================================================================
--- trunk/SophyaProg/Tests/tswfits.cc	(revision 2889)
+++ trunk/SophyaProg/Tests/tswfits.cc	(revision 2890)
@@ -7,8 +7,7 @@
 #include "histinit.h"
 #include "dvlist.h"
-// #include "datatable.h"
-// #include "swppfdtable.h"
 #include "fitsswapper.h"
 #include "fiosinit.h"
+#include "swfitsdtable.h"
 
 void test_fdtable() ; 
@@ -85,5 +84,26 @@
       segd.Print(cout, 4, "  ");
     }
-    
+
+    {
+      cout << "8/ Creation SwFitsDataTable sur myswtable.fits " << endl;
+      FitsInOutFile so("!myswtable.fits", FitsInOutFile::Fits_Create);
+      SwFitsDataTable dt(so, 16);
+      // define table columns
+      dt.AddFloatColumn("X0_f");
+      dt.AddFloatColumn("X1_f");
+      dt.AddDoubleColumn("X0X0pX1X1_d");
+      cout << "8.b/ start fill " << endl;
+      // Fill the table
+      r_8 x[5];
+      for(int i=0; i<63; i++) {
+	if (i < 5)  cout << " DBG - i= " << i << endl;
+	x[0] = (i%9)-4.;  x[1] = (i/9)-3.;  x[2] = x[0]*x[0]+x[1]*x[1];
+	dt.AddLine(x);
+      }
+      cout << "8.c/ End fill " << endl;
+      
+      // Printing table info
+      cout << dt ;
+    }
   cout << "============ FIN  test_fdtable ======== ======= " << endl;  
 }
