mathlib-commitlog Mailing List for JMathLib - Octave, Matlab clone in java (Page 11)
Status: Beta
Brought to you by:
st_mueller
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(4) |
Aug
(150) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(233) |
Feb
(86) |
Mar
(32) |
Apr
(26) |
May
(73) |
Jun
(45) |
Jul
(23) |
Aug
(23) |
Sep
(5) |
Oct
(80) |
Nov
(11) |
Dec
(11) |
| 2008 |
Jan
|
Feb
|
Mar
(13) |
Apr
(3) |
May
(7) |
Jun
(30) |
Jul
(12) |
Aug
(12) |
Sep
|
Oct
|
Nov
(78) |
Dec
(78) |
| 2009 |
Jan
(214) |
Feb
(79) |
Mar
(20) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <st_...@us...> - 2009-01-09 19:20:23
|
Revision: 660
http://mathlib.svn.sourceforge.net/mathlib/?rev=660&view=rev
Author: st_mueller
Date: 2009-01-09 19:20:18 +0000 (Fri, 09 Jan 2009)
Log Message:
-----------
display current directory for typing "cd"
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/io/cd.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/io/cd.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/io/cd.java 2009-01-08 20:07:36 UTC (rev 659)
+++ JMathLib/trunk/src/jmathlib/toolbox/io/cd.java 2009-01-09 19:20:18 UTC (rev 660)
@@ -18,17 +18,20 @@
String path=".";
// at least one operand
- if (getNArgIn(operands) != 1)
- throwMathLibException("cd: number of arguments != 1");
+ if (getNArgIn(operands) > 1)
+ throwMathLibException("cd: number of arguments > 1");
- // check if a directory is specified
- if ((operands[0] instanceof CharToken))
- {
- path = ((CharToken)operands[0]).toString();
- }
- else
- throwMathLibException("cd: argument must be a string");
-
+ if (getNArgIn(operands) == 1)
+ {
+ // check if a directory is specified
+ if ((operands[0] instanceof CharToken))
+ {
+ path = ((CharToken)operands[0]).toString();
+ }
+ else
+ throwMathLibException("cd: argument must be a string");
+ }
+
try
{
File dir = new File(getWorkingDirectory(), path);
@@ -41,8 +44,8 @@
if (getNoOfLeftHandArguments()==1)
return new CharToken(dir.getCanonicalPath());
- else if (operands[0] == null || operands[0].toString().equals(""))
- getInterpreter().displayText(getWorkingDirectory().getCanonicalPath());
+ else
+ getInterpreter().displayText(dir.getCanonicalPath());
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 20:07:43
|
Revision: 659
http://mathlib.svn.sourceforge.net/mathlib/?rev=659&view=rev
Author: st_mueller
Date: 2009-01-08 20:07:36 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
documentation for auto-testing
Added Paths:
-----------
JMathLib/trunk/doc/src/testing.xml
Added: JMathLib/trunk/doc/src/testing.xml
===================================================================
--- JMathLib/trunk/doc/src/testing.xml (rev 0)
+++ JMathLib/trunk/doc/src/testing.xml 2009-01-08 20:07:36 UTC (rev 659)
@@ -0,0 +1,20 @@
+<!-- :xml.root=doc.xml: -->
+<chapter id="testing">
+ <title>Testing JMathLib</title >
+ <sect1 id="testing_intro">
+ <title >Testing Introduction</title >
+ <simpara >
+ JMathLib also has a testing engine which is used to support quality issues.
+ A central goal of JMathLib is to test all functions automatically with
+ a regression test framework. Currently we use
+ <ulink url="http://www.junit.org">JUnit</ulink> to improve code quality.
+ </simpara >
+ <simpara >
+ There is also a mechanism to attach testing code to the standard user functions
+ so that code and test-code can be kept in the same file. These tests are
+ extracted from the general source, individual test case are going to be
+ generated automatically.
+ </simpara >
+ </sect1>
+</chapter >
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 20:07:17
|
Revision: 658
http://mathlib.svn.sourceforge.net/mathlib/?rev=658&view=rev
Author: st_mueller
Date: 2009-01-08 20:07:10 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
documentation for auto-testing
Modified Paths:
--------------
JMathLib/trunk/doc/src/doc.xml
Modified: JMathLib/trunk/doc/src/doc.xml
===================================================================
--- JMathLib/trunk/doc/src/doc.xml 2009-01-08 20:06:24 UTC (rev 657)
+++ JMathLib/trunk/doc/src/doc.xml 2009-01-08 20:07:10 UTC (rev 658)
@@ -12,6 +12,7 @@
<!ENTITY datatypes SYSTEM "datatypes.xml">
<!ENTITY graphics SYSTEM "graphics/graphics.xml">
<!ENTITY extendingandembedding SYSTEM "extendingandembedding.xml">
+ <!ENTITY testing SYSTEM "testing.xml">
<!ENTITY glossary SYSTEM "glossary.xml">
]>
<book>
@@ -94,6 +95,8 @@
&extendingandembedding;
+&testing;
+
<part id="functions">
<title>Functions Reference</title >
&functions;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 20:06:34
|
Revision: 657
http://mathlib.svn.sourceforge.net/mathlib/?rev=657&view=rev
Author: st_mueller
Date: 2009-01-08 20:06:24 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
automated test case generation
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/AllTests.java
Modified: JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/AllTests.java 2009-01-08 20:06:03 UTC (rev 656)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/AllTests.java 2009-01-08 20:06:24 UTC (rev 657)
@@ -55,6 +55,8 @@
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testSort.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testSubAssign.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testSubMatrix.suite());
+ suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testSum.suite());
+ suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testSumsq.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testTimes.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testTranspose.suite());
suite.addTest(jmathlibtests.toolbox.jmathlib.matrix.testUminus.suite());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 20:06:13
|
Revision: 656
http://mathlib.svn.sourceforge.net/mathlib/?rev=656&view=rev
Author: st_mueller
Date: 2009-01-08 20:06:03 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
added more tests
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testSum.java
JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testSumsq.java
Added: JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testSum.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testSum.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testSum.java 2009-01-08 20:06:03 UTC (rev 656)
@@ -0,0 +1,39 @@
+package jmathlibtests.toolbox.jmathlib.matrix;
+
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class testSum extends TestCase {
+ protected Interpreter ml;
+
+ public testSum(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run(suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(testSum.class);
+ }
+
+ public void testSum01() {
+ ml.executeExpression("a=sum([1,2,3])");
+ assertTrue(6.0 == ml.getScalarValueRe("a"));
+ }
+
+ public void testSum02() {
+ ml.executeExpression("a=sum([2,2,3])");
+ assertTrue(7.0 == ml.getScalarValueRe("a"));
+ }
+
+
+
+}
\ No newline at end of file
Added: JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testSumsq.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testSumsq.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/jmathlib/matrix/testSumsq.java 2009-01-08 20:06:03 UTC (rev 656)
@@ -0,0 +1,39 @@
+package jmathlibtests.toolbox.jmathlib.matrix;
+
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class testSumsq extends TestCase {
+ protected Interpreter ml;
+
+ public testSumsq(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run(suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(testSumsq.class);
+ }
+
+ public void testSumsq01() {
+ ml.executeExpression("a=sumsq([1,2,3])");
+ assertTrue(14.0 == ml.getScalarValueRe("a"));
+ }
+
+ public void testSumsq02() {
+ ml.executeExpression("a=sumsq([2,2,3])");
+ assertTrue(17.0 == ml.getScalarValueRe("a"));
+ }
+
+
+
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 19:44:15
|
Revision: 655
http://mathlib.svn.sourceforge.net/mathlib/?rev=655&view=rev
Author: st_mueller
Date: 2009-01-08 19:44:10 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
automated test case generation
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java
Modified: JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java 2009-01-08 19:42:09 UTC (rev 654)
+++ JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java 2009-01-08 19:44:10 UTC (rev 655)
@@ -21,7 +21,14 @@
suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_j.suite());
suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_i.suite());
suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_e.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_uint8.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_uint32.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_uint16.suite());
suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_sign.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_int8.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_int64.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_int32.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_int16.suite());
suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_bitor.suite());
return suite;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 19:42:18
|
Revision: 654
http://mathlib.svn.sourceforge.net/mathlib/?rev=654&view=rev
Author: st_mueller
Date: 2009-01-08 19:42:09 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
automated test case generation
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int16.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int32.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int64.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int8.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint16.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint32.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint8.java
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int16.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int16.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int16.java 2009-01-08 19:42:09 UTC (rev 654)
@@ -0,0 +1,34 @@
+// test_jmathlib_toolbox_general_int16
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_int16 extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_int16(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_int16.class);
+ }
+
+ public void test_jmathlib_toolbox_general_int160()
+ {
+ ml.executeExpression("a=int16(8);");
+ ml.executeExpression("b=class(a);");
+ assertEquals( "int16", ml.getString("b"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int32.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int32.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int32.java 2009-01-08 19:42:09 UTC (rev 654)
@@ -0,0 +1,34 @@
+// test_jmathlib_toolbox_general_int32
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_int32 extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_int32(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_int32.class);
+ }
+
+ public void test_jmathlib_toolbox_general_int320()
+ {
+ ml.executeExpression("a=int32(8);");
+ ml.executeExpression("b=class(a);");
+ assertEquals( "int32", ml.getString("b"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int64.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int64.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int64.java 2009-01-08 19:42:09 UTC (rev 654)
@@ -0,0 +1,34 @@
+// test_jmathlib_toolbox_general_int64
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_int64 extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_int64(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_int64.class);
+ }
+
+ public void test_jmathlib_toolbox_general_int640()
+ {
+ ml.executeExpression("a=int64(8);");
+ ml.executeExpression("b=class(a);");
+ assertEquals( "int64", ml.getString("b"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int8.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int8.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_int8.java 2009-01-08 19:42:09 UTC (rev 654)
@@ -0,0 +1,34 @@
+// test_jmathlib_toolbox_general_int8
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_int8 extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_int8(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_int8.class);
+ }
+
+ public void test_jmathlib_toolbox_general_int80()
+ {
+ ml.executeExpression("a=int8(88);");
+ ml.executeExpression("b=class(a);");
+ assertEquals( "int8", ml.getString("b"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint16.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint16.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint16.java 2009-01-08 19:42:09 UTC (rev 654)
@@ -0,0 +1,34 @@
+// test_jmathlib_toolbox_general_uint16
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_uint16 extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_uint16(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_uint16.class);
+ }
+
+ public void test_jmathlib_toolbox_general_uint160()
+ {
+ ml.executeExpression("a=uint16(88);");
+ ml.executeExpression("b=class(a);");
+ assertEquals( "uint16", ml.getString("b"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint32.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint32.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint32.java 2009-01-08 19:42:09 UTC (rev 654)
@@ -0,0 +1,34 @@
+// test_jmathlib_toolbox_general_uint32
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_uint32 extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_uint32(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_uint32.class);
+ }
+
+ public void test_jmathlib_toolbox_general_uint320()
+ {
+ ml.executeExpression("a=uint32(88);");
+ ml.executeExpression("b=class(a);");
+ assertEquals( "uint32", ml.getString("b"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint8.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint8.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_uint8.java 2009-01-08 19:42:09 UTC (rev 654)
@@ -0,0 +1,34 @@
+// test_jmathlib_toolbox_general_uint8
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_uint8 extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_uint8(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_uint8.class);
+ }
+
+ public void test_jmathlib_toolbox_general_uint80()
+ {
+ ml.executeExpression("a=uint16(88);");
+ ml.executeExpression("b=class(a);");
+ assertEquals( "uint16", ml.getString("b"));
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 19:41:01
|
Revision: 653
http://mathlib.svn.sourceforge.net/mathlib/?rev=653&view=rev
Author: st_mueller
Date: 2009-01-08 19:40:57 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
new file for uint32 variables
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/general/uint32.java
Added: JMathLib/trunk/src/jmathlib/toolbox/general/uint32.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint32.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint32.java 2009-01-08 19:40:57 UTC (rev 653)
@@ -0,0 +1,81 @@
+package jmathlib.toolbox.general;
+
+import jmathlib.core.tokens.*;
+import jmathlib.core.tokens.numbertokens.*;
+import jmathlib.core.functions.ExternalFunction;
+
+public class uint32 extends ExternalFunction
+{
+ public OperandToken evaluate(Token[] operands)
+ {
+
+ if (getNArgIn(operands) != 1 )
+ throwMathLibException("uint32: number of arguments !=1");
+
+ if (!(operands[0] instanceof DoubleNumberToken))
+ throwMathLibException("uint32: only works on numbers");
+
+ DoubleNumberToken num = (DoubleNumberToken)operands[0];
+
+ int[] size = num.getSize();
+
+ int n = num.getNumberOfElements();
+
+ UInt32NumberToken uint32 = new UInt32NumberToken(size, null, null);
+
+ double re = 0;
+ double im = 0;
+ int reI = 0;
+ int imI = 0;
+ for (int i=0; i<n; i++)
+ {
+
+ re = num.getValueRe(i);
+ im = num.getValueIm(i);
+
+ if (re>65535)
+ reI = 65535;
+ else if (re<0)
+ reI = 0;
+ else
+ reI = (int)re;
+
+ if (im>65535)
+ imI = 65535;
+ else if (im<0)
+ imI = 0;
+ else
+ imI = (int)im;
+
+ uint32.setValue(i, reI, imI);
+
+ }
+
+ return uint32;
+
+ } // end eval
+}
+
+/*
+@GROUP
+general
+@SYNTAX
+uint32(x)
+@DOC
+converts a double array into an array of uint8 (range 0 up to +255)
+@EXAMPLES
+<programlisting>
+
+</programlisting>
+@SEE
+double, int16, int8, uint8, uint16
+*/
+
+/*
+%!@testcase
+%! ml.executeExpression("a=uint32(88);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "uint32", ml.getString("b"));
+%!
+*/
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 19:40:32
|
Revision: 652
http://mathlib.svn.sourceforge.net/mathlib/?rev=652&view=rev
Author: st_mueller
Date: 2009-01-08 19:40:24 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
added more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/issingle.m
JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java
JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/issingle.m
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/issingle.m 2009-01-08 19:36:47 UTC (rev 651)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/issingle.m 2009-01-08 19:40:24 UTC (rev 652)
@@ -17,6 +17,6 @@
@NOTES
.
@SEE
-ischar, iscell, isnumeric, ismatrix, isprime
+ischar, iscell, isnumeric, ismatrix, isprime, double, int8, isint8, isuint16, isint16, isint32, isint64
*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java 2009-01-08 19:36:47 UTC (rev 651)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint16.java 2009-01-08 19:40:24 UTC (rev 652)
@@ -62,7 +62,7 @@
@SYNTAX
uint8(x)
@DOC
-converts a double array into an array of uint8 (range 0 up to +255)
+converts a double array into an array of uint16
@EXAMPLES
<programlisting>
@@ -71,3 +71,11 @@
double, int16, int8, uint16
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=uint16(88);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "uint16", ml.getString("b"));
+%!
+*/
+
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java 2009-01-08 19:36:47 UTC (rev 651)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/uint8.java 2009-01-08 19:40:24 UTC (rev 652)
@@ -68,6 +68,14 @@
</programlisting>
@SEE
-double, int16, int8, uint16
+double, int16, int8, uint16, uint32, uint64
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=uint16(88);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "uint16", ml.getString("b"));
+%!
+*/
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-08 19:36:55
|
Revision: 651
http://mathlib.svn.sourceforge.net/mathlib/?rev=651&view=rev
Author: st_mueller
Date: 2009-01-08 19:36:47 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
added more tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/int16.java
JMathLib/trunk/src/jmathlib/toolbox/general/int32.java
JMathLib/trunk/src/jmathlib/toolbox/general/int64.java
JMathLib/trunk/src/jmathlib/toolbox/general/int8.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int16.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int16.java 2009-01-07 20:16:46 UTC (rev 650)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int16.java 2009-01-08 19:36:47 UTC (rev 651)
@@ -68,6 +68,13 @@
</programlisting>
@SEE
-double, int8, uint8, uint16
+double, int8, uint8, uint16, uint32
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=int16(8);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "int16", ml.getString("b"));
+%!
+*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int32.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int32.java 2009-01-07 20:16:46 UTC (rev 650)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int32.java 2009-01-08 19:36:47 UTC (rev 651)
@@ -68,6 +68,13 @@
</programlisting>
@SEE
-double, int8, uint8, uint16
+double, int8, uint8, uint16, int16, int32, int64
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=int32(8);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "int32", ml.getString("b"));
+%!
+*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int64.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int64.java 2009-01-07 20:16:46 UTC (rev 650)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int64.java 2009-01-08 19:36:47 UTC (rev 651)
@@ -71,3 +71,10 @@
double, int8, uint8, uint16
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=int64(8);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "int64", ml.getString("b"));
+%!
+*/
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/int8.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/int8.java 2009-01-07 20:16:46 UTC (rev 650)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/int8.java 2009-01-08 19:36:47 UTC (rev 651)
@@ -68,6 +68,13 @@
</programlisting>
@SEE
-double, int16, uint8, uint16
+double, int16, uint8, uint16, uint32
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=int8(88);");
+%! ml.executeExpression("b=class(a);");
+%! assertEquals( "int8", ml.getString("b"));
+%!
+*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-07 20:16:49
|
Revision: 650
http://mathlib.svn.sourceforge.net/mathlib/?rev=650&view=rev
Author: st_mueller
Date: 2009-01-07 20:16:46 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
automated test case generation
Removed Paths:
-------------
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor1.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor2.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign1.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign2.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign3.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign4.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign5.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign6.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor1.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor1.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor1.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,32 +0,0 @@
-// test_src_jmathlib_toolbox_general_bitor1
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_bitor1 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_bitor1(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_bitor1.class);
- }
- public void test_test_src_jmathlib_toolbox_general_bitor1001()
- {
- ml.executeExpression("a=abs(1);");
- assertTrue(1 == ml.getScalarValueRe("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor2.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor2.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor2.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,32 +0,0 @@
-// test_src_jmathlib_toolbox_general_bitor2
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_bitor2 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_bitor2(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_bitor2.class);
- }
- public void test_test_src_jmathlib_toolbox_general_bitor2001()
- {
- ml.executeExpression("a=abs(-3);");
- assertTrue(3 == ml.getScalarValueRe("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign1.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign1.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign1.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign1
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign1 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign1(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign1.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign1001()
- {
- ml.executeExpression("a=sign(11);");
- assertTrue(1 == ml.getScalarValueRe("a"));
- assertTrue(0 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign2.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign2.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign2.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign2
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign2 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign2(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign2.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign2001()
- {
- ml.executeExpression("a=sign(-12);");
- assertTrue(-1 == ml.getScalarValueRe("a"));
- assertTrue(0 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign3.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign3.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign3.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,34 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign3
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign3 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign3(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign3.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign3001()
- {
- ml.executeExpression("a=sign(0);");
- assertTrue(0 == ml.getScalarValueRe("a"));
- assertTrue(0 == ml.getScalarValueIm("a"));
-
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign4.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign4.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign4.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign4
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign4 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign4(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign4.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign4001()
- {
- ml.executeExpression("a=sign(8i);");
- assertTrue(0 == ml.getScalarValueRe("a"));
- assertTrue(1 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign5.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign5.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign5.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign5
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign5 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign5(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign5.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign5001()
- {
- ml.executeExpression("a=sign(-5i);");
- assertTrue(0 == ml.getScalarValueRe("a"));
- assertTrue(-1 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign6.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign6.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign6.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign6
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign6 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign6(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign6.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign6001()
- {
- ml.executeExpression("a=sign(0i);");
- assertTrue(0 == ml.getScalarValueRe("a"));
- assertTrue(0 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,32 +0,0 @@
-// test_src_jmathlib_toolbox_general_bitor1
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_bitor1 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_bitor1(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_bitor1.class);
- }
- public void test_test_src_jmathlib_toolbox_general_bitor1001()
- {
- ml.executeExpression("a=abs(1);");
- assertTrue(1 == ml.getScalarValueRe("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,32 +0,0 @@
-// test_src_jmathlib_toolbox_general_bitor2
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_bitor2 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_bitor2(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_bitor2.class);
- }
- public void test_test_src_jmathlib_toolbox_general_bitor2001()
- {
- ml.executeExpression("a=abs(-3);");
- assertTrue(3 == ml.getScalarValueRe("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign1
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign1 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign1(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign1.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign1001()
- {
- ml.executeExpression("a=sign(11);");
- assertTrue(1 == ml.getScalarValueRe("a"));
- assertTrue(0 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign2
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign2 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign2(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign2.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign2001()
- {
- ml.executeExpression("a=sign(-12);");
- assertTrue(-1 == ml.getScalarValueRe("a"));
- assertTrue(0 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,34 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign3
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign3 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign3(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign3.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign3001()
- {
- ml.executeExpression("a=sign(0);");
- assertTrue(0 == ml.getScalarValueRe("a"));
- assertTrue(0 == ml.getScalarValueIm("a"));
-
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign4
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign4 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign4(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign4.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign4001()
- {
- ml.executeExpression("a=sign(8i);");
- assertTrue(0 == ml.getScalarValueRe("a"));
- assertTrue(1 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign5
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign5 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign5(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign5.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign5001()
- {
- ml.executeExpression("a=sign(-5i);");
- assertTrue(0 == ml.getScalarValueRe("a"));
- assertTrue(-1 == ml.getScalarValueIm("a"));
-
- }
-}
Deleted: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java 2009-01-07 20:16:19 UTC (rev 649)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java 2009-01-07 20:16:46 UTC (rev 650)
@@ -1,33 +0,0 @@
-// test_src_jmathlib_toolbox_general_sign6
-package jmathlibtests.scripts;
-import jmathlib.core.interpreter.Interpreter;
-import jmathlib.tools.junit.framework.*;
-import jmathlibtests.Compare;
-
-public class test_src_jmathlib_toolbox_general_sign6 extends TestCase {
- protected Interpreter ml;
-
- public test_src_jmathlib_toolbox_general_sign6(String name) {
- super(name);
- }
- public static void main (String[] args) {
- jmathlib.tools.junit.textui.TestRunner.run (suite());
- }
- protected void setUp() {
- ml = new Interpreter(true);
- }
- protected void tearDown() {
- ml = null;
- }
-
- public static Test suite() {
- return new TestSuite(test_src_jmathlib_toolbox_general_sign6.class);
- }
- public void test_test_src_jmathlib_toolbox_general_sign6001()
- {
- ml.executeExpression("a=sign(0i);");
- assertTrue(0 == ml.getScalarValueRe("a"));
- assertTrue(0 == ml.getScalarValueIm("a"));
-
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-07 20:16:28
|
Revision: 649
http://mathlib.svn.sourceforge.net/mathlib/?rev=649&view=rev
Author: st_mueller
Date: 2009-01-07 20:16:19 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
automated test case generation
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/e.int
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/i.int
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/j.int
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/minusminus.int
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/pi.int
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/plusplus.int
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/e.int
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/e.int 2009-01-07 20:15:48 UTC (rev 648)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/e.int 2009-01-07 20:16:19 UTC (rev 649)
@@ -1,3 +1,4 @@
+/*
@GROUP
general
@SYNTAX
@@ -12,3 +13,13 @@
@NOTES
@SEE
pi, eps, i, j
+*/
+
+/*
+%!@testcase
+%! ml.executeExpression("clear('all');");
+%! ml.executeExpression("a=e;");
+%! assertEquals( 2.71828182, ml.getScalarValueRe("a"), 0.0001);
+%! assertTrue( 0 == ml.getScalarValueIm("a"));
+%!
+*/
\ No newline at end of file
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/i.int
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/i.int 2009-01-07 20:15:48 UTC (rev 648)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/i.int 2009-01-07 20:16:19 UTC (rev 649)
@@ -1,3 +1,4 @@
+/*
@GROUP
general
@SYNTAX
@@ -12,3 +13,21 @@
</programlisting>
@SEE
j
+*/
+/*
+%!@testcase
+%! ml.executeExpression("a=i;");
+%! assertTrue(0 == ml.getScalarValueRe("a"));
+%! assertTrue(1 == ml.getScalarValueIm("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=2+3i;");
+%! assertTrue(2 == ml.getScalarValueRe("a"));
+%! assertTrue(3 == ml.getScalarValueIm("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=3;");
+%! assertTrue(3 == ml.getScalarValueRe("a"));
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+*/
\ No newline at end of file
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/j.int
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/j.int 2009-01-07 20:15:48 UTC (rev 648)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/j.int 2009-01-07 20:16:19 UTC (rev 649)
@@ -1,3 +1,4 @@
+/*
@GROUP
general
@SYNTAX
@@ -12,3 +13,22 @@
</programlisting>
@SEE
i
+*/
+
+/*
+%!@testcase
+%! ml.executeExpression("a=i;");
+%! assertTrue(0 == ml.getScalarValueRe("a"));
+%! assertTrue(1 == ml.getScalarValueIm("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=2+3i;");
+%! assertTrue(2 == ml.getScalarValueRe("a"));
+%! assertTrue(3 == ml.getScalarValueIm("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=3;");
+%! assertTrue(3 == ml.getScalarValueRe("a"));
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+*/
\ No newline at end of file
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/minusminus.int
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/minusminus.int 2009-01-07 20:15:48 UTC (rev 648)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/minusminus.int 2009-01-07 20:16:19 UTC (rev 649)
@@ -1,3 +1,4 @@
+/*
@GROUP
internal
@SYNTAX
@@ -14,3 +15,13 @@
</programlisting>
@SEE
plusplus, plus, minus
+*/
+
+/*
+%!@testcase
+%! ml.executeExpression("a=2;");
+%! ml.executeExpression("a--;");
+%! assertTrue(1 == ml.getScalarValueRe("a"));
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+*/
\ No newline at end of file
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/pi.int
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/pi.int 2009-01-07 20:15:48 UTC (rev 648)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/pi.int 2009-01-07 20:16:19 UTC (rev 649)
@@ -1,3 +1,4 @@
+/*
@GROUP
general
@SYNTAX
@@ -16,3 +17,13 @@
circle's area to the square of its radius.
@SEE
e, eps, i, j
+*/
+
+/*
+%!@testcase
+%! ml.executeExpression("clear('all');");
+%! ml.executeExpression("a=pi;");
+%! assertEquals( 3.1415926, ml.getScalarValueRe("a"), 0.0001);
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+*/
\ No newline at end of file
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/plusplus.int
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/plusplus.int 2009-01-07 20:15:48 UTC (rev 648)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/internal/plusplus.int 2009-01-07 20:16:19 UTC (rev 649)
@@ -1,3 +1,4 @@
+/*
@GROUP
internal
@SYNTAX
@@ -14,3 +15,13 @@
</programlisting>
@SEE
minusminus, plus, minus
+*/
+
+/*
+%!@testcase
+%! ml.executeExpression("a=2;");
+%! ml.executeExpression("a++;");
+%! assertTrue(3 == ml.getScalarValueRe("a"));
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+*/
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-07 20:15:52
|
Revision: 648
http://mathlib.svn.sourceforge.net/mathlib/?rev=648&view=rev
Author: st_mueller
Date: 2009-01-07 20:15:48 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
automated test case generation
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java
Modified: JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java
===================================================================
--- JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java 2009-01-07 20:15:29 UTC (rev 647)
+++ JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java 2009-01-07 20:15:48 UTC (rev 648)
@@ -9,9 +9,9 @@
public class testcasegenerator
{
- static String testCaseDirS = "src/jmathlibtests/scripts";
- static Stack testStack = new Stack();
-
+ String testCaseDirS = "src/jmathlibtests/scripts";
+ Stack testStack = new Stack();
+
/**
*
* @param args
@@ -21,17 +21,19 @@
String baseS = "src/jmathlib";
- processDir(baseS);
+ testcasegenerator testgen = new testcasegenerator();
- createAllTestsFile();
+ testgen.processDir(baseS);
+ testgen.createAllTestsFile();
+
}
/** Go through all directories
*
* @param baseS
*/
- public static void processDir(String baseS)
+ public void processDir(String baseS)
{
System.out.println("directory "+baseS);
File dir = new File(baseS, ".");
@@ -52,7 +54,8 @@
else
{
//System.out.println(baseS+"/"+files[i]);
-
+ if ( !files[i].endsWith(".gif") &&
+ !files[i].endsWith(".properties") )
processFile(baseS+"/"+files[i]);
}
@@ -64,16 +67,16 @@
*
* @param fileS file to process and check for testcases
*/
- public static void processFile(String fileS)
+ public void processFile(String fileS)
{
boolean testCaseFoundB = false;
int testCaseNumber = 0;
+ Stack testCasesStack = new Stack();
+
//System.out.println("anaylzing "+ fileS);
- if (fileS.endsWith("bitor.java"))
- System.out.println("*!*!*!*!*!*!*!*!*!*!*\n!*!*!*!*!*!*!**");
// open file and read m-file line by line
String bufferS="";
@@ -92,10 +95,15 @@
{
// reading in a testcase finished be reaching the
// end of file or finding a new keyword %!testcase
- createTestCase(fileS, testCaseNumber, bufferS);
testCaseFoundB = false;
+ testCasesStack.push(bufferS);
}
+
+ // end of file reached
+ if(line==null)
+ break;
+
if (line.startsWith("%!@testcase"))
{
// found a new testcase
@@ -110,11 +118,6 @@
System.out.println("******* "+line);
bufferS += " "+ line.substring(2) + "\n";
}
- else if(line==null)
- {
- // reached end of file
- break;
- }
}
@@ -123,8 +126,13 @@
catch (Exception e)
{
System.out.println(" exception "+fileS);
+ e.printStackTrace();
}
+ // in case at least one test case was found -> create test-suite
+ if (!testCasesStack.empty())
+ createTestCase(fileS, testCasesStack);
+
} // end process File
@@ -134,15 +142,16 @@
* @param caseNumber
* @param testcaseS
*/
- public static void createTestCase (String fileS, int testCaseNumber, String testcaseS)
+ public void createTestCase (String fileS, Stack testCaseStack)
{
+ fileS = fileS.replaceFirst("src/", "");
fileS = fileS.replace(".java", "");
fileS = fileS.replace(".m", "");
fileS = fileS.replace(".int", "");
fileS = fileS.replace('/', '_');
fileS = fileS.replace('.', '_');
- fileS = "test_"+fileS+testCaseNumber;
+ fileS = "test_"+fileS;
// put filename on tests-stack
testStack.push(fileS);
@@ -175,14 +184,25 @@
s+=" return new TestSuite("+ fileS +".class); \n";
s+=" } \n";
- s+=" public void test_"+ fileS +"001() \n";
+
+ int n = 0;
+ while (!testCaseStack.empty())
+ {
+
+ s+="\n";
+ s+=" public void "+ fileS + n + "() \n";
s+=" { \n";
//s+=" ml.executeExpression(\"a=testFunction001(134);\"); ";
//s+=" assertTrue(136.0 == ml.getScalarValueRe(\"a\")); ";
- s+= testcaseS;
+ s+= (String)testCaseStack.pop();
s+=" }\n";
+
+ n++;
+ }
+
+
s+="}\n";
@@ -203,7 +223,7 @@
}
- public static void createAllTestsFile()
+ public void createAllTestsFile()
{
String s="";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-07 20:15:39
|
Revision: 647
http://mathlib.svn.sourceforge.net/mathlib/?rev=647&view=rev
Author: st_mueller
Date: 2009-01-07 20:15:29 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
automated test case generation
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java
Modified: JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java 2009-01-07 20:14:13 UTC (rev 646)
+++ JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java 2009-01-07 20:15:29 UTC (rev 647)
@@ -15,14 +15,14 @@
/* include tests in this directory here */
suite.addTest(jmathlibtests.toolbox.net.testUrlread.suite());
- suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign6.suite());
- suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign5.suite());
- suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign4.suite());
- suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign3.suite());
- suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign2.suite());
- suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign1.suite());
- suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_bitor2.suite());
- suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_bitor1.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_plusplus.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_pi.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_minusminus.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_j.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_i.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_jmathlib_internal_e.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_sign.suite());
+ suite.addTest(jmathlibtests.scripts.test_jmathlib_toolbox_general_bitor.suite());
return suite;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-07 20:14:17
|
Revision: 646
http://mathlib.svn.sourceforge.net/mathlib/?rev=646&view=rev
Author: st_mueller
Date: 2009-01-07 20:14:13 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
automated test case generation
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_e.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_i.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_j.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_minusminus.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_pi.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_plusplus.java
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor.java 2009-01-07 20:14:13 UTC (rev 646)
@@ -0,0 +1,40 @@
+// test_jmathlib_toolbox_general_bitor
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_bitor extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_bitor(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_bitor.class);
+ }
+
+ public void test_jmathlib_toolbox_general_bitor0()
+ {
+ ml.executeExpression("a=abs(-3);");
+ assertTrue(3 == ml.getScalarValueRe("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_general_bitor1()
+ {
+ ml.executeExpression("a=abs(1);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign.java 2009-01-07 20:14:13 UTC (rev 646)
@@ -0,0 +1,75 @@
+// test_jmathlib_toolbox_general_sign
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_general_sign extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_general_sign(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_general_sign.class);
+ }
+
+ public void test_jmathlib_toolbox_general_sign0()
+ {
+ ml.executeExpression("a=sign(0i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_general_sign1()
+ {
+ ml.executeExpression("a=sign(-5i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(-1 == ml.getScalarValueIm("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_general_sign2()
+ {
+ ml.executeExpression("a=sign(8i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(1 == ml.getScalarValueIm("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_general_sign3()
+ {
+ ml.executeExpression("a=sign(0);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+
+ }
+
+ public void test_jmathlib_toolbox_general_sign4()
+ {
+ ml.executeExpression("a=sign(-12);");
+ assertTrue(-1 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_general_sign5()
+ {
+ ml.executeExpression("a=sign(11);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_e.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_e.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_e.java 2009-01-07 20:14:13 UTC (rev 646)
@@ -0,0 +1,35 @@
+// test_jmathlib_toolbox_jmathlib_internal_e
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_jmathlib_internal_e extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_jmathlib_internal_e(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_jmathlib_internal_e.class);
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_e0()
+ {
+ ml.executeExpression("clear('all');");
+ ml.executeExpression("a=e;");
+ assertEquals( 2.71828182, ml.getScalarValueRe("a"), 0.0001);
+ assertTrue( 0 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_i.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_i.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_i.java 2009-01-07 20:14:13 UTC (rev 646)
@@ -0,0 +1,50 @@
+// test_jmathlib_toolbox_jmathlib_internal_i
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_jmathlib_internal_i extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_jmathlib_internal_i(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_jmathlib_internal_i.class);
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_i0()
+ {
+ ml.executeExpression("a=3;");
+ assertTrue(3 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_i1()
+ {
+ ml.executeExpression("a=2+3i;");
+ assertTrue(2 == ml.getScalarValueRe("a"));
+ assertTrue(3 == ml.getScalarValueIm("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_i2()
+ {
+ ml.executeExpression("a=i;");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(1 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_j.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_j.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_j.java 2009-01-07 20:14:13 UTC (rev 646)
@@ -0,0 +1,50 @@
+// test_jmathlib_toolbox_jmathlib_internal_j
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_jmathlib_internal_j extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_jmathlib_internal_j(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_jmathlib_internal_j.class);
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_j0()
+ {
+ ml.executeExpression("a=3;");
+ assertTrue(3 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_j1()
+ {
+ ml.executeExpression("a=2+3i;");
+ assertTrue(2 == ml.getScalarValueRe("a"));
+ assertTrue(3 == ml.getScalarValueIm("a"));
+
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_j2()
+ {
+ ml.executeExpression("a=i;");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(1 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_minusminus.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_minusminus.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_minusminus.java 2009-01-07 20:14:13 UTC (rev 646)
@@ -0,0 +1,35 @@
+// test_jmathlib_toolbox_jmathlib_internal_minusminus
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_jmathlib_internal_minusminus extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_jmathlib_internal_minusminus(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_jmathlib_internal_minusminus.class);
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_minusminus0()
+ {
+ ml.executeExpression("a=2;");
+ ml.executeExpression("a--;");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_pi.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_pi.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_pi.java 2009-01-07 20:14:13 UTC (rev 646)
@@ -0,0 +1,35 @@
+// test_jmathlib_toolbox_jmathlib_internal_pi
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_jmathlib_internal_pi extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_jmathlib_internal_pi(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_jmathlib_internal_pi.class);
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_pi0()
+ {
+ ml.executeExpression("clear('all');");
+ ml.executeExpression("a=pi;");
+ assertEquals( 3.1415926, ml.getScalarValueRe("a"), 0.0001);
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_plusplus.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_plusplus.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_jmathlib_internal_plusplus.java 2009-01-07 20:14:13 UTC (rev 646)
@@ -0,0 +1,35 @@
+// test_jmathlib_toolbox_jmathlib_internal_plusplus
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_jmathlib_toolbox_jmathlib_internal_plusplus extends TestCase {
+ protected Interpreter ml;
+
+ public test_jmathlib_toolbox_jmathlib_internal_plusplus(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_jmathlib_toolbox_jmathlib_internal_plusplus.class);
+ }
+
+ public void test_jmathlib_toolbox_jmathlib_internal_plusplus0()
+ {
+ ml.executeExpression("a=2;");
+ ml.executeExpression("a++;");
+ assertTrue(3 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-07 19:38:46
|
Revision: 645
http://mathlib.svn.sourceforge.net/mathlib/?rev=645&view=rev
Author: st_mueller
Date: 2009-01-07 19:38:40 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
changed path name -> changed file names
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor1.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor2.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign1.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign2.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign3.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign4.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign5.java
JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign6.java
Copied: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor1.java (from rev 638, JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java)
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor1.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor1.java 2009-01-07 19:38:40 UTC (rev 645)
@@ -0,0 +1,32 @@
+// test_src_jmathlib_toolbox_general_bitor1
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_bitor1 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_bitor1(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_bitor1.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_bitor1001()
+ {
+ ml.executeExpression("a=abs(1);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+
+ }
+}
Copied: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor2.java (from rev 638, JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java)
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor2.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_bitor2.java 2009-01-07 19:38:40 UTC (rev 645)
@@ -0,0 +1,32 @@
+// test_src_jmathlib_toolbox_general_bitor2
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_bitor2 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_bitor2(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_bitor2.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_bitor2001()
+ {
+ ml.executeExpression("a=abs(-3);");
+ assertTrue(3 == ml.getScalarValueRe("a"));
+
+ }
+}
Copied: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign1.java (from rev 638, JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java)
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign1.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign1.java 2009-01-07 19:38:40 UTC (rev 645)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign1
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign1 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign1(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign1.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign1001()
+ {
+ ml.executeExpression("a=sign(11);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
Copied: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign2.java (from rev 638, JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java)
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign2.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign2.java 2009-01-07 19:38:40 UTC (rev 645)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign2
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign2 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign2(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign2.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign2001()
+ {
+ ml.executeExpression("a=sign(-12);");
+ assertTrue(-1 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
Copied: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign3.java (from rev 638, JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java)
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign3.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign3.java 2009-01-07 19:38:40 UTC (rev 645)
@@ -0,0 +1,34 @@
+// test_src_jmathlib_toolbox_general_sign3
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign3 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign3(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign3.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign3001()
+ {
+ ml.executeExpression("a=sign(0);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+
+ }
+}
Copied: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign4.java (from rev 638, JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java)
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign4.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign4.java 2009-01-07 19:38:40 UTC (rev 645)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign4
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign4 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign4(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign4.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign4001()
+ {
+ ml.executeExpression("a=sign(8i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(1 == ml.getScalarValueIm("a"));
+
+ }
+}
Copied: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign5.java (from rev 638, JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java)
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign5.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign5.java 2009-01-07 19:38:40 UTC (rev 645)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign5
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign5 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign5(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign5.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign5001()
+ {
+ ml.executeExpression("a=sign(-5i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(-1 == ml.getScalarValueIm("a"));
+
+ }
+}
Copied: JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign6.java (from rev 638, JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java)
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign6.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_jmathlib_toolbox_general_sign6.java 2009-01-07 19:38:40 UTC (rev 645)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign6
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign6 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign6(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign6.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign6001()
+ {
+ ml.executeExpression("a=sign(0i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-07 19:15:58
|
Revision: 644
http://mathlib.svn.sourceforge.net/mathlib/?rev=644&view=rev
Author: st_mueller
Date: 2009-01-07 19:15:44 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
correction of some typos
Modified Paths:
--------------
JMathLib/trunk/doc/src/extendingandembedding.xml
Modified: JMathLib/trunk/doc/src/extendingandembedding.xml
===================================================================
--- JMathLib/trunk/doc/src/extendingandembedding.xml 2009-01-07 19:15:11 UTC (rev 643)
+++ JMathLib/trunk/doc/src/extendingandembedding.xml 2009-01-07 19:15:44 UTC (rev 644)
@@ -34,14 +34,14 @@
The following code is an example for usage in mozilla.
<programlisting>
-<applet CODE = "jmathlib.ui.applet.JMathLibGUI.class"
- CODEBASE = "Classes" ARCHIVE = "JMathLibSmallApplet.jar"
- WIDTH = "700" HEIGHT = "400"
+<applet CODE = "jmathlib.ui.applet.JMathLibGUI.class"
+ CODEBASE = "bin" ARCHIVE = "JMathLibSmallApplet.jar"
+ WIDTH = "700" HEIGHT = "400"
ALIGN = "middle"
- VSPACE = "0" HSPACE = "0" >
-<PARAM NAME="startup" VALUE = "plot(rand(2,30))">
-<PARAM NAME="fgcolor" VALUE = "ff00ff">
-<PARAM NAME="bgcolor" VALUE = "f64033">
+ VSPACE = "0" HSPACE = "0" >
+<PARAM NAME="startup" VALUE = "plot(rand(2,30))">
+<PARAM NAME="fgcolor" VALUE = "ff00ff">
+<PARAM NAME="bgcolor" VALUE = "f64033">
</applet>
</programlisting>
</para>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-07 19:15:20
|
Revision: 643
http://mathlib.svn.sourceforge.net/mathlib/?rev=643&view=rev
Author: st_mueller
Date: 2009-01-07 19:15:11 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
small beautifying
Modified Paths:
--------------
JMathLib/trunk/JMathLib.html
Modified: JMathLib/trunk/JMathLib.html
===================================================================
--- JMathLib/trunk/JMathLib.html 2009-01-06 16:43:00 UTC (rev 642)
+++ JMathLib/trunk/JMathLib.html 2009-01-07 19:15:11 UTC (rev 643)
@@ -17,7 +17,7 @@
<!--
var _info = navigator.userAgent;
var _ns = false;
-var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
+var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 );
//-->
</SCRIPT>
@@ -35,7 +35,7 @@
<SCRIPT LANGUAGE="JavaScript">
<!--
var i;
-var _name="MathLib";
+var _name="JMathLib";
var _codebase="bin";
var _classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
var _iecodebase="http://southgatesoftware.com/javaplugin/1.3/jinstall-131-win32.cab#Version=1,3,0,0";
@@ -75,7 +75,7 @@
document.writeln('ALIGN ='+_align+' ');
document.writeln('VSPACE ='+_vspace+' HSPACE = '+_hspace);
document.writeln('>');
- //document.writeln('<PARAM NAME="startup" VALUE="disp(\'hello you\');plot(rand(2,30))">');
+ document.writeln('<PARAM NAME="startup" VALUE="disp(\'hello you\');plot(rand(2,30))">');
//document.writeln('<PARAM NAME="fgcolor" VALUE="ff00ff">');
//document.writeln('<PARAM NAME="bgcolor" VALUE="f64033">');
document.writeln('</applet>');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-06 16:43:01
|
Revision: 642
http://mathlib.svn.sourceforge.net/mathlib/?rev=642&view=rev
Author: st_mueller
Date: 2009-01-06 16:43:00 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
added automated tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/sign.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/sign.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/sign.java 2009-01-06 16:42:44 UTC (rev 641)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/sign.java 2009-01-06 16:43:00 UTC (rev 642)
@@ -64,3 +64,36 @@
abs
*/
+/*
+%!@testcase
+%! ml.executeExpression("a=sign(11);");
+%! assertTrue(1 == ml.getScalarValueRe("a"));
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=sign(-12);");
+%! assertTrue(-1 == ml.getScalarValueRe("a"));
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=sign(0);");
+%! assertTrue(0 == ml.getScalarValueRe("a"));
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+%!
+%!@testcase
+%! ml.executeExpression("a=sign(8i);");
+%! assertTrue(0 == ml.getScalarValueRe("a"));
+%! assertTrue(1 == ml.getScalarValueIm("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=sign(-5i);");
+%! assertTrue(0 == ml.getScalarValueRe("a"));
+%! assertTrue(-1 == ml.getScalarValueIm("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=sign(0i);");
+%! assertTrue(0 == ml.getScalarValueRe("a"));
+%! assertTrue(0 == ml.getScalarValueIm("a"));
+%!
+*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-06 16:42:45
|
Revision: 641
http://mathlib.svn.sourceforge.net/mathlib/?rev=641&view=rev
Author: st_mueller
Date: 2009-01-06 16:42:44 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
added automated tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/general/bitor.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/general/bitor.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/general/bitor.java 2009-01-06 16:42:24 UTC (rev 640)
+++ JMathLib/trunk/src/jmathlib/toolbox/general/bitor.java 2009-01-06 16:42:44 UTC (rev 641)
@@ -53,3 +53,14 @@
@SEE
bitand, bitshift, bitxor
*/
+
+/*
+%!@testcase
+%! ml.executeExpression("a=abs(1);");
+%! assertTrue(1 == ml.getScalarValueRe("a"));
+%!
+%!@testcase
+%! ml.executeExpression("a=abs(-3);");
+%! assertTrue(3 == ml.getScalarValueRe("a"));
+%!
+ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-06 16:42:30
|
Revision: 640
http://mathlib.svn.sourceforge.net/mathlib/?rev=640&view=rev
Author: st_mueller
Date: 2009-01-06 16:42:24 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
automated tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java
Modified: JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java
===================================================================
--- JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java 2009-01-06 16:42:09 UTC (rev 639)
+++ JMathLib/trunk/src/jmathlib/tools/testcasegenerator/testcasegenerator.java 2009-01-06 16:42:24 UTC (rev 640)
@@ -1,6 +1,7 @@
package jmathlib.tools.testcasegenerator;
import java.io.*;
+import java.util.Stack;
import jmathlib.core.interpreter.ErrorLogger;
@@ -8,19 +9,28 @@
public class testcasegenerator
{
- static String testCaseDirS = "src/jmathlibtests";
+ static String testCaseDirS = "src/jmathlibtests/scripts";
+ static Stack testStack = new Stack();
+ /**
+ *
+ * @param args
+ */
public static void main(String[] args) {
System.out.println("testcasegenerator");
String baseS = "src/jmathlib";
-
processDir(baseS);
+ createAllTestsFile();
+
}
-
+ /** Go through all directories
+ *
+ * @param baseS
+ */
public static void processDir(String baseS)
{
System.out.println("directory "+baseS);
@@ -50,11 +60,21 @@
}
+ /**
+ *
+ * @param fileS file to process and check for testcases
+ */
public static void processFile(String fileS)
{
+ boolean testCaseFoundB = false;
+ int testCaseNumber = 0;
+
//System.out.println("anaylzing "+ fileS);
+ if (fileS.endsWith("bitor.java"))
+ System.out.println("*!*!*!*!*!*!*!*!*!*!*\n!*!*!*!*!*!*!**");
+
// open file and read m-file line by line
String bufferS="";
try
@@ -62,13 +82,41 @@
File f = new File(fileS);
BufferedReader inReader = new BufferedReader(new FileReader(f));
String line;
- while ((line = inReader.readLine()) != null)
- {
- if (line.startsWith("%!"))
+ while (true)
+ {
+ // read a line from the file
+ line = inReader.readLine();
+
+ if(testCaseFoundB &&
+ (line==null || line.startsWith("%!@testcase")) )
{
+ // reading in a testcase finished be reaching the
+ // end of file or finding a new keyword %!testcase
+ createTestCase(fileS, testCaseNumber, bufferS);
+ testCaseFoundB = false;
+ }
+
+ if (line.startsWith("%!@testcase"))
+ {
+ // found a new testcase
+ System.out.println("******* new testcase found");
+ testCaseNumber++;
+ testCaseFoundB = true;
+ bufferS = "";
+ }
+ else if (line.startsWith("%!"))
+ {
+ // build up testcase
System.out.println("******* "+line);
bufferS += " "+ line.substring(2) + "\n";
}
+ else if(line==null)
+ {
+ // reached end of file
+ break;
+ }
+
+
}
inReader.close();
}
@@ -78,55 +126,64 @@
}
- if (!bufferS.equals(""))
- {
- createTestCase(fileS, bufferS);
- }
-
} // end process File
-
- public static void createTestCase (String fileS, String testcaseS)
+ /**
+ *
+ * @param fileS
+ * @param caseNumber
+ * @param testcaseS
+ */
+ public static void createTestCase (String fileS, int testCaseNumber, String testcaseS)
{
+ fileS = fileS.replace(".java", "");
+ fileS = fileS.replace(".m", "");
+ fileS = fileS.replace(".int", "");
fileS = fileS.replace('/', '_');
fileS = fileS.replace('.', '_');
- fileS = "test_"+fileS;
+ fileS = "test_"+fileS+testCaseNumber;
+ // put filename on tests-stack
+ testStack.push(fileS);
+
String s = "";
s+="// "+fileS + "\n";
- s+="package jmathlibtests; \n";
+ s+="package jmathlibtests.scripts; \n";
s+="";
- s+="import jmathlib.core.interpreter.Interpreter; \n";
- s+="import jmathlib.tools.junit.framework.*; \n";
- s+="import jmathlibtests.Compare; \n";
+ s+="import jmathlib.core.interpreter.Interpreter; \n";
+ s+="import jmathlib.tools.junit.framework.*; \n";
+ s+="import jmathlibtests.Compare; \n";
s+="\n";
- s+="public class "+ fileS +" extends TestCase { \n";
- s+=" protected Interpreter ml; \n";
+ s+="public class "+ fileS +" extends TestCase { \n";
+ s+=" protected Interpreter ml; \n";
s+=" \n";
- s+=" public "+ fileS +"(String name) { \n";
- s+=" super(name); \n";
- s+=" } \n";
- s+=" public static void main (String[] args) { \n";
+ s+=" public "+ fileS +"(String name) { \n";
+ s+=" super(name); \n";
+ s+=" } \n";
+ s+=" public static void main (String[] args) { \n";
s+=" jmathlib.tools.junit.textui.TestRunner.run (suite()); \n";
+ s+=" } \n";
+ s+=" protected void setUp() { \n";
+ s+=" ml = new Interpreter(true); \n";
+ s+=" } \n";
+ s+=" protected void tearDown() { \n";
+ s+=" ml = null; \n";
s+=" } \n";
- s+=" protected void setUp() { \n";
- s+=" ml = new Interpreter(true); \n";
- s+=" } \n";
- s+=" protected void tearDown() { \n";
- s+=" ml = null; \n";
- s+=" } \n";
s+=" \n";
- s+=" public static Test suite() { \n";
+ s+=" public static Test suite() { \n";
s+=" return new TestSuite("+ fileS +".class); \n";
s+=" } \n";
- s+=" public void test_"+ fileS +"001() \n";
+ s+=" public void test_"+ fileS +"001() \n";
s+=" { \n";
//s+=" ml.executeExpression(\"a=testFunction001(134);\"); ";
//s+=" assertTrue(136.0 == ml.getScalarValueRe(\"a\")); ";
+
s+= testcaseS;
+
s+=" }\n";
+ s+="}\n";
try
@@ -144,7 +201,60 @@
}
- }
+ }
+
+ public static void createAllTestsFile()
+ {
+ String s="";
+
+ s+=" package jmathlibtests.scripts; \n";
+ s+=" \n";
+ s+=" import jmathlib.tools.junit.framework.*; \n";
+ s+=" \n";
+ s+=" public class AllTests { \n";
+ s+=" \n";
+ s+=" public static void main (String[] args) { \n";
+ s+=" jmathlib.tools.junit.textui.TestRunner.run (suite()); \n";
+ s+=" } \n";
+ s+=" public static Test suite ( ) { \n";
+ s+=" TestSuite suite= new TestSuite(\"script functions\"); \n";
+ s+=" \n";
+ s+=" /* include subdirectories here */ \n";
+ s+=" // none \n";
+ s+=" \n";
+ s+=" /* include tests in this directory here */ \n";
+
+ s+=" suite.addTest(jmathlibtests.toolbox.net.testUrlread.suite());\n";
+
+ while (!testStack.isEmpty())
+ {
+ String fileS = (String)testStack.pop();
+
+ s+=" suite.addTest(jmathlibtests.scripts."+ fileS +".suite());\n";
+ }
+
+ s+=" \n";
+ s+=" return suite; \n";
+ s+=" } \n";
+ s+=" } \n";
+
+
+ try
+ {
+ File f = new File(testCaseDirS+"/AllTests.java");
+ BufferedWriter outWriter = new BufferedWriter( new FileWriter(f));
+
+ outWriter.write(s);
+ outWriter.close();
+ }
+ catch(Exception e)
+ {
+ System.out.println("AllTests exception - " + e.getMessage());
+ }
+
+
+ }
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-06 16:42:14
|
Revision: 639
http://mathlib.svn.sourceforge.net/mathlib/?rev=639&view=rev
Author: st_mueller
Date: 2009-01-06 16:42:09 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
automated tests
Modified Paths:
--------------
JMathLib/trunk/src/jmathlibtests/AllTests.java
Modified: JMathLib/trunk/src/jmathlibtests/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/AllTests.java 2009-01-06 16:33:47 UTC (rev 638)
+++ JMathLib/trunk/src/jmathlibtests/AllTests.java 2009-01-06 16:42:09 UTC (rev 639)
@@ -15,6 +15,7 @@
TestSuite suite= new TestSuite("JMathLib Tests");
/* include subdirectories here */
+ suite.addTest(jmathlibtests.scripts.AllTests.suite());
suite.addTest(jmathlibtests.core.AllTests.suite());
suite.addTest(jmathlibtests.toolbox.AllTests.suite());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-06 16:33:48
|
Revision: 638
http://mathlib.svn.sourceforge.net/mathlib/?rev=638&view=rev
Author: st_mueller
Date: 2009-01-06 16:33:47 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
automated tests
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/scripts/
JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java
JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java
Added: JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/AllTests.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,29 @@
+ package jmathlibtests.scripts;
+
+ import jmathlib.tools.junit.framework.*;
+
+ public class AllTests {
+
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ public static Test suite ( ) {
+ TestSuite suite= new TestSuite("script functions");
+
+ /* include subdirectories here */
+ // none
+
+ /* include tests in this directory here */
+ suite.addTest(jmathlibtests.toolbox.net.testUrlread.suite());
+ suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign6.suite());
+ suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign5.suite());
+ suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign4.suite());
+ suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign3.suite());
+ suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign2.suite());
+ suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_sign1.suite());
+ suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_bitor2.suite());
+ suite.addTest(jmathlibtests.scripts.test_src_jmathlib_toolbox_general_bitor1.suite());
+
+ return suite;
+ }
+ }
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor1.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,32 @@
+// test_src_jmathlib_toolbox_general_bitor1
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_bitor1 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_bitor1(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_bitor1.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_bitor1001()
+ {
+ ml.executeExpression("a=abs(1);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_bitor2.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,32 @@
+// test_src_jmathlib_toolbox_general_bitor2
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_bitor2 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_bitor2(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_bitor2.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_bitor2001()
+ {
+ ml.executeExpression("a=abs(-3);");
+ assertTrue(3 == ml.getScalarValueRe("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign1.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign1
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign1 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign1(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign1.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign1001()
+ {
+ ml.executeExpression("a=sign(11);");
+ assertTrue(1 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign2.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign2
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign2 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign2(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign2.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign2001()
+ {
+ ml.executeExpression("a=sign(-12);");
+ assertTrue(-1 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign3.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,34 @@
+// test_src_jmathlib_toolbox_general_sign3
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign3 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign3(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign3.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign3001()
+ {
+ ml.executeExpression("a=sign(0);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign4.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign4
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign4 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign4(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign4.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign4001()
+ {
+ ml.executeExpression("a=sign(8i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(1 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign5.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign5
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign5 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign5(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign5.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign5001()
+ {
+ ml.executeExpression("a=sign(-5i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(-1 == ml.getScalarValueIm("a"));
+
+ }
+}
Added: JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/scripts/test_src_jmathlib_toolbox_general_sign6.java 2009-01-06 16:33:47 UTC (rev 638)
@@ -0,0 +1,33 @@
+// test_src_jmathlib_toolbox_general_sign6
+package jmathlibtests.scripts;
+import jmathlib.core.interpreter.Interpreter;
+import jmathlib.tools.junit.framework.*;
+import jmathlibtests.Compare;
+
+public class test_src_jmathlib_toolbox_general_sign6 extends TestCase {
+ protected Interpreter ml;
+
+ public test_src_jmathlib_toolbox_general_sign6(String name) {
+ super(name);
+ }
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ protected void setUp() {
+ ml = new Interpreter(true);
+ }
+ protected void tearDown() {
+ ml = null;
+ }
+
+ public static Test suite() {
+ return new TestSuite(test_src_jmathlib_toolbox_general_sign6.class);
+ }
+ public void test_test_src_jmathlib_toolbox_general_sign6001()
+ {
+ ml.executeExpression("a=sign(0i);");
+ assertTrue(0 == ml.getScalarValueRe("a"));
+ assertTrue(0 == ml.getScalarValueIm("a"));
+
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-06 13:18:18
|
Revision: 637
http://mathlib.svn.sourceforge.net/mathlib/?rev=637&view=rev
Author: st_mueller
Date: 2009-01-06 13:18:17 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
more directories for tests
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/toolbox/quaternion/
JMathLib/trunk/src/jmathlibtests/toolbox/quaternion/AllTests.java
Added: JMathLib/trunk/src/jmathlibtests/toolbox/quaternion/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/quaternion/AllTests.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/quaternion/AllTests.java 2009-01-06 13:18:17 UTC (rev 637)
@@ -0,0 +1,25 @@
+package jmathlibtests.toolbox.quaternion;
+
+import jmathlib.tools.junit.framework.*;
+
+/**
+ * TestSuite that runs all the tests
+ *
+ */
+public class AllTests {
+
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ public static Test suite ( ) {
+ TestSuite suite= new TestSuite("quaternion functions");
+
+ /* include subdirectories here */
+ // none
+
+ /* include tests in this directory here */
+ // none yet
+
+ return suite;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-06 13:18:01
|
Revision: 636
http://mathlib.svn.sourceforge.net/mathlib/?rev=636&view=rev
Author: st_mueller
Date: 2009-01-06 13:18:00 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
more directories for tests
Added Paths:
-----------
JMathLib/trunk/src/jmathlibtests/toolbox/physical_constants/
JMathLib/trunk/src/jmathlibtests/toolbox/physical_constants/AllTests.java
Added: JMathLib/trunk/src/jmathlibtests/toolbox/physical_constants/AllTests.java
===================================================================
--- JMathLib/trunk/src/jmathlibtests/toolbox/physical_constants/AllTests.java (rev 0)
+++ JMathLib/trunk/src/jmathlibtests/toolbox/physical_constants/AllTests.java 2009-01-06 13:18:00 UTC (rev 636)
@@ -0,0 +1,25 @@
+package jmathlibtests.toolbox.physical_constants;
+
+import jmathlib.tools.junit.framework.*;
+
+/**
+ * TestSuite that runs all the tests
+ *
+ */
+public class AllTests {
+
+ public static void main (String[] args) {
+ jmathlib.tools.junit.textui.TestRunner.run (suite());
+ }
+ public static Test suite ( ) {
+ TestSuite suite= new TestSuite("physical_constants functions");
+
+ /* include subdirectories here */
+ // none
+
+ /* include tests in this directory here */
+ // none yet
+
+ return suite;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|