summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAllan Cornet <allan.cornet@scilab.org>2007-01-23 18:41:28 +0000
committerAllan Cornet <allan.cornet@scilab.org>2007-01-23 18:41:28 +0000
commit9bb63ace9f09740bf7714dee3b025bbf9ea56091 (patch)
tree19e51bbfd85698a1d77ca008ca624448e17f3aa8 /tests
parent63821fd2c06811736de21bbfd87217185f47a329 (diff)
downloadscilab-9bb63ace9f09740bf7714dee3b025bbf9ea56091.zip
scilab-9bb63ace9f09740bf7714dee3b025bbf9ea56091.tar.gz
Add SciBoolean & SciBooleanArray class in javasci (tests)
Diffstat (limited to 'tests')
-rw-r--r--tests/java/Boolean.dia.ref11
-rw-r--r--tests/java/Boolean.java29
-rw-r--r--tests/java/BooleanArray.dia.ref20
-rw-r--r--tests/java/BooleanArray.java49
-rw-r--r--tests/java/JavaTests.sce2
5 files changed, 110 insertions, 1 deletions
diff --git a/tests/java/Boolean.dia.ref b/tests/java/Boolean.dia.ref
new file mode 100644
index 0000000..fd38dc7
--- /dev/null
+++ b/tests/java/Boolean.dia.ref
@@ -0,0 +1,11 @@
1----------------------------------------------------
2boolean A=
3
4 T
5----------------------------------------------------
6true
7----------------------------------------------------
8boolean P=
9
10 F
11----------------------------------------------------
diff --git a/tests/java/Boolean.java b/tests/java/Boolean.java
new file mode 100644
index 0000000..2635b11
--- /dev/null
+++ b/tests/java/Boolean.java
@@ -0,0 +1,29 @@
1import javasci.* ;
2
3
4class Boolean {
5
6 public static void main(String[] args) {
7
8 boolean b;
9
10 SciBoolean a = new SciBoolean("A");
11 Scilab.Exec("A=%t;");
12 System.out.println("----------------------------------------------------");
13 a.disp();
14 System.out.println("----------------------------------------------------");
15 b=a.getData();
16
17 System.out.println(b);
18
19 System.out.println("----------------------------------------------------");
20 SciBoolean d = new SciBoolean("D",true);
21 d.Send();
22 SciBoolean p = new SciBoolean("P");
23 Scilab.Exec("P=~D;");
24 p.disp();
25 System.out.println("----------------------------------------------------");
26 Scilab.Finish();
27 }
28}
29
diff --git a/tests/java/BooleanArray.dia.ref b/tests/java/BooleanArray.dia.ref
new file mode 100644
index 0000000..2e1655a
--- /dev/null
+++ b/tests/java/BooleanArray.dia.ref
@@ -0,0 +1,20 @@
1----------------------------------------------------
2Matrix A=
3
4 T T T F
5 F T T T
6----------------------------------------------------
7A(1,1)=true A(1,2)=true A(1,3)=true A(1,4)=false
8A(2,1)=false A(2,2)=true A(2,3)=true A(2,4)=true
9----------------------------------------------------
10b(0,0)=true b(0,1)=true b(0,2)=true b(0,3)=false
11b(1,0)=false b(1,1)=true b(1,2)=true b(1,3)=true
12----------------------------------------------------
13Matrix B=
14
15 F F F T
16 T F F F
17----------------------------------------------------
18A ScilabType : 4
19B ScilabType : 4
20----------------------------------------------------
diff --git a/tests/java/BooleanArray.java b/tests/java/BooleanArray.java
new file mode 100644
index 0000000..b16d065
--- /dev/null
+++ b/tests/java/BooleanArray.java
@@ -0,0 +1,49 @@
1import javasci.* ;
2
3
4class BooleanArray {
5
6 public static void main(String[] args) {
7 int col=4;
8 int row=2;
9 int r,c;
10 boolean [] b=new boolean[row*col];
11
12 SciBooleanArray a = new SciBooleanArray("A",row,col);
13 SciBooleanArray bsci = new SciBooleanArray("B",row,col);
14
15 Scilab.Exec("A=[%t,%t,%t,%f;%f %t %t %t];");
16 System.out.println("----------------------------------------------------");
17 a.disp();
18 System.out.println("----------------------------------------------------");
19 for(r=1;r<=a.getRow();r++)
20 {
21 for(c=1;c<=a.getCol();c++)
22 {
23 System.out.print("A("+(r)+","+(c)+")="+a.GetElement(r,c)+" ");
24 }
25 System.out.println(" ");
26 }
27 System.out.println("----------------------------------------------------");
28
29 b=a.getData();
30
31 for(r=0;r<row;r++)
32 {
33 for(c=0;c<col;c++)
34 {
35 System.out.print("b("+r+","+(c)+")="+ b[c*row+r] +" ");
36 }
37 System.out.println(" ");
38 }
39 System.out.println("----------------------------------------------------");
40 Scilab.Exec("B=~A;");
41 bsci.disp();
42 System.out.println("----------------------------------------------------");
43 System.out.println("A ScilabType : "+Scilab.TypeVar("A"));
44 System.out.println("B ScilabType : "+Scilab.TypeVar("B"));
45 System.out.println("----------------------------------------------------");
46 Scilab.Finish();
47 }
48}
49
diff --git a/tests/java/JavaTests.sce b/tests/java/JavaTests.sce
index 97c9569..33421e4 100644
--- a/tests/java/JavaTests.sce
+++ b/tests/java/JavaTests.sce
@@ -2,7 +2,7 @@
2//--------------------------------------------------------------- 2//---------------------------------------------------------------
3// Tests Interface Scilab Java 3// Tests Interface Scilab Java
4//--------------------------------------------------------------- 4//---------------------------------------------------------------
5tests = ['clf.java';'disp.java';'Exec.java';'Real1.java';'Real2.java';'Real3.java';'String1.java';'Strings1.java';'Strings2.java']; 5tests = ['clf.java';'disp.java';'Exec.java';'Real1.java';'Real2.java';'Real3.java';'String1.java';'Strings1.java';'Strings2.java';'Boolean.java';'BooleanArray.java'];
6//--------------------------------------------------------------- 6//---------------------------------------------------------------
7// Compilation du fichier Java 7// Compilation du fichier Java
8function ret=BuildJava(filename) 8function ret=BuildJava(filename)