Index: trunk/SophyaProg/Tests/pizthr.cc
===================================================================
--- trunk/SophyaProg/Tests/pizthr.cc	(revision 2499)
+++ trunk/SophyaProg/Tests/pizthr.cc	(revision 2513)
@@ -199,11 +199,11 @@
     //      syn_cntrl = 0;
     //    }
-    amon.lock(); //  <ZThread> 
     while (XtAppPending(*appctx) != 0) {
+      amon.lock(); //  <ZThread> 
       XtAppNextEvent(*appctx, &evt);
       XtDispatchEvent(&evt);
+      amon.unlock(); // <ZThread>
     }
-    amon.unlock(); // <ZThread>
-    usleep(1000);
+    //    usleep(1000);
   }
 }
Index: trunk/SophyaProg/Tests/tcmd.cc
===================================================================
--- trunk/SophyaProg/Tests/tcmd.cc	(revision 2499)
+++ trunk/SophyaProg/Tests/tcmd.cc	(revision 2513)
@@ -7,4 +7,6 @@
 #include "sophyainit.h"
 #include "timing.h"
+#include "cexpre.h"
+#include "rpneval.h"
 #include "commander.h"
 
@@ -48,4 +50,6 @@
 
 int  InputLoop(Commander & cmd);
+int tst_cexpreval();  // Test de CExpressionEvaluator 
+int tst_rpneval();    // Test de RPNEvaluator 
 
 /* --Main-- */
@@ -53,11 +57,23 @@
 {
 
+  if (narg < 2) {
+    cout << " Usage: tcmd commander/cexptst/rpntst \n " 
+	 << "  - commander: Commader class test \n"
+	 << "  - cexptst: CExpressionEvaluator class test \n"
+	 << "  - rpntst: RPNExpressionEvaluator class test \n" << endl;
+    return 0;
+  }
+  string opt = arg[1];
   SophyaInit();
   InitTim();
-
+  int rc = 0;
   try {
-    Commander cmd;
-    TCmdExecutor cmdex(cmd);
-    InputLoop(cmd);
+    if (opt == "commander") {
+      Commander cmd;
+      TCmdExecutor cmdex(cmd);
+      InputLoop(cmd);
+    }
+    else if (opt == "cexptst") rc = tst_cexpreval();
+    else rc = tst_rpneval();
   } 
  
@@ -71,5 +87,5 @@
 
   PrtTim(" End of tcmd ");
-  return(0);
+  return(rc);
 }
 
@@ -77,4 +93,7 @@
 int  InputLoop(Commander & cmd)
 {
+  cout << " ====================================================== " << endl;
+  cout << " ==============   Test of Commander class  ============ " << endl;
+  cout << " ====================================================== " << endl;
   cout << " tcmd/InputLoop() : Type in your commands, \n" 
        << "     end with a blanck line OR <Cntl>D " << endl;
@@ -102,3 +121,227 @@
 }
 
-
+/* -- Fonction Test de CExpressionEvaluator -- */
+int tst_cexpreval()
+{
+  double res;
+  int nok=0;
+  int nerr=0;
+  int nerrparse=0;
+  int num = 0;
+  cout << " ====================================================== " << endl;
+  cout << " ============   Test of CExpressionEvaluator ========== " << endl;
+  cout << " ====================================================== " << endl;
+  try {
+    try {
+      num++;
+      CExpressionEvaluator cex("4*3+8");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << " =? 4*3+8 = " << ( res=4*3+8 ) << endl;
+      if (fabs(cex.Value()-res) > 1.e-9) {
+	cout << " ERREUR CALCUL " << cex << endl;
+	nerr++;
+      } 
+      else nok++;
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+    try {
+      num++;
+      CExpressionEvaluator cex("cos(0)+2");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << " =? cos(0)+2 = " << ( res=cos(0.)+2 ) << endl;
+      if (fabs(cex.Value()-res) > 1.e-9) {
+	cout << " ERREUR CALCUL " << cex << endl;
+	nerr++;
+      }
+      else nok++;
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+
+    try {
+      num++;
+      CExpressionEvaluator cex("4+3*8");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << " =? 4+3*8 = " << ( res=4+3*8 ) << endl;
+      if (fabs(cex.Value()-res) > 1.e-9) {
+	cout << " ERREUR CALCUL " << cex << endl;
+	nerr++;
+      }
+      else nok++;
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+
+    try {
+      num++;
+      CExpressionEvaluator cex("4+3*6*2");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << " =? 4+3*6*2 = " << ( res=4+3*6*2 ) << endl;
+      if (fabs(cex.Value()-res) > 1.e-9) {
+	cout << " ERREUR CALCUL " << cex << endl;
+	nerr++;
+      }
+      else nok++;
+    }
+
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+    try {
+      num++;
+      CExpressionEvaluator cex("(12+3*6*cos(0))");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << " =? (12+3*6*cos(0))  = " 
+	   << ( res=(12+3*6*cos(0.)) ) << endl;
+      if (fabs(cex.Value()-res) > 1.e-9) {
+	cout << " ERREUR CALCUL " << cex << endl;
+	nerr++;
+      }
+      else nok++;
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+    try {
+      num++;    
+      CExpressionEvaluator cex("(12+3*6*cos(0))-(5*pow(2,2))");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << " =? (12+3*6*cos(0))-(5*pow(2,2))  = " 
+	   << ( res=(12+3*6*cos(0.))-(5*pow(2.,2.)) ) << endl;
+      if (fabs(cex.Value()-res) > 1.e-9) {
+	cout << " ERREUR CALCUL " << cex << endl;
+	nerr++;
+      }
+      else nok++;
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+    try {
+      num++;    
+      CExpressionEvaluator cex("sin(Pi/6)+E");
+      cout << "CExpr=sin(Pi/6)+E " << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << " =? sin(M_PI/6)+M_E  = " 
+	   << ( res=sin(M_PI/6)+M_E ) << endl;
+      if (fabs(cex.Value()-res) > 1.e-9) {
+	cout << " ERREUR CALCUL " << cex << endl;
+	nerr++;
+      }
+      else nok++;
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+    // Expression avec erreur de syntaxe 
+   try {
+      num++;    
+      CExpressionEvaluator cex("6**8");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << endl;
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+   try {
+      num++;    
+      CExpressionEvaluator cex("6*(8+4");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << endl;
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+
+   try {
+      num++;    
+      CExpressionEvaluator cex("6*sin(4,)+12");
+      cout << "CExpr=" << cex; 
+      cout << " -> cex.Value() = " << cex.Value() << endl; 
+    }
+    catch (CExprException& err) {
+      nerrparse++;
+      cout << "Exp[" << num << "]  Exception: " << err.Msg() << endl; 
+    }
+    cout << "  [" << num << "] CExprBase::NbCreate() = " << CExprBase::NbCreate() 
+	 << "CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+
+  }
+  catch (CExprException& err) {
+    cout << " Exception: " << err.Msg() << endl; 
+  }
+
+  cout << "-------- CExprBase::NbCreate() = " << CExprBase::NbCreate() << " CExprBase::NbDelete()=" <<  CExprBase::NbDelete() << endl;
+  cout << "--- NExpr= " << num << " NOk= " <<  nok << " NErr=" << nerr << " NErrParse=" << nerrparse << endl;
+  return 0;
+}
+
+/* -- Fonction Test de CExpressionEvaluator -- */
+int tst_rpneval()
+{
+  int num = 0;
+  cout << " ====================================================== " << endl;
+  cout << " ============ Test of RPNExpressionEvaluator ========== " << endl;
+  cout << " ====================================================== " << endl;
+  try {
+    { 
+      num++;
+      RPNExpressionEvaluator rpn("4 2 print + 3 * ");
+      cout << "4 2 + 3 * -> rpn.Value() = " << rpn.Value() << endl;
+    }
+    {
+      num++;
+      RPNExpressionEvaluator rpn("1 2 3 4 5 sum");
+      cout << "1 2 3 4 5 sum -> rpn.Value() = " << rpn.Value() << endl;
+    }
+    {
+      num++;
+      RPNExpressionEvaluator rpn("4 3 pow");
+      cout << "4 3 pow -> rpn.Value() = " << rpn.Value() << endl;
+    }
+  }
+  catch (RPNExprException& err) {
+    cout << "RPNExp[" << num << "]  Exception: " << err.Msg() << endl; 
+  }
+
+  return 0;
+}
