Xcos: adding non-reg tests for scopes 87/4587/2
Clément DAVID [Fri, 22 Jul 2011 12:20:19 +0000 (14:20 +0200)]
Add some tests against graphic properties for typical configuration of scopes. This tests does not cover all possible configuration of the scopes but just a single one.

Change-Id: I4c9ba12c45ff696d77ed618ef9bf4715360c11fb

30 files changed:
scilab/modules/xcos/tests/unit_tests/canimxy.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/canimxy.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/canimxy.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/canimxy3d.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/canimxy3d.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/canimxy3d.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cevscpe.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cevscpe.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cevscpe.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cfscope.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cfscope.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cfscope.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmatview.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmatview.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmatview.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmatview3d.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmatview3d.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmatview3d.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmscope.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmscope.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cmscope.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscope.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscope.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscope.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscopxy.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscopxy.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscopxy.xcos [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscopxy3d.dia.ref [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscopxy3d.tst [new file with mode: 0644]
scilab/modules/xcos/tests/unit_tests/cscopxy3d.xcos [new file with mode: 0644]

diff --git a/scilab/modules/xcos/tests/unit_tests/canimxy.dia.ref b/scilab/modules/xcos/tests/unit_tests/canimxy.dia.ref
new file mode 100644 (file)
index 0000000..3b6fbfd
--- /dev/null
@@ -0,0 +1,25 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/canimxy.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a=f.children(1);
+p1=a.children(1);
+assert_checkequal(f.figure_id, 20005);
+assert_checkequal(a.data_bounds, [-10 -10 ; 10 10]);
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+// all polylines has the same configuration, we just need to check the first one.
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p1.line_mode, "off");
+assert_checkequal(p1.mark_mode, "on");
+assert_checkequal(p1.mark_style, 4);
+assert_checkequal(p1.mark_size, 1);
diff --git a/scilab/modules/xcos/tests/unit_tests/canimxy.tst b/scilab/modules/xcos/tests/unit_tests/canimxy.tst
new file mode 100644 (file)
index 0000000..7a84eb8
--- /dev/null
@@ -0,0 +1,35 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/canimxy.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a=f.children(1);
+p1=a.children(1);
+
+assert_checkequal(f.figure_id, 20005);
+assert_checkequal(a.data_bounds, [-10 -10 ; 10 10]);
+
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+
+// all polylines has the same configuration, we just need to check the first one.
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p1.line_mode, "off");
+
+assert_checkequal(p1.mark_mode, "on");
+assert_checkequal(p1.mark_style, 4);
+assert_checkequal(p1.mark_size, 1);
+
diff --git a/scilab/modules/xcos/tests/unit_tests/canimxy.xcos b/scilab/modules/xcos/tests/unit_tests/canimxy.xcos
new file mode 100644 (file)
index 0000000..94a705d
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/canimxy.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/canimxy3d.dia.ref b/scilab/modules/xcos/tests/unit_tests/canimxy3d.dia.ref
new file mode 100644 (file)
index 0000000..5adede8
--- /dev/null
@@ -0,0 +1,26 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/canimxy3d.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a=f.children(1);
+p1=a.children(1);
+assert_checkequal(f.figure_id, 20002);
+assert_checkequal(a.data_bounds, [-10 -10 -10 ; 10 10 10]);
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(a.z_label.text, "z");
+// all polylines has the same configuration, we just need to check the first one.
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p1.line_mode, "off");
+assert_checkequal(p1.mark_mode, "on");
+assert_checkequal(p1.mark_style, 3);
+assert_checkequal(p1.mark_size, 5);
diff --git a/scilab/modules/xcos/tests/unit_tests/canimxy3d.tst b/scilab/modules/xcos/tests/unit_tests/canimxy3d.tst
new file mode 100644 (file)
index 0000000..d50faa9
--- /dev/null
@@ -0,0 +1,36 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/canimxy3d.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a=f.children(1);
+p1=a.children(1);
+
+assert_checkequal(f.figure_id, 20002);
+assert_checkequal(a.data_bounds, [-10 -10 -10 ; 10 10 10]);
+
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(a.z_label.text, "z");
+
+// all polylines has the same configuration, we just need to check the first one.
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p1.line_mode, "off");
+
+assert_checkequal(p1.mark_mode, "on");
+assert_checkequal(p1.mark_style, 3);
+assert_checkequal(p1.mark_size, 5);
+
diff --git a/scilab/modules/xcos/tests/unit_tests/canimxy3d.xcos b/scilab/modules/xcos/tests/unit_tests/canimxy3d.xcos
new file mode 100644 (file)
index 0000000..e0ced0c
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/canimxy3d.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/cevscpe.dia.ref b/scilab/modules/xcos/tests/unit_tests/cevscpe.dia.ref
new file mode 100644 (file)
index 0000000..07f37cd
--- /dev/null
@@ -0,0 +1,42 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cevscpe.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a=gca();
+s1=a.children(1);
+s2=a.children(2);
+s3=a.children(3);
+assert_checkequal(f.figure_id, 20007);
+assert_checkequal(a.data_bounds, [30 0 ; 60 1]);
+assert_checkequal(a.x_label.text, "t");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(size(s1.data), [26 2]);
+assert_checkequal(size(s2.data), [26 2]);
+assert_checkequal(size(s3.data), [26 2]);
+assert_checkequal(s1.visible, "on");
+assert_checkequal(s2.visible, "on");
+assert_checkequal(s3.visible, "on");
+assert_checkequal(s1.line_mode, "on");
+assert_checkequal(s2.line_mode, "on");
+assert_checkequal(s3.line_mode, "on");
+assert_checkequal(s1.line_style, 1);
+assert_checkequal(s2.line_style, 1);
+assert_checkequal(s3.line_style, 1);
+assert_checkequal(s1.thickness, 1);
+assert_checkequal(s2.thickness, 1);
+assert_checkequal(s3.thickness, 1);
+assert_checkequal(s1.arrow_size, 0);
+assert_checkequal(s2.arrow_size, 0);
+assert_checkequal(s3.arrow_size, 0);
+assert_checkequal(s1.segs_color, 5*ones(1,13));
+assert_checkequal(s2.segs_color, 3*ones(1,13));
+assert_checkequal(s3.segs_color, 1*ones(1,13));
diff --git a/scilab/modules/xcos/tests/unit_tests/cevscpe.tst b/scilab/modules/xcos/tests/unit_tests/cevscpe.tst
new file mode 100644 (file)
index 0000000..9a7ca3f
--- /dev/null
@@ -0,0 +1,57 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cevscpe.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a=gca();
+s1=a.children(1);
+s2=a.children(2);
+s3=a.children(3);
+
+assert_checkequal(f.figure_id, 20007);
+assert_checkequal(a.data_bounds, [30 0 ; 60 1]);
+assert_checkequal(a.x_label.text, "t");
+assert_checkequal(a.y_label.text, "y");
+
+assert_checkequal(size(s1.data), [26 2]);
+assert_checkequal(size(s2.data), [26 2]);
+assert_checkequal(size(s3.data), [26 2]);
+
+assert_checkequal(s1.visible, "on");
+assert_checkequal(s2.visible, "on");
+assert_checkequal(s3.visible, "on");
+
+assert_checkequal(s1.line_mode, "on");
+assert_checkequal(s2.line_mode, "on");
+assert_checkequal(s3.line_mode, "on");
+
+assert_checkequal(s1.line_style, 1);
+assert_checkequal(s2.line_style, 1);
+assert_checkequal(s3.line_style, 1);
+
+assert_checkequal(s1.thickness, 1);
+assert_checkequal(s2.thickness, 1);
+assert_checkequal(s3.thickness, 1);
+
+assert_checkequal(s1.arrow_size, 0);
+assert_checkequal(s2.arrow_size, 0);
+assert_checkequal(s3.arrow_size, 0);
+
+assert_checkequal(s1.segs_color, 5*ones(1,13));
+assert_checkequal(s2.segs_color, 3*ones(1,13));
+assert_checkequal(s3.segs_color, 1*ones(1,13));
+
+
diff --git a/scilab/modules/xcos/tests/unit_tests/cevscpe.xcos b/scilab/modules/xcos/tests/unit_tests/cevscpe.xcos
new file mode 100644 (file)
index 0000000..b170357
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/cevscpe.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/cfscope.dia.ref b/scilab/modules/xcos/tests/unit_tests/cfscope.dia.ref
new file mode 100644 (file)
index 0000000..2ff716c
--- /dev/null
@@ -0,0 +1,28 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cfscope.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a=gca();
+p1=a.children(1);
+p2=a.children(2);
+assert_checkequal(f.figure_id, 20006);
+assert_checkequal(a.data_bounds, [60 -15 ; 90 15]);
+assert_checkequal(a.x_label.text, "t");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(size(p1.data), [302 2]);
+assert_checkequal(size(p2.data), [302 2]);
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p2.polyline_style, 1);
+assert_checkequal(p1.line_mode, "on");
+assert_checkequal(p2.line_mode, "on");
+assert_checkequal(p1.mark_mode, "off");
+assert_checkequal(p2.mark_mode, "off");
diff --git a/scilab/modules/xcos/tests/unit_tests/cfscope.tst b/scilab/modules/xcos/tests/unit_tests/cfscope.tst
new file mode 100644 (file)
index 0000000..1a9bc5f
--- /dev/null
@@ -0,0 +1,40 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cfscope.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a=gca();
+p1=a.children(1);
+p2=a.children(2);
+
+assert_checkequal(f.figure_id, 20006);
+assert_checkequal(a.data_bounds, [60 -15 ; 90 15]);
+assert_checkequal(a.x_label.text, "t");
+assert_checkequal(a.y_label.text, "y");
+
+assert_checkequal(size(p1.data), [302 2]);
+assert_checkequal(size(p2.data), [302 2]);
+
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p2.polyline_style, 1);
+
+assert_checkequal(p1.line_mode, "on");
+assert_checkequal(p2.line_mode, "on");
+
+assert_checkequal(p1.mark_mode, "off");
+assert_checkequal(p2.mark_mode, "off");
+
+
diff --git a/scilab/modules/xcos/tests/unit_tests/cfscope.xcos b/scilab/modules/xcos/tests/unit_tests/cfscope.xcos
new file mode 100644 (file)
index 0000000..28d910d
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/cfscope.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/cmatview.dia.ref b/scilab/modules/xcos/tests/unit_tests/cmatview.dia.ref
new file mode 100644 (file)
index 0000000..b2eee6a
--- /dev/null
@@ -0,0 +1,26 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cmatview.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a=f.children(1);
+g=a.children(1);
+assert_checkequal(f.figure_id, 20004);
+assert_checkequal(a.data_bounds, [0 0 ; 100 100]);
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(g.children, []);
+assert_checkequal(g.visible, "on");
+assert_checkequal(size(g.data.x), [100 1]);
+assert_checkequal(size(g.data.y), [100 1]);
+assert_checkequal(size(g.data.z), [100 100]);
+assert_checkequal(g.clip_state, "off");
+assert_checkequal(g.clip_box, []);
diff --git a/scilab/modules/xcos/tests/unit_tests/cmatview.tst b/scilab/modules/xcos/tests/unit_tests/cmatview.tst
new file mode 100644 (file)
index 0000000..03fae5f
--- /dev/null
@@ -0,0 +1,37 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cmatview.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a=f.children(1);
+g=a.children(1);
+
+assert_checkequal(f.figure_id, 20004);
+assert_checkequal(a.data_bounds, [0 0 ; 100 100]);
+
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+
+assert_checkequal(g.children, []);
+assert_checkequal(g.visible, "on");
+
+assert_checkequal(size(g.data.x), [100 1]);
+assert_checkequal(size(g.data.y), [100 1]);
+assert_checkequal(size(g.data.z), [100 100]);
+
+assert_checkequal(g.clip_state, "off");
+assert_checkequal(g.clip_box, []);
+
diff --git a/scilab/modules/xcos/tests/unit_tests/cmatview.xcos b/scilab/modules/xcos/tests/unit_tests/cmatview.xcos
new file mode 100644 (file)
index 0000000..0731f6d
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/cmatview.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/cmatview3d.dia.ref b/scilab/modules/xcos/tests/unit_tests/cmatview3d.dia.ref
new file mode 100644 (file)
index 0000000..2261f8d
--- /dev/null
@@ -0,0 +1,39 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cmatview3d.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a=f.children(1);
+g=a.children(1);
+assert_checkequal(f.figure_id, 20012);
+assert_checkequal(a.data_bounds, [0 0 -100; 81 81 100]);
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(a.z_label.text, "z");
+assert_checkequal(g.children, []);
+assert_checkequal(g.visible, "on");
+assert_checkequal(g.surface_mode, "on");
+assert_checkequal(g.foreground, -1);
+assert_checkequal(g.thickness, 1);
+assert_checkequal(g.mark_mode, "off");
+assert_checkequal(g.mark_style, 0);
+assert_checkequal(g.mark_size_unit, "tabulated");
+assert_checkequal(g.mark_size, 0);
+assert_checkequal(g.mark_foreground, -1);
+assert_checkequal(g.mark_background, -2);
+assert_checkequal(size(g.data.x), [1 81]);
+assert_checkequal(size(g.data.y), [1 81]);
+assert_checkequal(size(g.data.z), [81 81]);
+assert_checkequal(g.color_mode, 2);
+assert_checkequal(g.color_flag, 1);
+assert_checkequal(g.hiddencolor, 4);
+assert_checkequal(g.clip_state, "off");
+assert_checkequal(g.clip_box, []);
diff --git a/scilab/modules/xcos/tests/unit_tests/cmatview3d.tst b/scilab/modules/xcos/tests/unit_tests/cmatview3d.tst
new file mode 100644 (file)
index 0000000..1006b87
--- /dev/null
@@ -0,0 +1,50 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cmatview3d.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a=f.children(1);
+g=a.children(1);
+
+assert_checkequal(f.figure_id, 20012);
+assert_checkequal(a.data_bounds, [0 0 -100; 81 81 100]);
+
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(a.z_label.text, "z");
+
+assert_checkequal(g.children, []);
+assert_checkequal(g.visible, "on");
+assert_checkequal(g.surface_mode, "on");
+assert_checkequal(g.foreground, -1);
+assert_checkequal(g.thickness, 1);
+assert_checkequal(g.mark_mode, "off");
+assert_checkequal(g.mark_style, 0);
+assert_checkequal(g.mark_size_unit, "tabulated");
+assert_checkequal(g.mark_size, 0);
+assert_checkequal(g.mark_foreground, -1);
+assert_checkequal(g.mark_background, -2);
+
+assert_checkequal(size(g.data.x), [1 81]);
+assert_checkequal(size(g.data.y), [1 81]);
+assert_checkequal(size(g.data.z), [81 81]);
+
+assert_checkequal(g.color_mode, 2);
+assert_checkequal(g.color_flag, 1);
+assert_checkequal(g.hiddencolor, 4);
+assert_checkequal(g.clip_state, "off");
+assert_checkequal(g.clip_box, []);
+
diff --git a/scilab/modules/xcos/tests/unit_tests/cmatview3d.xcos b/scilab/modules/xcos/tests/unit_tests/cmatview3d.xcos
new file mode 100644 (file)
index 0000000..7c78593
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/cmatview3d.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/cmscope.dia.ref b/scilab/modules/xcos/tests/unit_tests/cmscope.dia.ref
new file mode 100644 (file)
index 0000000..6cb1dd2
--- /dev/null
@@ -0,0 +1,34 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cmscope.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a1=f.children(1);
+a2=f.children(2);
+a3=f.children(3);
+p11=a1.children(1);
+p12=a1.children(2);
+p21=a2.children(1);
+p31=a3.children(1);
+assert_checkequal(f.figure_id, 20003);
+assert_checkequal(a1.data_bounds, [0 -30 ; 90 30]);
+assert_checkequal(a2.data_bounds, [0 -5 ; 60 5]);
+assert_checkequal(a3.data_bounds, [0 -1 ; 30 1]);
+assert_checkequal(a1.x_label.text, "t");
+assert_checkequal(a2.x_label.text, "t");
+assert_checkequal(a3.x_label.text, "t");
+assert_checkequal(a1.y_label.text, "y");
+assert_checkequal(a2.y_label.text, "y");
+assert_checkequal(a3.y_label.text, "y");
+assert_checkequal(size(p11.data), [299 2]);
+assert_checkequal(size(p12.data), [299 2]);
+assert_checkequal(size(p21.data), [299 2]);
+assert_checkequal(size(p31.data), [299 2]);
diff --git a/scilab/modules/xcos/tests/unit_tests/cmscope.tst b/scilab/modules/xcos/tests/unit_tests/cmscope.tst
new file mode 100644 (file)
index 0000000..77b32a4
--- /dev/null
@@ -0,0 +1,45 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cmscope.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a1=f.children(1);
+a2=f.children(2);
+a3=f.children(3);
+
+p11=a1.children(1);
+p12=a1.children(2);
+p21=a2.children(1);
+p31=a3.children(1);
+
+assert_checkequal(f.figure_id, 20003);
+
+assert_checkequal(a1.data_bounds, [0 -30 ; 90 30]);
+assert_checkequal(a2.data_bounds, [0 -5 ; 60 5]);
+assert_checkequal(a3.data_bounds, [0 -1 ; 30 1]);
+
+assert_checkequal(a1.x_label.text, "t");
+assert_checkequal(a2.x_label.text, "t");
+assert_checkequal(a3.x_label.text, "t");
+assert_checkequal(a1.y_label.text, "y");
+assert_checkequal(a2.y_label.text, "y");
+assert_checkequal(a3.y_label.text, "y");
+
+assert_checkequal(size(p11.data), [299 2]);
+assert_checkequal(size(p12.data), [299 2]);
+assert_checkequal(size(p21.data), [299 2]);
+assert_checkequal(size(p31.data), [299 2]);
+
diff --git a/scilab/modules/xcos/tests/unit_tests/cmscope.xcos b/scilab/modules/xcos/tests/unit_tests/cmscope.xcos
new file mode 100644 (file)
index 0000000..af2f3b8
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/cmscope.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/cscope.dia.ref b/scilab/modules/xcos/tests/unit_tests/cscope.dia.ref
new file mode 100644 (file)
index 0000000..7b7187a
--- /dev/null
@@ -0,0 +1,38 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cscope.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a=gca();
+p1=a.children(1);
+p2=a.children(2);
+p3=a.children(3);
+p4=a.children(4);
+assert_checkequal(f.figure_id, 20006);
+assert_checkequal(a.data_bounds, [30 -2 ; 60 3]);
+assert_checkequal(a.x_label.text, "t");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(size(p1.data), [315 2]);
+assert_checkequal(size(p2.data), [315 2]);
+assert_checkequal(size(p3.data), [315 2]);
+assert_checkequal(size(p4.data), [315 2]);
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p2.polyline_style, 1);
+assert_checkequal(p3.polyline_style, 1);
+assert_checkequal(p4.polyline_style, 1);
+assert_checkequal(p1.line_mode, "on");
+assert_checkequal(p2.line_mode, "on");
+assert_checkequal(p3.line_mode, "off");
+assert_checkequal(p4.line_mode, "on");
+assert_checkequal(p1.mark_mode, "off");
+assert_checkequal(p2.mark_mode, "off");
+assert_checkequal(p3.mark_mode, "on");
+assert_checkequal(p4.mark_mode, "off");
diff --git a/scilab/modules/xcos/tests/unit_tests/cscope.tst b/scilab/modules/xcos/tests/unit_tests/cscope.tst
new file mode 100644 (file)
index 0000000..f52e519
--- /dev/null
@@ -0,0 +1,49 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cscope.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a=gca();
+p1=a.children(1);
+p2=a.children(2);
+p3=a.children(3);
+p4=a.children(4);
+
+assert_checkequal(f.figure_id, 20006);
+assert_checkequal(a.data_bounds, [30 -2 ; 60 3]);
+assert_checkequal(a.x_label.text, "t");
+assert_checkequal(a.y_label.text, "y");
+
+assert_checkequal(size(p1.data), [315 2]);
+assert_checkequal(size(p2.data), [315 2]);
+assert_checkequal(size(p3.data), [315 2]);
+assert_checkequal(size(p4.data), [315 2]);
+
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p2.polyline_style, 1);
+assert_checkequal(p3.polyline_style, 1);
+assert_checkequal(p4.polyline_style, 1);
+
+assert_checkequal(p1.line_mode, "on");
+assert_checkequal(p2.line_mode, "on");
+assert_checkequal(p3.line_mode, "off");
+assert_checkequal(p4.line_mode, "on");
+
+assert_checkequal(p1.mark_mode, "off");
+assert_checkequal(p2.mark_mode, "off");
+assert_checkequal(p3.mark_mode, "on");
+assert_checkequal(p4.mark_mode, "off");
+
diff --git a/scilab/modules/xcos/tests/unit_tests/cscope.xcos b/scilab/modules/xcos/tests/unit_tests/cscope.xcos
new file mode 100644 (file)
index 0000000..41da1a7
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/cscope.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/cscopxy.dia.ref b/scilab/modules/xcos/tests/unit_tests/cscopxy.dia.ref
new file mode 100644 (file)
index 0000000..5163e4e
--- /dev/null
@@ -0,0 +1,25 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cscopxy.xcos"));
+xcos_simulate(scs_m, 4);
+f=gcf();
+a=f.children(1);
+p1=a.children(1);
+assert_checkequal(f.figure_id, 20007);
+assert_checkequal(a.data_bounds, [-20 -30 ; 20 30]);
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+// all polylines has the same configuration, we just need to check the first one.
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p1.line_mode, "off");
+assert_checkequal(p1.mark_mode, "on");
+assert_checkequal(p1.mark_style, 3);
+assert_checkequal(p1.mark_size, 1);
diff --git a/scilab/modules/xcos/tests/unit_tests/cscopxy.tst b/scilab/modules/xcos/tests/unit_tests/cscopxy.tst
new file mode 100644 (file)
index 0000000..c394035
--- /dev/null
@@ -0,0 +1,34 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cscopxy.xcos"));
+xcos_simulate(scs_m, 4);
+
+f=gcf();
+a=f.children(1);
+p1=a.children(1);
+
+assert_checkequal(f.figure_id, 20007);
+assert_checkequal(a.data_bounds, [-20 -30 ; 20 30]);
+
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+
+// all polylines has the same configuration, we just need to check the first one.
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p1.line_mode, "off");
+
+assert_checkequal(p1.mark_mode, "on");
+assert_checkequal(p1.mark_style, 3);
+assert_checkequal(p1.mark_size, 1);
diff --git a/scilab/modules/xcos/tests/unit_tests/cscopxy.xcos b/scilab/modules/xcos/tests/unit_tests/cscopxy.xcos
new file mode 100644 (file)
index 0000000..fe6410b
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/cscopxy.xcos differ
diff --git a/scilab/modules/xcos/tests/unit_tests/cscopxy3d.dia.ref b/scilab/modules/xcos/tests/unit_tests/cscopxy3d.dia.ref
new file mode 100644 (file)
index 0000000..87b22c8
--- /dev/null
@@ -0,0 +1,43 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+// test scope values 
+loadXcosLibs();
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cscopxy3d.xcos"));
+scicos_simulate(scs_m, list());
+f=gcf();
+a=f.children(1);
+p1=a.children(1);
+assert_checkequal(f.figure_id, 20003);
+assert_checkequal(a.data_bounds, [-1 -0.5 0; 1 2.5 10]);
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(a.z_label.text, "z");
+assert_checkequal(p1.closed, "off");
+assert_checkequal(p1.line_mode, "on");
+assert_checkequal(p1.fill_mode, "off");
+assert_checkequal(p1.line_style, 1);
+assert_checkequal(p1.thickness, 1);
+assert_checkequal(p1.arrow_size_factor, 1);
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p1.foreground, 2);
+assert_checkequal(p1.background, -2);
+assert_checkequal(p1.interp_color_vector, []);
+assert_checkequal(p1.interp_color_mode, "off");
+assert_checkequal(p1.mark_mode, "off");
+assert_checkequal(p1.mark_style, 0);
+assert_checkequal(p1.mark_size_unit, "tabulated");
+assert_checkequal(p1.mark_size, 1);
+assert_checkequal(p1.mark_foreground, -1);
+assert_checkequal(p1.mark_background, -2);
+assert_checkequal(p1.x_shift, []);
+assert_checkequal(p1.y_shift, []);
+assert_checkequal(p1.z_shift, []);
+assert_checkequal(p1.bar_width, 0);
+assert_checkequal(p1.clip_state, "clipgrf");
+assert_checkequal(p1.clip_box, []);
diff --git a/scilab/modules/xcos/tests/unit_tests/cscopxy3d.tst b/scilab/modules/xcos/tests/unit_tests/cscopxy3d.tst
new file mode 100644 (file)
index 0000000..20ff2de
--- /dev/null
@@ -0,0 +1,53 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2011 - DIGITEO - Clément DAVID
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- TEST WITH XCOS -->
+// <-- TEST WITH GRAPHIC -->
+
+// test scope values 
+
+loadXcosLibs();
+
+assert_checktrue(importXcosDiagram(SCI + "/modules/xcos/tests/unit_tests/cscopxy3d.xcos"));
+scicos_simulate(scs_m, list());
+
+f=gcf();
+a=f.children(1);
+p1=a.children(1);
+
+assert_checkequal(f.figure_id, 20003);
+assert_checkequal(a.data_bounds, [-1 -0.5 0; 1 2.5 10]);
+
+assert_checkequal(a.x_label.text, "x");
+assert_checkequal(a.y_label.text, "y");
+assert_checkequal(a.z_label.text, "z");
+
+
+assert_checkequal(p1.closed, "off");
+assert_checkequal(p1.line_mode, "on");
+assert_checkequal(p1.fill_mode, "off");
+assert_checkequal(p1.line_style, 1);
+assert_checkequal(p1.thickness, 1);
+assert_checkequal(p1.arrow_size_factor, 1);
+assert_checkequal(p1.polyline_style, 1);
+assert_checkequal(p1.foreground, 2);
+assert_checkequal(p1.background, -2);
+assert_checkequal(p1.interp_color_vector, []);
+assert_checkequal(p1.interp_color_mode, "off");
+assert_checkequal(p1.mark_mode, "off");
+assert_checkequal(p1.mark_style, 0);
+assert_checkequal(p1.mark_size_unit, "tabulated");
+assert_checkequal(p1.mark_size, 1);
+assert_checkequal(p1.mark_foreground, -1);
+assert_checkequal(p1.mark_background, -2);
+assert_checkequal(p1.x_shift, []);
+assert_checkequal(p1.y_shift, []);
+assert_checkequal(p1.z_shift, []);
+assert_checkequal(p1.bar_width, 0);
+assert_checkequal(p1.clip_state, "clipgrf");
+assert_checkequal(p1.clip_box, []);
+
diff --git a/scilab/modules/xcos/tests/unit_tests/cscopxy3d.xcos b/scilab/modules/xcos/tests/unit_tests/cscopxy3d.xcos
new file mode 100644 (file)
index 0000000..450a08d
Binary files /dev/null and b/scilab/modules/xcos/tests/unit_tests/cscopxy3d.xcos differ