[Mathlib-commitlog] SF.net SVN: mathlib:[666] JMathLib/trunk/src/jmathlib/tools/junit/framework /JM
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-10 13:43:00
|
Revision: 666
http://mathlib.svn.sourceforge.net/mathlib/?rev=666&view=rev
Author: st_mueller
Date: 2009-01-10 13:42:47 +0000 (Sat, 10 Jan 2009)
Log Message:
-----------
prearranged test case for JMathLib
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java
Added: JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java
===================================================================
--- JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/tools/junit/framework/JMathLibTestCase.java 2009-01-10 13:42:47 UTC (rev 666)
@@ -0,0 +1,43 @@
+package jmathlib.tools.junit.framework;
+
+import jmathlib.core.interpreter.Interpreter;
+import jmathlibtests.Compare;
+
+
+public class JMathLibTestCase extends TestCase
+{
+
+ protected Interpreter ml;
+
+ public JMathLibTestCase (String name)
+ {
+ super(name);
+ }
+
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public void eval(String s)
+ {
+ ml.executeExpression(s);
+ }
+
+ public void assertEquals(String a, String b)
+ {
+ ml.executeExpression(a);
+ double[][]ans1D = ml.getArrayValueRe("ans");
+ double[][]ans1I = ml.getArrayValueIm("ans");
+
+ ml.executeExpression(b);
+ double[][]ans2D = ml.getArrayValueRe("ans");
+ double[][]ans2I = ml.getArrayValueIm("ans");
+
+ assertTrue(Compare.ArrayEquals(ans1D, ans2D));
+ assertTrue(Compare.ArrayEquals(ans1I, ans2I));
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|