mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-15 01:42:37 +00:00
ICU-2010 Improve code coverage
X-SVN-Rev: 9426
This commit is contained in:
parent
d9121cfa14
commit
745205d203
2 changed files with 28 additions and 23 deletions
|
@ -5,13 +5,14 @@
|
|||
*******************************************************************************
|
||||
*
|
||||
* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/dev/test/TestAll.java,v $
|
||||
* $Date: 2002/07/29 23:40:03 $
|
||||
* $Revision: 1.32 $
|
||||
* $Date: 2002/07/30 02:31:34 $
|
||||
* $Revision: 1.33 $
|
||||
*
|
||||
*****************************************************************************************
|
||||
*/
|
||||
package com.ibm.icu.dev.test;
|
||||
import com.ibm.icu.dev.test.TestFmwk;
|
||||
import com.ibm.icu.dev.test.bigdec.DiagBigDecimal;
|
||||
|
||||
/**
|
||||
* Top level test used to run all other tests as a batch.
|
||||
|
@ -208,4 +209,9 @@ public class TestAll extends TestFmwk {
|
|||
new com.ibm.icu.dev.test.util.ICUListResourceBundleTest(),
|
||||
});
|
||||
}
|
||||
public void TestMath() throws Exception{
|
||||
run( new TestFmwk[]{
|
||||
new DiagBigDecimal(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
package com.ibm.icu.dev.test.bigdec;
|
||||
import java.math.BigInteger;
|
||||
import com.ibm.icu.math.*;
|
||||
import com.ibm.icu.dev.test.TestFmwk;
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Decimal diagnostic tests mfc */
|
||||
|
@ -90,7 +91,7 @@ import com.ibm.icu.math.*;
|
|||
* @author Mike Cowlishaw
|
||||
*/
|
||||
|
||||
public class DiagBigDecimal{
|
||||
public class DiagBigDecimal extends TestFmwk{
|
||||
private static final java.lang.String $0="DiagBigDecimal.nrx";
|
||||
|
||||
/* properties shared */
|
||||
|
@ -184,7 +185,7 @@ public class DiagBigDecimal{
|
|||
}
|
||||
catch (DiagException $1){de=$1;
|
||||
say();
|
||||
say("**** Failed:"+" "+de.getMessage()+" "+"****");
|
||||
errln("**** Failed:"+" "+de.getMessage()+" "+"****");
|
||||
say();
|
||||
fails=fails+de.failcount;
|
||||
if ((!isContinue))
|
||||
|
@ -194,7 +195,7 @@ public class DiagBigDecimal{
|
|||
}
|
||||
catch (java.lang.RuntimeException $2){e=$2; // any other exception is total failure; just show trace and quit
|
||||
say();
|
||||
say("**** Failed: unexpected exception ****");
|
||||
errln("**** Failed: unexpected exception ****");
|
||||
e.printStackTrace();
|
||||
return -1;
|
||||
}/*num*/
|
||||
|
@ -5163,7 +5164,7 @@ public class DiagBigDecimal{
|
|||
if ((!item.ok))
|
||||
{
|
||||
bad++;
|
||||
say("Failed:"+" "+item.name);
|
||||
errln("Failed:"+" "+item.name);
|
||||
}
|
||||
}
|
||||
}/*i*/
|
||||
|
@ -5217,13 +5218,13 @@ public class DiagBigDecimal{
|
|||
/* [null or omitted gives blank line] */
|
||||
// this version doesn't heed continuation final character
|
||||
|
||||
private static void say(){
|
||||
private void say(){
|
||||
say((java.lang.String)null);return;
|
||||
}
|
||||
private static void say(java.lang.String s){
|
||||
private void say(java.lang.String s){
|
||||
if (s==null)
|
||||
s="";
|
||||
java.lang.System.out.println(s);
|
||||
s=" ";
|
||||
logln(s);
|
||||
return;}
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
|
@ -5238,19 +5239,17 @@ public class DiagBigDecimal{
|
|||
* if the first word is '<code>continue</code>' then try and run
|
||||
* all tests, otherwise stop after the first failing test group.
|
||||
*/
|
||||
|
||||
public static void main(java.lang.String args[]){
|
||||
boolean $continue;
|
||||
DiagBigDecimal dbd;
|
||||
int fails;
|
||||
$continue=false;
|
||||
if (args.length>0)
|
||||
$continue=args[0].equals("continue");
|
||||
dbd=new DiagBigDecimal(); // make the runner
|
||||
fails=dbd.diagrun($continue); // and run the tests
|
||||
if (fails==0)
|
||||
{System.exit(0);return;}
|
||||
{System.exit(1);return;}
|
||||
public static void main(String[] args) throws Exception{
|
||||
new DiagBigDecimal().run(args);
|
||||
}
|
||||
public void TestBigDecimal(){
|
||||
boolean $continue;
|
||||
int fails;
|
||||
$continue=false;
|
||||
fails=diagrun($continue); // and run the tests
|
||||
if(fails!=0) {
|
||||
errln("Diagnostic Tests for math failed. Number of errors: " +fails);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
|
Loading…
Add table
Reference in a new issue