File: [local] / OpenXM / src / ox_gsl / assert1.rr (download)
Revision 1.1, Fri Mar 30 04:43:16 2018 UTC (6 years, 3 months ago) by takayama
Branch: MAIN
An error handling function myhander() is added.
|
#define myfail(s) printf("%a fails, Ans0=%a, Ans=%a\n",s,Ans0,Ans)
#define dcmp(a,b) (deval(abs(1-a/b))<1e-10?1:0)
Pid=ox_launch(0,getenv("OpenXM_HOME")+"/src/ox_gsl/ox_gsl");
// Try 1.
ox_cmo_rpc(Pid,"gsl_sf_lngamma_complex_e",10^5,2); Ans=ox_pop_cmo(Pid);
Ans0=[1.05129e+06,-2.1069,0]$
if (dcmp(Ans[0],Ans0[0])) myfail("Try1 real"); else ;
if (dcmp(Ans[1],Ans0[1])) myfail("Try1 im"); else ;
// Try 2.
ox_cmo_rpc(Pid,"restart");
// Try 3. error packet should be returned.
ox_cmo_rpc(Pid,"gsl_sf_lngamma_complex_e",10^10,2); Ans=ox_pop_cmo(Pid);
// Try 4.
ox_cmo_rpc(Pid,"gsl_sf_lngamma_complex_e",deval(10^10),2); Ans=ox_pop_cmo(Pid);
Ans0=[2.20259e+11,2.0694,0]$
if (dcmp(Ans[0],Ans0[0])) myfail("Try4 real"); else ;
if (dcmp(Ans[1],Ans0[1])) myfail("Try4 im"); else ;
end$