summaryrefslogtreecommitdiffstats
path: root/scilab/modules
diff options
context:
space:
mode:
authorVincent COUVERT <vincent.couvert@scilab.org>2010-05-20 11:28:04 +0200
committerVincent COUVERT <vincent.couvert@scilab.org>2010-05-20 11:39:41 +0200
commitde236e9cfe9f24b3601a4c95d4a8aa631c0cf837 (patch)
tree53157a83f924e9a6ea0679b6f22bbccb107658ca /scilab/modules
parentc2e0d3bc2b81438f4f5f18854ca6166877a65d82 (diff)
downloadscilab-de236e9cfe9f24b3601a4c95d4a8aa631c0cf837.zip
scilab-de236e9cfe9f24b3601a4c95d4a8aa631c0cf837.tar.gz
Bug 4362 fixed:
- change the behavior of generic_uicontrol_test (now returns an execution status instead of using pause) - all uicontrol tests files updated - all uicontrol tests references have been re-generated Change-Id: I9ff2ecfe115deab378dea39df3efc2def4e742ad
Diffstat (limited to 'scilab/modules')
-rw-r--r--scilab/modules/gui/tests/unit_tests/checkbox.dia.ref3
-rw-r--r--scilab/modules/gui/tests/unit_tests/checkbox.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/edit.dia.ref2
-rw-r--r--scilab/modules/gui/tests/unit_tests/edit.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/frame.dia.ref2
-rw-r--r--scilab/modules/gui/tests/unit_tests/frame.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/listbox.dia.ref2
-rw-r--r--scilab/modules/gui/tests/unit_tests/listbox.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/popupmenu.dia.ref2
-rw-r--r--scilab/modules/gui/tests/unit_tests/popupmenu.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/pushbutton.dia.ref2
-rw-r--r--scilab/modules/gui/tests/unit_tests/pushbutton.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/radiobutton.dia.ref2
-rw-r--r--scilab/modules/gui/tests/unit_tests/radiobutton.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/slider.dia.ref2
-rw-r--r--scilab/modules/gui/tests/unit_tests/slider.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/text.dia.ref2
-rw-r--r--scilab/modules/gui/tests/unit_tests/text.tst2
-rw-r--r--scilab/modules/gui/tests/unit_tests/uicontrol_generic_test.sci175
19 files changed, 107 insertions, 105 deletions
diff --git a/scilab/modules/gui/tests/unit_tests/checkbox.dia.ref b/scilab/modules/gui/tests/unit_tests/checkbox.dia.ref
index ea69f9b..080df8d 100644
--- a/scilab/modules/gui/tests/unit_tests/checkbox.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/checkbox.dia.ref
@@ -7,7 +7,8 @@
7// Unitary tests for Scilab Java checkboxes 7// Unitary tests for Scilab Java checkboxes
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10uicontrol_generic_test("checkbox"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11if uicontrol_generic_test("checkbox") <> 0 then bugmes();quit;end
11// Default relief value 12// Default relief value
12h = uicontrol("parent", scf(), "style", "checkbox"); 13h = uicontrol("parent", scf(), "style", "checkbox");
13if get(h, "relief") <> "flat" then bugmes();quit;end 14if get(h, "relief") <> "flat" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/checkbox.tst b/scilab/modules/gui/tests/unit_tests/checkbox.tst
index fa06057..d55b71e 100644
--- a/scilab/modules/gui/tests/unit_tests/checkbox.tst
+++ b/scilab/modules/gui/tests/unit_tests/checkbox.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("checkbox"); 13if uicontrol_generic_test("checkbox") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "checkbox"); 16h = uicontrol("parent", scf(), "style", "checkbox");
diff --git a/scilab/modules/gui/tests/unit_tests/edit.dia.ref b/scilab/modules/gui/tests/unit_tests/edit.dia.ref
index 1a9ac5e..3bd8e10 100644
--- a/scilab/modules/gui/tests/unit_tests/edit.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/edit.dia.ref
@@ -8,7 +8,7 @@
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11uicontrol_generic_test("edit"); 11if uicontrol_generic_test("edit") <> 0 then bugmes();quit;end
12// Default relief value 12// Default relief value
13h = uicontrol("parent", scf(), "style", "edit"); 13h = uicontrol("parent", scf(), "style", "edit");
14if get(h, "relief") <> "sunken" then bugmes();quit;end 14if get(h, "relief") <> "sunken" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/edit.tst b/scilab/modules/gui/tests/unit_tests/edit.tst
index 26dce1c..eb95e0a 100644
--- a/scilab/modules/gui/tests/unit_tests/edit.tst
+++ b/scilab/modules/gui/tests/unit_tests/edit.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("edit"); 13if uicontrol_generic_test("edit") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "edit"); 16h = uicontrol("parent", scf(), "style", "edit");
diff --git a/scilab/modules/gui/tests/unit_tests/frame.dia.ref b/scilab/modules/gui/tests/unit_tests/frame.dia.ref
index 261ee6a..de59d6d 100644
--- a/scilab/modules/gui/tests/unit_tests/frame.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/frame.dia.ref
@@ -8,7 +8,7 @@
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11uicontrol_generic_test("frame"); 11if uicontrol_generic_test("frame") <> 0 then bugmes();quit;end
12// Default relief value 12// Default relief value
13h = uicontrol("parent", scf(), "style", "frame"); 13h = uicontrol("parent", scf(), "style", "frame");
14if get(h, "relief") <> "ridge" then bugmes();quit;end 14if get(h, "relief") <> "ridge" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/frame.tst b/scilab/modules/gui/tests/unit_tests/frame.tst
index 0a62893..5ec795f 100644
--- a/scilab/modules/gui/tests/unit_tests/frame.tst
+++ b/scilab/modules/gui/tests/unit_tests/frame.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("frame"); 13if uicontrol_generic_test("frame") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "frame"); 16h = uicontrol("parent", scf(), "style", "frame");
diff --git a/scilab/modules/gui/tests/unit_tests/listbox.dia.ref b/scilab/modules/gui/tests/unit_tests/listbox.dia.ref
index 6fe1079..b308284 100644
--- a/scilab/modules/gui/tests/unit_tests/listbox.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/listbox.dia.ref
@@ -8,7 +8,7 @@
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11uicontrol_generic_test("listbox"); 11if uicontrol_generic_test("listbox") <> 0 then bugmes();quit;end
12// Default relief value 12// Default relief value
13h = uicontrol("parent", scf(), "style", "listbox"); 13h = uicontrol("parent", scf(), "style", "listbox");
14if get(h, "relief") <> "flat" then bugmes();quit;end 14if get(h, "relief") <> "flat" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/listbox.tst b/scilab/modules/gui/tests/unit_tests/listbox.tst
index f88c6e9..52c28d1 100644
--- a/scilab/modules/gui/tests/unit_tests/listbox.tst
+++ b/scilab/modules/gui/tests/unit_tests/listbox.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("listbox"); 13if uicontrol_generic_test("listbox") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "listbox"); 16h = uicontrol("parent", scf(), "style", "listbox");
diff --git a/scilab/modules/gui/tests/unit_tests/popupmenu.dia.ref b/scilab/modules/gui/tests/unit_tests/popupmenu.dia.ref
index a67e2df..3decef6 100644
--- a/scilab/modules/gui/tests/unit_tests/popupmenu.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/popupmenu.dia.ref
@@ -8,7 +8,7 @@
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11uicontrol_generic_test("popupmenu"); 11if uicontrol_generic_test("popupmenu") <> 0 then bugmes();quit;end
12// Default relief value 12// Default relief value
13h = uicontrol("parent", scf(), "style", "popupmenu"); 13h = uicontrol("parent", scf(), "style", "popupmenu");
14if get(h, "relief") <> "flat" then bugmes();quit;end 14if get(h, "relief") <> "flat" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/popupmenu.tst b/scilab/modules/gui/tests/unit_tests/popupmenu.tst
index 021a01b..70d972d 100644
--- a/scilab/modules/gui/tests/unit_tests/popupmenu.tst
+++ b/scilab/modules/gui/tests/unit_tests/popupmenu.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("popupmenu"); 13if uicontrol_generic_test("popupmenu") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "popupmenu"); 16h = uicontrol("parent", scf(), "style", "popupmenu");
diff --git a/scilab/modules/gui/tests/unit_tests/pushbutton.dia.ref b/scilab/modules/gui/tests/unit_tests/pushbutton.dia.ref
index 1ae3c57..7fb807e 100644
--- a/scilab/modules/gui/tests/unit_tests/pushbutton.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/pushbutton.dia.ref
@@ -8,7 +8,7 @@
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11uicontrol_generic_test("pushbutton"); 11if uicontrol_generic_test("pushbutton") <> 0 then bugmes();quit;end
12// Default relief value 12// Default relief value
13h = uicontrol("parent", scf(), "style", "pushbutton"); 13h = uicontrol("parent", scf(), "style", "pushbutton");
14if get(h, "relief") <> "raised" then bugmes();quit;end 14if get(h, "relief") <> "raised" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/pushbutton.tst b/scilab/modules/gui/tests/unit_tests/pushbutton.tst
index 4d410e5..fb53220 100644
--- a/scilab/modules/gui/tests/unit_tests/pushbutton.tst
+++ b/scilab/modules/gui/tests/unit_tests/pushbutton.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("pushbutton"); 13if uicontrol_generic_test("pushbutton") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "pushbutton"); 16h = uicontrol("parent", scf(), "style", "pushbutton");
diff --git a/scilab/modules/gui/tests/unit_tests/radiobutton.dia.ref b/scilab/modules/gui/tests/unit_tests/radiobutton.dia.ref
index 3f4c80c..eac8c39 100644
--- a/scilab/modules/gui/tests/unit_tests/radiobutton.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/radiobutton.dia.ref
@@ -8,7 +8,7 @@
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11uicontrol_generic_test("radiobutton"); 11if uicontrol_generic_test("radiobutton") <> 0 then bugmes();quit;end
12// Default relief value 12// Default relief value
13h = uicontrol("parent", scf(), "style", "radiobutton"); 13h = uicontrol("parent", scf(), "style", "radiobutton");
14if get(h, "relief") <> "flat" then bugmes();quit;end 14if get(h, "relief") <> "flat" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/radiobutton.tst b/scilab/modules/gui/tests/unit_tests/radiobutton.tst
index 2080ffb..c653dce 100644
--- a/scilab/modules/gui/tests/unit_tests/radiobutton.tst
+++ b/scilab/modules/gui/tests/unit_tests/radiobutton.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("radiobutton"); 13if uicontrol_generic_test("radiobutton") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "radiobutton"); 16h = uicontrol("parent", scf(), "style", "radiobutton");
diff --git a/scilab/modules/gui/tests/unit_tests/slider.dia.ref b/scilab/modules/gui/tests/unit_tests/slider.dia.ref
index e2af8f9..9ba78d6 100644
--- a/scilab/modules/gui/tests/unit_tests/slider.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/slider.dia.ref
@@ -8,7 +8,7 @@
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11uicontrol_generic_test("slider"); 11if uicontrol_generic_test("slider") <> 0 then bugmes();quit;end
12// Default relief value 12// Default relief value
13h = uicontrol("parent", scf(), "style", "slider"); 13h = uicontrol("parent", scf(), "style", "slider");
14if get(h, "relief") <> "flat" then bugmes();quit;end 14if get(h, "relief") <> "flat" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/slider.tst b/scilab/modules/gui/tests/unit_tests/slider.tst
index 66d2b0b..4f2fdd0 100644
--- a/scilab/modules/gui/tests/unit_tests/slider.tst
+++ b/scilab/modules/gui/tests/unit_tests/slider.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("slider"); 13if uicontrol_generic_test("slider") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "slider"); 16h = uicontrol("parent", scf(), "style", "slider");
diff --git a/scilab/modules/gui/tests/unit_tests/text.dia.ref b/scilab/modules/gui/tests/unit_tests/text.dia.ref
index 3f4f498..e3297f0 100644
--- a/scilab/modules/gui/tests/unit_tests/text.dia.ref
+++ b/scilab/modules/gui/tests/unit_tests/text.dia.ref
@@ -8,7 +8,7 @@
8// Exec tests common to all uicontrols 8// Exec tests common to all uicontrols
9clear uicontrol_generic_test 9clear uicontrol_generic_test
10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 10exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
11uicontrol_generic_test("text"); 11if uicontrol_generic_test("text") <> 0 then bugmes();quit;end
12// Default relief value 12// Default relief value
13h = uicontrol("parent", scf(), "style", "text"); 13h = uicontrol("parent", scf(), "style", "text");
14if get(h, "relief") <> "flat" then bugmes();quit;end 14if get(h, "relief") <> "flat" then bugmes();quit;end
diff --git a/scilab/modules/gui/tests/unit_tests/text.tst b/scilab/modules/gui/tests/unit_tests/text.tst
index 7c1902b..de6a9f6 100644
--- a/scilab/modules/gui/tests/unit_tests/text.tst
+++ b/scilab/modules/gui/tests/unit_tests/text.tst
@@ -10,7 +10,7 @@
10// Exec tests common to all uicontrols 10// Exec tests common to all uicontrols
11clear uicontrol_generic_test 11clear uicontrol_generic_test
12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci"); 12exec("SCI/modules/gui/tests/unit_tests/uicontrol_generic_test.sci");
13uicontrol_generic_test("text"); 13if uicontrol_generic_test("text") <> 0 then pause; end
14 14
15// Default relief value 15// Default relief value
16h = uicontrol("parent", scf(), "style", "text"); 16h = uicontrol("parent", scf(), "style", "text");
diff --git a/scilab/modules/gui/tests/unit_tests/uicontrol_generic_test.sci b/scilab/modules/gui/tests/unit_tests/uicontrol_generic_test.sci
index 096b360..03db956 100644
--- a/scilab/modules/gui/tests/unit_tests/uicontrol_generic_test.sci
+++ b/scilab/modules/gui/tests/unit_tests/uicontrol_generic_test.sci
@@ -1,14 +1,15 @@
1// =============================================================================
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2008 - INRIA - Vincent COUVERT 3// Copyright (C) 2008 - INRIA - Vincent COUVERT
3// Generic unitary tests for Scilab Java uicontrols 4// Copyright (C) 2010 - DIGITEO - Vincent COUVERT
4// 5//
5// This file must be used under the terms of the CeCILL. 6// This file is distributed under the same license as the Scilab package.
6// This source file is licensed as described in the file COPYING, which 7// =============================================================================
7// you should have received as part of this distribution. The terms 8function ierr = uicontrol_generic_test(uicontrol_style)
8// are also available at 9
9// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 10// Default error status
10 11ierr = 0;
11function uicontrol_generic_test(uicontrol_style) 12
12// Default uicontrol of style 'uicontrol_style' 13// Default uicontrol of style 'uicontrol_style'
13h = uicontrol("style", uicontrol_style); 14h = uicontrol("style", uicontrol_style);
14set(h, "string", "Default "+uicontrol_style); 15set(h, "string", "Default "+uicontrol_style);
@@ -80,159 +81,159 @@ h = uicontrol("parent", f, "style", uicontrol_style);
80// Vector of 'integer' values 81// Vector of 'integer' values
81set(h, "backgroundcolor", [1 0 0]); 82set(h, "backgroundcolor", [1 0 0]);
82if ~and(get(h, "backgroundcolor") == [1 0 0]) then 83if ~and(get(h, "backgroundcolor") == [1 0 0]) then
83 pause 84 ierr = 1;
84end 85end
85// Vector of 'real' values 86// Vector of 'real' values
86set(h, "backgroundcolor", [0.3 0.4 0.5]); 87set(h, "backgroundcolor", [0.3 0.4 0.5]);
87if ~and(get(h, "backgroundcolor") == [0.3 0.4 0.5]) then 88if ~and(get(h, "backgroundcolor") == [0.3 0.4 0.5]) then
88 pause 89 ierr = 1;
89end 90end
90// String of 'integer' values 91// String of 'integer' values
91set(h, "backgroundcolor", "1|1|0"); 92set(h, "backgroundcolor", "1|1|0");
92if ~and(get(h, "backgroundcolor") == [1 1 0]) then 93if ~and(get(h, "backgroundcolor") == [1 1 0]) then
93 pause 94 ierr = 1;
94end 95end
95// String of 'real' values 96// String of 'real' values
96set(h, "backgroundcolor", "0.2|0.3|0.4"); 97set(h, "backgroundcolor", "0.2|0.3|0.4");
97if ~and(get(h, "backgroundcolor") == [0.2 0.3 0.4]) then 98if ~and(get(h, "backgroundcolor") == [0.2 0.3 0.4]) then
98 pause 99 ierr = 1;
99end 100end
100// TODO Test with wrong format values: "aze", "", [], ... 101// TODO Test with wrong format values: "aze", "", [], ...
101 102
102// --- Callback tests --- 103// --- Callback tests ---
103// Default values 104// Default values
104if get(h, "callback") <> "" then 105if get(h, "callback") <> "" then
105 pause 106 ierr = 1;
106end 107end
107if get(h, "callback_type") <> -1 then 108if get(h, "callback_type") <> -1 then
108 pause 109 ierr = 1;
109end 110end
110// Set a callback and do not precise type 111// Set a callback and do not precise type
111set(h, "callback", "disp(0);"); 112set(h, "callback", "disp(0);");
112if get(h, "callback") <> "disp(0);" then 113if get(h, "callback") <> "disp(0);" then
113 pause 114 ierr = 1;
114end 115end
115if get(h, "callback_type") <> 0 then 116if get(h, "callback_type") <> 0 then
116 pause 117 ierr = 1;
117end 118end
118set(h, "callback", "disp(1);"); 119set(h, "callback", "disp(1);");
119set(h, "callback_type", 0); 120set(h, "callback_type", 0);
120if get(h, "callback") <> "disp(1);" then 121if get(h, "callback") <> "disp(1);" then
121 pause 122 ierr = 1;
122end 123end
123if get(h, "callback_type") <> 0 then 124if get(h, "callback_type") <> 0 then
124 pause 125 ierr = 1;
125end 126end
126// Remove callback --> callbackType must switch automatically to -1 127// Remove callback --> callbackType must switch automatically to -1
127set(h, "callback", ""); 128set(h, "callback", "");
128if get(h, "callback") <> "" then 129if get(h, "callback") <> "" then
129 pause 130 ierr = 1;
130end 131end
131if get(h, "callback_type") <> -1 then 132if get(h, "callback_type") <> -1 then
132 pause 133 ierr = 1;
133end 134end
134// TODO tests with wrong callbackType ?? 135// TODO tests with wrong callbackType ??
135 136
136// --- Enable --- 137// --- Enable ---
137// Default value 138// Default value
138if get(h, "enable") <> "on" then 139if get(h, "enable") <> "on" then
139 pause 140 ierr = 1;
140end 141end
141set(h, "enable", "off"); 142set(h, "enable", "off");
142if get(h, "enable") <> "off" then 143if get(h, "enable") <> "off" then
143 pause 144 ierr = 1;
144end 145end
145set(h, "enable", "on"); 146set(h, "enable", "on");
146if get(h, "enable") <> "on" then 147if get(h, "enable") <> "on" then
147 pause 148 ierr = 1;
148end 149end
149// TODO test with wrong values 150// TODO test with wrong values
150 151
151// --- FontAngle --- 152// --- FontAngle ---
152// Default value 153// Default value
153if get(h, "fontangle") <> "normal" then 154if get(h, "fontangle") <> "normal" then
154 pause 155 ierr = 1;
155end 156end
156set(h, "fontangle", "italic"); 157set(h, "fontangle", "italic");
157if get(h, "fontangle") <> "italic" then 158if get(h, "fontangle") <> "italic" then
158 pause 159 ierr = 1;
159end 160end
160set(h, "fontangle", "oblique"); 161set(h, "fontangle", "oblique");
161if get(h, "fontangle") <> "oblique" then 162if get(h, "fontangle") <> "oblique" then
162 pause 163 ierr = 1;
163end 164end
164set(h, "fontangle", "normal"); 165set(h, "fontangle", "normal");
165if get(h, "fontangle") <> "normal" then 166if get(h, "fontangle") <> "normal" then
166 pause 167 ierr = 1;
167end 168end
168// TODO test with wrong values 169// TODO test with wrong values
169 170
170// --- FontSize --- 171// --- FontSize ---
171// Default value 172// Default value
172if get(h, "fontsize") <> 10 then 173if get(h, "fontsize") <> 10 then
173 pause 174 ierr = 1;
174end 175end
175set(h, "fontsize", 12); 176set(h, "fontsize", 12);
176if get(h, "fontsize") <> 12 then 177if get(h, "fontsize") <> 12 then
177 pause 178 ierr = 1;
178end 179end
179// TODO test with wrong values 180// TODO test with wrong values
180 181
181// --- FontUnits --- 182// --- FontUnits ---
182// Default value 183// Default value
183if get(h, "fontunits") <> "points" then 184if get(h, "fontunits") <> "points" then
184 pause 185 ierr = 1;
185end 186end
186set(h, "fontunits", "pixels"); 187set(h, "fontunits", "pixels");
187if get(h, "fontunits") <> "pixels" then 188if get(h, "fontunits") <> "pixels" then
188 pause 189 ierr = 1;
189end 190end
190set(h, "fontunits", "normalized"); 191set(h, "fontunits", "normalized");
191if get(h, "fontunits") <> "normalized" then 192if get(h, "fontunits") <> "normalized" then
192 pause 193 ierr = 1;
193end 194end
194set(h, "fontunits", "points"); 195set(h, "fontunits", "points");
195if get(h, "fontunits") <> "points" then 196if get(h, "fontunits") <> "points" then
196 pause 197 ierr = 1;
197end 198end
198// TODO test with wrong values 199// TODO test with wrong values
199 200
200// --- FontWeight --- 201// --- FontWeight ---
201// Default value 202// Default value
202if get(h, "fontweight") <> "normal" then 203if get(h, "fontweight") <> "normal" then
203 pause 204 ierr = 1;
204end 205end
205set(h, "fontweight", "light"); 206set(h, "fontweight", "light");
206if get(h, "fontweight") <> "light" then 207if get(h, "fontweight") <> "light" then
207 pause 208 ierr = 1;
208end 209end
209set(h, "fontweight", "demi"); 210set(h, "fontweight", "demi");
210if get(h, "fontweight") <> "demi" then 211if get(h, "fontweight") <> "demi" then
211 pause 212 ierr = 1;
212end 213end
213set(h, "fontweight", "bold"); 214set(h, "fontweight", "bold");
214if get(h, "fontweight") <> "bold" then 215if get(h, "fontweight") <> "bold" then
215 pause 216 ierr = 1;
216end 217end
217set(h, "fontweight", "normal"); 218set(h, "fontweight", "normal");
218if get(h, "fontweight") <> "normal" then 219if get(h, "fontweight") <> "normal" then
219 pause 220 ierr = 1;
220end 221end
221// TODO test with wrong values 222// TODO test with wrong values
222 223
223// --- Fontname tests --- 224// --- Fontname tests ---
224if get(h, "fontname") <> "helvetica" then 225if get(h, "fontname") <> "helvetica" then
225 pause 226 ierr = 1;
226end 227end
227// Try to set an existing font 228// Try to set an existing font
228set(h, "fontname", "courier new"); 229set(h, "fontname", "courier new");
229if get(h, "fontname") <> "courier new" then 230if get(h, "fontname") <> "courier new" then
230 pause 231 ierr = 1;
231end 232end
232// Try to set a not-existing font 233// Try to set a not-existing font
233set(h, "fontname", "an invented font"); 234set(h, "fontname", "an invented font");
234if get(h, "fontname") <> "an invented font" then 235if get(h, "fontname") <> "an invented font" then
235 pause 236 ierr = 1;
236end 237end
237 238
238// --- ForegroundColor --- 239// --- ForegroundColor ---
@@ -240,40 +241,40 @@ end
240// Vector of 'integer' values 241// Vector of 'integer' values
241set(h, "foregroundcolor", [1 0 1]); 242set(h, "foregroundcolor", [1 0 1]);
242if ~and(get(h, "foregroundcolor") == [1 0 1]) then 243if ~and(get(h, "foregroundcolor") == [1 0 1]) then
243 pause 244 ierr = 1;
244end 245end
245// Vector of 'real' values 246// Vector of 'real' values
246set(h, "foregroundcolor", [0.6 0.5 0.4]); 247set(h, "foregroundcolor", [0.6 0.5 0.4]);
247if ~and(get(h, "foregroundcolor") == [0.6 0.5 0.4]) then 248if ~and(get(h, "foregroundcolor") == [0.6 0.5 0.4]) then
248 pause 249 ierr = 1;
249end 250end
250// String of 'integer' values 251// String of 'integer' values
251set(h, "foregroundcolor", "1|1|1"); 252set(h, "foregroundcolor", "1|1|1");
252if ~and(get(h, "foregroundcolor") == [1 1 1]) then 253if ~and(get(h, "foregroundcolor") == [1 1 1]) then
253 pause 254 ierr = 1;
254end 255end
255// String of 'real' values 256// String of 'real' values
256set(h, "foregroundcolor", "0.5|0.6|0.7"); 257set(h, "foregroundcolor", "0.5|0.6|0.7");
257if ~and(get(h, "foregroundcolor") == [0.5 0.6 0.7]) then 258if ~and(get(h, "foregroundcolor") == [0.5 0.6 0.7]) then
258 pause 259 ierr = 1;
259end 260end
260// TODO Test with wrong format values: "aze", "", [], ... 261// TODO Test with wrong format values: "aze", "", [], ...
261 262
262// --- HorizontalAlignment --- 263// --- HorizontalAlignment ---
263if get(h, "horizontalalignment") <> "center" then 264if get(h, "horizontalalignment") <> "center" then
264 pause 265 ierr = 1;
265end 266end
266set(h, "horizontalalignment", "left"); 267set(h, "horizontalalignment", "left");
267if get(h, "horizontalalignment") <> "left" then 268if get(h, "horizontalalignment") <> "left" then
268 pause 269 ierr = 1;
269end 270end
270set(h, "horizontalalignment", "right"); 271set(h, "horizontalalignment", "right");
271if get(h, "horizontalalignment") <> "right" then 272if get(h, "horizontalalignment") <> "right" then
272 pause 273 ierr = 1;
273end 274end
274set(h, "horizontalalignment", "center"); 275set(h, "horizontalalignment", "center");
275if get(h, "horizontalalignment") <> "center" then 276if get(h, "horizontalalignment") <> "center" then
276 pause 277 ierr = 1;
277end 278end
278// TODO test with wrong values 279// TODO test with wrong values
279 280
@@ -282,15 +283,15 @@ end
282// --- Max --- 283// --- Max ---
283// Default value 284// Default value
284if get(h, "max") <> 1 then 285if get(h, "max") <> 1 then
285 pause 286 ierr = 1;
286end 287end
287set(h, "max", 10); 288set(h, "max", 10);
288if get(h, "max") <> 10 then 289if get(h, "max") <> 10 then
289 pause 290 ierr = 1;
290end 291end
291set(h, "max", 1); // Back to default value needed by SliderStep test 292set(h, "max", 1); // Back to default value needed by SliderStep test
292if get(h, "max") <> 1 then 293if get(h, "max") <> 1 then
293 pause 294 ierr = 1;
294end 295end
295 296
296// TODO test with min > max 297// TODO test with min > max
@@ -299,15 +300,15 @@ end
299// --- Min --- 300// --- Min ---
300// Default value 301// Default value
301if get(h, "min") <> 0 then 302if get(h, "min") <> 0 then
302 pause 303 ierr = 1;
303end 304end
304set(h, "min", 1); 305set(h, "min", 1);
305if get(h, "min") <> 1 then 306if get(h, "min") <> 1 then
306 pause 307 ierr = 1;
307end 308end
308set(h, "min", 0); // Back to default value needed by SliderStep test 309set(h, "min", 0); // Back to default value needed by SliderStep test
309if get(h, "min") <> 0 then 310if get(h, "min") <> 0 then
310 pause 311 ierr = 1;
311end 312end
312// TODO test with min > max 313// TODO test with min > max
313// TODO test with wrong values 314// TODO test with wrong values
@@ -317,17 +318,17 @@ end
317// --- Position --- 318// --- Position ---
318// Default value 319// Default value
319if ~and(get(h, "position") == [20 40 40 20]) then 320if ~and(get(h, "position") == [20 40 40 20]) then
320 pause 321 ierr = 1;
321end 322end
322// Vector of 'integer' values 323// Vector of 'integer' values
323set(h, "position", [0 10 100 200]) 324set(h, "position", [0 10 100 200])
324if ~and(get(h, "position") == [0 10 100 200]) then 325if ~and(get(h, "position") == [0 10 100 200]) then
325 pause 326 ierr = 1;
326end 327end
327// String of 'integer' values 328// String of 'integer' values
328set(h, "position", "10|20|50|100"); 329set(h, "position", "10|20|50|100");
329if ~and(get(h, "position") == [10 20 50 100]) then 330if ~and(get(h, "position") == [10 20 50 100]) then
330 pause 331 ierr = 1;
331end 332end
332// TODO Test with wrong format values: "aze", "", [], ... 333// TODO Test with wrong format values: "aze", "", [], ...
333 334
@@ -335,57 +336,57 @@ end
335// Default value is tested in separate files because is different according the style 336// Default value is tested in separate files because is different according the style
336set(h, "relief", "groove"); 337set(h, "relief", "groove");
337if get(h, "relief") <> "groove" then 338if get(h, "relief") <> "groove" then
338 pause 339 ierr = 1;
339end 340end
340set(h, "relief", "raised"); 341set(h, "relief", "raised");
341if get(h, "relief") <> "raised" then 342if get(h, "relief") <> "raised" then
342 pause 343 ierr = 1;
343end 344end
344set(h, "relief", "ridge"); 345set(h, "relief", "ridge");
345if get(h, "relief") <> "ridge" then 346if get(h, "relief") <> "ridge" then
346 pause 347 ierr = 1;
347end 348end
348set(h, "relief", "solid"); 349set(h, "relief", "solid");
349if get(h, "relief") <> "solid" then 350if get(h, "relief") <> "solid" then
350 pause 351 ierr = 1;
351end 352end
352set(h, "relief", "sunken"); 353set(h, "relief", "sunken");
353if get(h, "relief") <> "sunken" then 354if get(h, "relief") <> "sunken" then
354 pause 355 ierr = 1;
355end 356end
356set(h, "relief", "flat"); 357set(h, "relief", "flat");
357if get(h, "relief") <> "flat" then 358if get(h, "relief") <> "flat" then
358 pause 359 ierr = 1;
359end 360end
360// TODO test with wrong values 361// TODO test with wrong values
361 362
362// --- SliderStep --- 363// --- SliderStep ---
363// Default value 364// Default value
364if ~and(get(h, "sliderstep") == [0.01 0.1]) then 365if ~and(get(h, "sliderstep") == [0.01 0.1]) then
365 pause 366 ierr = 1;
366end 367end
367set(h, "sliderstep", [0.2 0.5]); 368set(h, "sliderstep", [0.2 0.5]);
368if ~and(get(h, "sliderstep") == [0.2 0.5]) then 369if ~and(get(h, "sliderstep") == [0.2 0.5]) then
369 pause 370 ierr = 1;
370end 371end
371set(h, "sliderstep", [0.01 0.1]); 372set(h, "sliderstep", [0.01 0.1]);
372if ~and(get(h, "sliderstep") == [0.01 0.1]) then 373if ~and(get(h, "sliderstep") == [0.01 0.1]) then
373 pause 374 ierr = 1;
374end 375end
375// TODO test for value1 > value2 376// TODO test for value1 > value2
376// TODO test with wrong values 377// TODO test with wrong values
377 378
378// --- String --- 379// --- String ---
379if get(h, "string") <> "" then 380if get(h, "string") <> "" then
380 pause 381 ierr = 1;
381end 382end
382set(h, "string", ["test for string"]); 383set(h, "string", ["test for string"]);
383if get(h, "string") <> "test for string" then 384if get(h, "string") <> "test for string" then
384 pause 385 ierr = 1;
385end 386end
386set(h, "string", ""); 387set(h, "string", "");
387if get(h, "string") <> "" then 388if get(h, "string") <> "" then
388 pause 389 ierr = 1;
389end 390end
390 391
391// TODO test with wrong values 392// TODO test with wrong values
@@ -393,56 +394,56 @@ end
393// --- Style --- 394// --- Style ---
394// Default value 395// Default value
395if get(h, "style") <> uicontrol_style then 396if get(h, "style") <> uicontrol_style then
396 pause 397 ierr = 1;
397end 398end
398// TODO style changes tests (when implemented) 399// TODO style changes tests (when implemented)
399 400
400// --- Tag --- 401// --- Tag ---
401// Default value 402// Default value
402if get(h, "tag") <> "" then 403if get(h, "tag") <> "" then
403 pause 404 ierr = 1;
404end 405end
405set(h, "tag", "test for tag"); 406set(h, "tag", "test for tag");
406if get(h, "tag") <> "test for tag" then 407if get(h, "tag") <> "test for tag" then
407 pause 408 ierr = 1;
408end 409end
409set(h, "tag", ""); 410set(h, "tag", "");
410if get(h, "tag") <> "" then 411if get(h, "tag") <> "" then
411 pause 412 ierr = 1;
412end 413end
413// TODO test with wrong values 414// TODO test with wrong values
414 415
415// --- Units --- 416// --- Units ---
416// Default value 417// Default value
417if get(h, "units") <> "pixels" then 418if get(h, "units") <> "pixels" then
418 pause 419 ierr = 1;
419end 420end
420set(h, "units", "points"); 421set(h, "units", "points");
421if get(h, "units") <> "points" then 422if get(h, "units") <> "points" then
422 pause 423 ierr = 1;
423end 424end
424set(h, "units", "normalized"); 425set(h, "units", "normalized");
425if get(h, "units") <> "normalized" then 426if get(h, "units") <> "normalized" then
426 pause 427 ierr = 1;
427end 428end
428set(h, "units", "pixels"); 429set(h, "units", "pixels");
429if get(h, "units") <> "pixels" then 430if get(h, "units") <> "pixels" then
430 pause 431 ierr = 1;
431end 432end
432// TODO test with wrong values 433// TODO test with wrong values
433 434
434// --- UserData --- 435// --- UserData ---
435// Default value 436// Default value
436if ~isempty(get(h, "user_data")) then 437if ~isempty(get(h, "user_data")) then
437 pause 438 ierr = 1;
438end 439end
439set(h, "user_data", [1 2 3]); 440set(h, "user_data", [1 2 3]);
440if ~and(get(h, "user_data") == [1 2 3]) then 441if ~and(get(h, "user_data") == [1 2 3]) then
441 pause 442 ierr = 1;
442end 443end
443set(h, "user_data", []); 444set(h, "user_data", []);
444if ~isempty(get(h, "user_data")) then 445if ~isempty(get(h, "user_data")) then
445 pause 446 ierr = 1;
446end 447end
447 448
448// --- Value tests --- 449// --- Value tests ---
@@ -451,19 +452,19 @@ end
451 452
452// --- VerticalalAlignment --- 453// --- VerticalalAlignment ---
453if get(h, "verticalalignment") <> "middle" then 454if get(h, "verticalalignment") <> "middle" then
454 pause 455 ierr = 1;
455end 456end
456set(h, "verticalalignment", "top"); 457set(h, "verticalalignment", "top");
457if get(h, "verticalalignment") <> "top" then 458if get(h, "verticalalignment") <> "top" then
458 pause 459 ierr = 1;
459end 460end
460set(h, "verticalalignment", "bottom"); 461set(h, "verticalalignment", "bottom");
461if get(h, "verticalalignment") <> "bottom" then 462if get(h, "verticalalignment") <> "bottom" then
462 pause 463 ierr = 1;
463end 464end
464set(h, "verticalalignment", "middle"); 465set(h, "verticalalignment", "middle");
465if get(h, "verticalalignment") <> "middle" then 466if get(h, "verticalalignment") <> "middle" then
466 pause 467 ierr = 1;
467end 468end
468// TODO test with wrong values 469// TODO test with wrong values
469 470