Fix elementary_functions tests test_run('elementary_functions', 'erfc') 71/12171/1
Adeline CARNIS [Mon, 29 Jul 2013 09:36:30 +0000 (11:36 +0200)]
Change-Id: Iafa5b723bd6a28921d7e641c90995e8d6162233c

scilab/modules/elementary_functions/tests/unit_tests/erfc.dia.ref
scilab/modules/elementary_functions/tests/unit_tests/erfc.tst

index 52cdbec..435801b 100644 (file)
@@ -4121,13 +4121,16 @@ y3ref=[1.01128341555584961691590952355
 2.];
 y3=erfc(x3);
 e3=norm((y3ref-y3)./abs(y3ref),1);
-if or([e1 e2 e3]>1d-13) then bugmes();quit;end
-if (abs(erfc(0)-1)>1d-15) then bugmes();quit;end
-if (abs(erfc(%inf))>1d-15) then bugmes();quit;end
-x4=4;
+assert_checkalmostequal([e1 e2 e3], [0 0 0], [], 1.d-12);
+assert_checkequal(erfc(0), 1);
+assert_checkequal(erfc(%inf), 0)
+ ans  =
+  T  
+x4=4; 
 w4=4.1;
 z4=3.9;
 deff("y=f(t)","y=exp(-t^2)");
-if (abs(erf(x4)-2/sqrt(%pi)*intg(0,x4,f))>10*%eps) then bugmes();quit;end
-if (abs(erf(w4)-2/sqrt(%pi)*intg(0,w4,f))>10*%eps) then bugmes();quit;end
-if (abs(erf(z4)-2/sqrt(%pi)*intg(0,z4,f))>10*%eps) then bugmes();quit;end
+assert_checkfalse(abs(erf(x4)-2/sqrt(%pi)*intg(0,x4,f))>10*%eps);
+assert_checkfalse(abs(erf(w4)-2/sqrt(%pi)*intg(0,w4,f))>10*%eps);
+assert_checkfalse(abs(erf(z4)-2/sqrt(%pi)*intg(0,z4,f))>10*%eps);
index 8d8f64b..f0df5f4 100644 (file)
@@ -4132,20 +4132,15 @@ y3ref=[1.01128341555584961691590952355
 y3=erfc(x3);
 e3=norm((y3ref-y3)./abs(y3ref),1);
 
-if or([e1 e2 e3]>1d-13) then pause,end
+assert_checkalmostequal([e1 e2 e3], [0 0 0], [], 1.d-12);
+assert_checkequal(erfc(0), 1);
+assert_checkequal(erfc(%inf), 0)
 
-if (abs(erfc(0)-1)>1d-15) then pause,end
-
-if (abs(erfc(%inf))>1d-15) then pause,end
 
 x4=4; 
 w4=4.1;
 z4=3.9;
 deff("y=f(t)","y=exp(-t^2)");
-if (abs(erf(x4)-2/sqrt(%pi)*intg(0,x4,f))>10*%eps) then pause,end
-
-if (abs(erf(w4)-2/sqrt(%pi)*intg(0,w4,f))>10*%eps) then pause,end
-if (abs(erf(z4)-2/sqrt(%pi)*intg(0,z4,f))>10*%eps) then pause,end
-
-
+assert_checkfalse(abs(erf(x4)-2/sqrt(%pi)*intg(0,x4,f))>10*%eps);
+assert_checkfalse(abs(erf(w4)-2/sqrt(%pi)*intg(0,w4,f))>10*%eps);
+assert_checkfalse(abs(erf(z4)-2/sqrt(%pi)*intg(0,z4,f))>10*%eps);