Index: C:/harmony/trunk_0427/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java =================================================================== --- C:/harmony/trunk_0427/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java (revision 419509) +++ C:/harmony/trunk_0427/modules/math/src/test/java/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java (working copy) @@ -129,10 +129,21 @@ assertEquals("incorrect value", res, result.toString()); assertEquals("incorrect scale", resScale, result.scale()); } + + /** + * new BigDecimal(char[] value); + */ + public void testConstrCharException1() { + try { + new BigDecimal(new char[] {}); + fail("NumberFormatException has not been thrown"); + } catch (NumberFormatException e) { + } + } /** - * new BigDecimal(char[] value, int offset, int len); - */ + * new BigDecimal(char[] value, int offset, int len); + */ public void testConstrCharIntInt() { char value[] = {'-', '1', '2', '3', '8', '0', '.', '4', '7', '3', '8', 'E', '-', '4', '2', '3'}; int offset = 3; @@ -143,10 +154,21 @@ assertEquals("incorrect value", res, result.toString()); assertEquals("incorrect scale", resScale, result.scale()); } + + /** + * new BigDecimal(char[] value, int offset, int len); + */ + public void testConstrCharIntIntException1() { + try { + new BigDecimal(new char[] {}, 0, 0); + fail("NumberFormatException has not been thrown"); + } catch (NumberFormatException e) { + } + } /** - * new BigDecimal(char[] value, int offset, int len, MathContext mc); - */ + * new BigDecimal(char[] value, int offset, int len, MathContext mc); + */ public void testConstrCharIntIntMathContext() { char value[] = {'-', '1', '2', '3', '8', '0', '.', '4', '7', '3', '8', 'E', '-', '4', '2', '3'}; int offset = 3; @@ -176,11 +198,16 @@ fail("NumberFormatException has not been thrown"); } catch (NumberFormatException e) { } + try { + new BigDecimal(new char[] {}, 0, 0, mc); + fail("NumberFormatException has not been thrown"); + } catch (NumberFormatException e) { + } } /** - * new BigDecimal(char[] value, int offset, int len, MathContext mc); - */ + * new BigDecimal(char[] value, int offset, int len, MathContext mc); + */ public void testConstrCharIntIntMathContextException2() { char value[] = {'-', '1', '2', '3', '8', '0', ',', '4', '7', '3', '8', 'E', '-', '4', '2', '3'}; int offset = 3; @@ -194,10 +221,21 @@ } catch (NumberFormatException e) { } } + + /** + * new BigDecimal(char[] value, MathContext mc); + */ + public void testConstrCharMathContextException1() { + try { + new BigDecimal(new char[] {}, MathContext.DECIMAL32); + fail("NumberFormatException has not been thrown"); + } catch (NumberFormatException e) { + } + } /** - * new BigDecimal(double value) when value is NaN - */ + * new BigDecimal(double value) when value is NaN + */ public void testConstrDoubleNaN() { double a = Double.NaN; try {