Author: brentworden
Date: Fri Aug 26 06:40:32 2005
New Revision: 240244
URL: http://svn.apache.org/viewcvs?rev=240244&view=rev
Log:
added test cases to provide better test code coverage.
Modified:
jakarta/commons/proper/math/branches/MATH_1_1/project.xml
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/stat/FrequencyTest.java
Modified: jakarta/commons/proper/math/branches/MATH_1_1/project.xml
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/math/branches/MATH_1_1/project.xml?rev=240244&r1=240243&r2=240244&view=diff
==============================================================================
--- jakarta/commons/proper/math/branches/MATH_1_1/project.xml (original)
+++ jakarta/commons/proper/math/branches/MATH_1_1/project.xml Fri Aug 26
06:40:32 2005
@@ -191,10 +191,10 @@
</build>
<reports>
<report>maven-changes-plugin</report>
- <!--
- <report>maven-changelog-plugin</report>
<report>maven-checkstyle-plugin</report>
<report>maven-clover-plugin</report>
+ <!--
+ <report>maven-changelog-plugin</report>
<report>maven-developer-activity-plugin</report>
<report>maven-file-activity-plugin</report>
-->
Modified:
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java?rev=240244&r1=240243&r2=240244&view=diff
==============================================================================
---
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java
(original)
+++
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java
Fri Aug 26 06:40:32 2005
@@ -174,6 +174,37 @@
} catch (NumberFormatException ex) {
// expected
}
+ try {
+ BigMatrix m4 = new BigMatrixImpl(new String[][] {});
+ fail("Expecting IllegalArgumentException");
+ } catch (IllegalArgumentException ex) {
+ // expected
+ }
+ try {
+ BigMatrix m4 = new BigMatrixImpl(new String[][] {{},{}});
+ fail("Expecting IllegalArgumentException");
+ } catch (IllegalArgumentException ex) {
+ // expected
+ }
+ try {
+ BigMatrix m4 = new BigMatrixImpl(new String[][] {{"a",
"b"},{"c"}});
+ fail("Expecting IllegalArgumentException");
+ } catch (IllegalArgumentException ex) {
+ // expected
+ }
+
+ try {
+ BigMatrix m4 = new BigMatrixImpl(0, 1);
+ fail("Expecting IllegalArgumentException");
+ } catch (IllegalArgumentException ex) {
+ // expected
+ }
+ try {
+ BigMatrix m4 = new BigMatrixImpl(1, 0);
+ fail("Expecting IllegalArgumentException");
+ } catch (IllegalArgumentException ex) {
+ // expected
+ }
}
/** test add */
Modified:
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java?rev=240244&r1=240243&r2=240244&view=diff
==============================================================================
---
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java
(original)
+++
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java
Fri Aug 26 06:40:32 2005
@@ -668,6 +668,19 @@
} catch (NullPointerException e) {
// expected
}
+ RealMatrixImpl m2 = new RealMatrixImpl();
+ try {
+ m2.setSubMatrix(testData,0,1);
+ fail("expecting MatrixIndexException");
+ } catch (MatrixIndexException e) {
+ // expected
+ }
+ try {
+ m2.setSubMatrix(testData,1,0);
+ fail("expecting MatrixIndexException");
+ } catch (MatrixIndexException e) {
+ // expected
+ }
// ragged
try {
Modified:
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/stat/FrequencyTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/stat/FrequencyTest.java?rev=240244&r1=240243&r2=240244&view=diff
==============================================================================
---
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/stat/FrequencyTest.java
(original)
+++
jakarta/commons/proper/math/branches/MATH_1_1/src/test/org/apache/commons/math/stat/FrequencyTest.java
Fri Aug 26 06:40:32 2005
@@ -128,6 +128,7 @@
assertEquals(2L, f.getCumFreq('b'));
assertEquals(0.25, f.getPct('a'), 0.0);
assertEquals(0.5, f.getCumPct('b'), 0.0);
+ assertEquals(1.0, f.getCumPct('e'), 0.0);
}
/** test pcts */
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]