fix uiDumpTree test 22/15222/3
Anais AUBERT [Thu, 14 Aug 2014 14:01:19 +0000 (16:01 +0200)]
Change-Id: I02c25afd1c5d1a60833512525e7cd04b9b8c6c58

scilab/modules/gui/tests/unit_tests/tree/uiDumpTree.dia.ref
scilab/modules/gui/tests/unit_tests/tree/uiDumpTree.tst

index e171998..0c7e708 100644 (file)
@@ -1,6 +1,6 @@
 // =============================================================================
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - DIGITEO - Sylvestre KOUMAR 
+// Copyright (C) 2009 - DIGITEO - Sylvestre KOUMAR
 //
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 lines(0)
 // test to check the dumped tree
 // tree dumping error test
-if( execstr("uiDumpTree()","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(123,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(123, 123, 123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(123,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(123,%T)","errcatch") == 0 ) then bugmes();quit;end
+refMsg = msprintf(_("%s: Wrong number of input arguments: %d to %d expected.\n"), "uiDumpTree",1,2);
+assert_checkerror("uiDumpTree()", refMsg);
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: uitree expected.\n"), "uiDumpTree",1);
+assert_checkerror("uiDumpTree(123)", refMsg);
+assert_checkerror("uiDumpTree(123, 123)", refMsg);
+assert_checkerror("uiDumpTree(123, %F)", refMsg);
+assert_checkerror("uiDumpTree(123, %T)", refMsg);
+refMsg = msprintf(_("Wrong number of input arguments."));
+assert_checkerror("uiDumpTree(123, 123, 123)", refMsg);
 // node creation
-leaf11 = uiCreateNode('leaf 1.1', 'iconLeaf1.1', 'callbackLeaf1.1')
- leaf11  =
-       leaf11(1)
- uitree   
-       leaf11(2)
-   label: "leaf 1.1"
-   icon: "iconLeaf1.1"
-   callback: "callbackLeaf1.1"
-leaf12 = uiCreateNode('leaf 1.2', 'iconLeaf1.2', 'callbackLeaf1.2')
- leaf12  =
-       leaf12(1)
- uitree   
-       leaf12(2)
-   label: "leaf 1.2"
-   icon: "iconLeaf1.2"
-   callback: "callbackLeaf1.2"
-leaf31 = uiCreateNode('leaf 3.1', 'iconLeaf3.1', 'callbackLeaf3.1')
- leaf31  =
-       leaf31(1)
- uitree   
-       leaf31(2)
-   label: "leaf 3.1"
-   icon: "iconLeaf3.1"
-   callback: "callbackLeaf3.1"
-leaf32 = uiCreateNode('leaf 3.2', 'iconLeaf3.2', 'callbackLeaf3.2')
- leaf32  =
-       leaf32(1)
- uitree   
-       leaf32(2)
-   label: "leaf 3.2"
-   icon: "iconLeaf3.2"
-   callback: "callbackLeaf3.2"
-node1 = uiCreateNode('Node 1', 'iconNode1', 'callbackNode1')
- node1  =
-       node1(1)
- uitree   
-       node1(2)
-   label: "Node 1"
-   icon: "iconNode1"
-   callback: "callbackNode1"
-node2 = uiCreateNode('Node 2', 'iconNode2', 'callbackNode2')
- node2  =
-       node2(1)
- uitree   
-       node2(2)
-   label: "Node 2"
-   icon: "iconNode2"
-   callback: "callbackNode2"
-node3 = uiCreateNode('Node 3', 'iconNode3', 'callbackNode3')
- node3  =
-       node3(1)
- uitree   
-       node3(2)
-   label: "Node 3"
-   icon: "iconNode3"
-   callback: "callbackNode3"
-root = uiCreateNode('Root', 'iconRoot', 'callbackRoot')
- root  =
-       root(1)
- uitree   
-       root(2)
-   label: "Root"
-   icon: "iconRoot"
-   callback: "callbackRoot"
-// right inputs
-uiDumpTree(leaf11)
+leaf11 = uiCreateNode("leaf 1.1", "iconLeaf1.1", "callbackLeaf1.1");
+leaf12 = uiCreateNode("leaf 1.2", "iconLeaf1.2", "callbackLeaf1.2");
+leaf31 = uiCreateNode("leaf 3.1", "iconLeaf3.1", "callbackLeaf3.1");
+leaf32 = uiCreateNode("leaf 3.2", "iconLeaf3.2", "callbackLeaf3.2");
+node1 = uiCreateNode("Node 1", "iconNode1", "callbackNode1");
+node2 = uiCreateNode("Node 2", "iconNode2", "callbackNode2");
+node3 = uiCreateNode("Node 3", "iconNode3", "callbackNode3");
+root = uiCreateNode("Root", "iconRoot", "callbackRoot");
+// right inputs
+uiDumpTree(leaf11);
 |_./ leaf 1.1
-uiDumpTree(leaf11,%F)
+uiDumpTree(leaf11,%F);
 |_./ leaf 1.1
-uiDumpTree(leaf11,%T)
+uiDumpTree(leaf11,%T);
 |_./ leaf 1.1
 | `- iconLeaf1.1
 | `- callbackLeaf1.1
 // wrong inputs
-if( execstr("uiDumpTree(leaf11,123)","errcatch") == 0 ) then bugmes();quit;end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Boolean expected.\n"), "uiDumpTree",2);
+assert_checkerror("uiDumpTree(leaf11,123)", refMsg);
 // node creation with errors
-if( execstr("myErrorNode1 = uiCreateNode()","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myErrorNode1)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode1,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode1,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode1,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myErrorNode2 = uiCreateNode(123)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myErrorNode2)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode2,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode2,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode2,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myErrorNode3 = uiCreateNode(123, ''icon of My Node'')","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myErrorNode4 = uiCreateNode(''My Node'', 123)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myErrorNode3)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode3,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode3,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode3,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myErrorNode5 = uiCreateNode(123, ''icon of My Node'', ''callback of My Node'')","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myErrorNode6 = uiCreateNode(''My Node'', 123, ''callback of My Node'')","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myErrorNode7 = uiCreateNode(''My Node'', ''icon of My Node'', 123)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myErrorNode5)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode5,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode5,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode5,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myErrorNode8 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', ''test'')","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myErrorNode9 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', 123)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myErrorNode8)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode8,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myErrorNode8,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode8,123)","errcatch") == 0 ) then bugmes();quit;end
+refMsg = msprintf(_("%s: Wrong number of input arguments: %d to %d expected.\n"), "uiCreateNode",1,3);
+assert_checkerror("myErrorNode1 = uiCreateNode()", refMsg);
+// right inputs
+refMsg = msprintf(_("Undefined variable: %s\n"), "myErrorNode1");
+assert_checkerror("uiDumpTree(myErrorNode1)", refMsg);
+assert_checkerror("uiDumpTree(myErrorNode1, %F)", refMsg);
+assert_checkerror("uiDumpTree(myErrorNode1, %T)", refMsg);
+//wrong
+assert_checkerror("uiDumpTree(myErrorNode1, 123)", refMsg);
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",1);
+assert_checkerror("myErrorNode2 = uiCreateNode(123)", refMsg);
+assert_checkerror("myErrorNode3 = uiCreateNode(123, ''icon of My Node'')", refMsg);
+// right inputs
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",2);
+assert_checkerror("myErrorNode4 = uiCreateNode(''My Node'', 123)", refMsg);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",1);
+assert_checkerror("myErrorNode5 = uiCreateNode(123, ''icon of My Node'', ''callback of My Node'')", refMsg);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",2);
+assert_checkerror("myErrorNode6 = uiCreateNode(''My Node'', 123, ''callback of My Node'')", refMsg);
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",3);
+assert_checkerror("myErrorNode6 = uiCreateNode(''My Node'', ''icon of My Node'', 123)", refMsg);
+refMsg = msprintf(_("Wrong number of input arguments."));
+assert_checkerror("myErrorNode8 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', ''test'')", refMsg);
+assert_checkerror("myErrorNode9 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', 123)", refMsg);
 // tree creation
-treeOnlyNode1 = uiCreateTree(node1)
- treeOnlyNode1  =
-       treeOnlyNode1(1)
- uitree   
-       treeOnlyNode1(2)
-   label: "Node 1"
-   icon: "iconNode1"
-   callback: "callbackNode1"
+treeOnlyNode1 = uiCreateTree(node1);
 // right inputs
-uiDumpTree(treeOnlyNode1)
+uiDumpTree(treeOnlyNode1);
 |_./ Node 1
-uiDumpTree(treeOnlyNode1,%F)
+uiDumpTree(treeOnlyNode1,%F);
 |_./ Node 1
-uiDumpTree(treeOnlyNode1,%T)
+uiDumpTree(treeOnlyNode1,%T);
 |_./ Node 1
 | `- iconNode1
 | `- callbackNode1
 // wrong inputs
-if( execstr("uiDumpTree(treeOnlyNode1,123)","errcatch") == 0 ) then bugmes();quit;end
-treeNode1 = uiCreateTree(node1, leaf11,leaf12)
- treeNode1  =
-       treeNode1(1)
- uitree   
-       treeNode1(2)
-   label: "Node 1"
-   icon: "iconNode1"
-   callback: "callbackNode1"
-       treeNode1(3)
-        treeNode1(3)(1)
- uitree   
-        treeNode1(3)(2)
-   label: "leaf 1.1"
-   icon: "iconLeaf1.1"
-   callback: "callbackLeaf1.1"
-treeNode3 = uiCreateTree(node3, leaf31,leaf32)
- treeNode3  =
-       treeNode3(1)
- uitree   
-       treeNode3(2)
-   label: "Node 3"
-   icon: "iconNode3"
-   callback: "callbackNode3"
-       treeNode3(3)
-        treeNode3(3)(1)
- uitree   
-        treeNode3(3)(2)
-   label: "leaf 3.1"
-   icon: "iconLeaf3.1"
-   callback: "callbackLeaf3.1"
-treeRoot = uiCreateTree(root, node1,node2,node3)
- treeRoot  =
-       treeRoot(1)
- uitree   
-       treeRoot(2)
-   label: "Root"
-   icon: "iconRoot"
-   callback: "callbackRoot"
-       treeRoot(3)
-        treeRoot(3)(1)
- uitree   
-        treeRoot(3)(2)
-   label: "Node 1"
-   icon: "iconNode1"
-   callback: "callbackNode1"
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Boolean expected.\n"), "uiDumpTree",2);
+assert_checkerror("uiDumpTree(treeOnlyNode1,123)", refMsg);
+treeNode1 = uiCreateTree(node1, leaf11,leaf12);
+treeNode3 = uiCreateTree(node3, leaf31,leaf32);
+treeRoot = uiCreateTree(root, node1,node2,node3);
 // right inputs
-uiDumpTree(treeRoot)
+uiDumpTree(treeRoot);
 |_./ Root
 | |_./ Node 1
 | |_./ Node 2
 | |_./ Node 3
-uiDumpTree(treeRoot,%F)
+uiDumpTree(treeRoot,%F);
 |_./ Root
 | |_./ Node 1
 | |_./ Node 2
 | |_./ Node 3
-uiDumpTree(treeRoot,%T)
+uiDumpTree(treeRoot,%T);
 |_./ Root
 | `- iconRoot
 | `- callbackRoot
@@ -298,251 +105,25 @@ uiDumpTree(treeRoot,%T)
 | | `- iconNode3
 | | `- callbackNode3
 // wrong inputs
-if( execstr("uiDumpTree(treeRoot,123)","errcatch") == 0 ) then bugmes();quit;end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Boolean expected.\n"), "uiDumpTree",2);
+assert_checkerror("uiDumpTree(treeRoot,123)", refMsg);
 // tree creation with wrong inputs
-if( execstr("myTree = uiCreateTree()","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(123)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(123, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, 123,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,123,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,node2,123)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
+refMsg = msprintf(_("%s: Wrong number of input argument(s): At least %d expected.\n"), "uiCreateTree",1);
+assert_checkerror("uiCreateTree()", refMsg);
+// right inputs
+refMsg = msprintf(_("Undefined variable: %s\n"), "myTree");
+assert_checkerror("uiDumpTree(myTree)", refMsg);
+assert_checkerror("uiDumpTree(myTree, %F)", refMsg);
+assert_checkerror("uiDumpTree(myTree, %T)", refMsg);
+assert_checkerror("uiDumpTree(myTree, 123)", refMsg);
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: uitree expected.\n"), "uiCreateTree",1);
+assert_checkerror("myTree = uiCreateTree(123)", refMsg);
+refMsg = msprintf(_("%s: Wrong type for element %d of input argument #%d: uitree expected.\n"), "uiCreateTree", 3, 2);
+assert_checkerror("myTree = uiCreateTree(root, node1, node2, 123)", refMsg);
 // tree creation with invalid nodes
-if( execstr("myTree = uiCreateTree(myErrorNode1)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode2)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode4)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode5)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode6)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode7)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode8)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode9)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode1, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, myErrorNode1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode1,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode1)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode2, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, myErrorNode2,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode2)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode3, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, myErrorNode3,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode3,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode5, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, myErrorNode5,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode5,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode5)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(myErrorNode8, node1,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, myErrorNode8,node2,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode8,node3)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode8)","errcatch") == 0 ) then bugmes();quit;end
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then bugmes();quit;end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then bugmes();quit;end
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then bugmes();quit;end
+refMsg = msprintf(_("Undefined variable: %s\n"), "myErrorNode1");
+assert_checkerror("uiDumpTree(myErrorNode1)", refMsg);
+assert_checkerror("myTree = uiCreateTree(myErrorNode1, node1, node2, 123)", refMsg);
+assert_checkerror("myTree = uiCreateTree(root, myErrorNode1,node2,node3)", refMsg);
+assert_checkerror("myTree = uiCreateTree(root, node1,myErrorNode1,node3)", refMsg);
+assert_checkerror("myTree = uiCreateTree(root, node1,node2,myErrorNode1)", refMsg);
index 9bffba9..e625c13 100644 (file)
@@ -1,6 +1,6 @@
 // =============================================================================
 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - DIGITEO - Sylvestre KOUMAR 
+// Copyright (C) 2009 - DIGITEO - Sylvestre KOUMAR
 //
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
@@ -12,466 +12,123 @@ lines(0)
 // test to check the dumped tree
 
 // tree dumping error test
-if( execstr("uiDumpTree()","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(123)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(123,123)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(123, 123, 123)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(123,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(123,%T)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong number of input arguments: %d to %d expected.\n"), "uiDumpTree",1,2);
+assert_checkerror("uiDumpTree()", refMsg);
 
-// node creation
-leaf11 = uiCreateNode('leaf 1.1', 'iconLeaf1.1', 'callbackLeaf1.1')
-leaf12 = uiCreateNode('leaf 1.2', 'iconLeaf1.2', 'callbackLeaf1.2')
-leaf31 = uiCreateNode('leaf 3.1', 'iconLeaf3.1', 'callbackLeaf3.1')
-leaf32 = uiCreateNode('leaf 3.2', 'iconLeaf3.2', 'callbackLeaf3.2')
-node1 = uiCreateNode('Node 1', 'iconNode1', 'callbackNode1')
-node2 = uiCreateNode('Node 2', 'iconNode2', 'callbackNode2')
-node3 = uiCreateNode('Node 3', 'iconNode3', 'callbackNode3')
-root = uiCreateNode('Root', 'iconRoot', 'callbackRoot')
-
-// right inputs
-uiDumpTree(leaf11)
-uiDumpTree(leaf11,%F)
-uiDumpTree(leaf11,%T)
-
-// wrong inputs
-if( execstr("uiDumpTree(leaf11,123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: uitree expected.\n"), "uiDumpTree",1);
+assert_checkerror("uiDumpTree(123)", refMsg);
+assert_checkerror("uiDumpTree(123, 123)", refMsg);
+assert_checkerror("uiDumpTree(123, %F)", refMsg);
+assert_checkerror("uiDumpTree(123, %T)", refMsg);
 
+refMsg = msprintf(_("Wrong number of input arguments."));
+assert_checkerror("uiDumpTree(123, 123, 123)", refMsg);
 
-// node creation with errors
-if( execstr("myErrorNode1 = uiCreateNode()","errcatch") == 0 ) then pause,end
+// node creation
+leaf11 = uiCreateNode("leaf 1.1", "iconLeaf1.1", "callbackLeaf1.1");
+leaf12 = uiCreateNode("leaf 1.2", "iconLeaf1.2", "callbackLeaf1.2");
+leaf31 = uiCreateNode("leaf 3.1", "iconLeaf3.1", "callbackLeaf3.1");
+leaf32 = uiCreateNode("leaf 3.2", "iconLeaf3.2", "callbackLeaf3.2");
+node1 = uiCreateNode("Node 1", "iconNode1", "callbackNode1");
+node2 = uiCreateNode("Node 2", "iconNode2", "callbackNode2");
+node3 = uiCreateNode("Node 3", "iconNode3", "callbackNode3");
+root = uiCreateNode("Root", "iconRoot", "callbackRoot");
 
 // right inputs
-if( execstr("uiDumpTree(myErrorNode1)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode1,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode1,%T)","errcatch") == 0 ) then pause,end
+uiDumpTree(leaf11);
+uiDumpTree(leaf11,%F);
+uiDumpTree(leaf11,%T);
 
 // wrong inputs
-if( execstr("uiDumpTree(myErrorNode1,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myErrorNode2 = uiCreateNode(123)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myErrorNode2)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode2,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode2,%T)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Boolean expected.\n"), "uiDumpTree",2);
+assert_checkerror("uiDumpTree(leaf11,123)", refMsg);
 
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode2,123)","errcatch") == 0 ) then pause,end
 
-if( execstr("myErrorNode3 = uiCreateNode(123, ''icon of My Node'')","errcatch") == 0 ) then pause,end
-if( execstr("myErrorNode4 = uiCreateNode(''My Node'', 123)","errcatch") == 0 ) then pause,end
+// node creation with errors
+refMsg = msprintf(_("%s: Wrong number of input arguments: %d to %d expected.\n"), "uiCreateNode",1,3);
+assert_checkerror("myErrorNode1 = uiCreateNode()", refMsg);
 
 // right inputs
-if( execstr("uiDumpTree(myErrorNode3)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode3,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode3,%T)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("Undefined variable: %s\n"), "myErrorNode1");
+assert_checkerror("uiDumpTree(myErrorNode1)", refMsg);
+assert_checkerror("uiDumpTree(myErrorNode1, %F)", refMsg);
+assert_checkerror("uiDumpTree(myErrorNode1, %T)", refMsg);
+//wrong
+assert_checkerror("uiDumpTree(myErrorNode1, 123)", refMsg);
 
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode3,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myErrorNode5 = uiCreateNode(123, ''icon of My Node'', ''callback of My Node'')","errcatch") == 0 ) then pause,end
-if( execstr("myErrorNode6 = uiCreateNode(''My Node'', 123, ''callback of My Node'')","errcatch") == 0 ) then pause,end
-if( execstr("myErrorNode7 = uiCreateNode(''My Node'', ''icon of My Node'', 123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",1);
+assert_checkerror("myErrorNode2 = uiCreateNode(123)", refMsg);
+assert_checkerror("myErrorNode3 = uiCreateNode(123, ''icon of My Node'')", refMsg);
 
 // right inputs
-if( execstr("uiDumpTree(myErrorNode5)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode5,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode5,%T)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",2);
+assert_checkerror("myErrorNode4 = uiCreateNode(''My Node'', 123)", refMsg);
 
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode5,123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",1);
+assert_checkerror("myErrorNode5 = uiCreateNode(123, ''icon of My Node'', ''callback of My Node'')", refMsg);
 
-if( execstr("myErrorNode8 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', ''test'')","errcatch") == 0 ) then pause,end
-if( execstr("myErrorNode9 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', 123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",2);
+assert_checkerror("myErrorNode6 = uiCreateNode(''My Node'', 123, ''callback of My Node'')", refMsg);
 
-// right inputs
-if( execstr("uiDumpTree(myErrorNode8)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode8,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myErrorNode8,%T)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"), "uiCreateNode",3);
+assert_checkerror("myErrorNode6 = uiCreateNode(''My Node'', ''icon of My Node'', 123)", refMsg);
 
-// wrong inputs
-if( execstr("uiDumpTree(myErrorNode8,123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("Wrong number of input arguments."));
+assert_checkerror("myErrorNode8 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', ''test'')", refMsg);
+assert_checkerror("myErrorNode9 = uiCreateNode(''My Node'', ''icon of My Node'', ''callback of My Node'', 123)", refMsg);
 
 
 // tree creation
-treeOnlyNode1 = uiCreateTree(node1)
+treeOnlyNode1 = uiCreateTree(node1);
 
 // right inputs
-uiDumpTree(treeOnlyNode1)
-uiDumpTree(treeOnlyNode1,%F)
-uiDumpTree(treeOnlyNode1,%T)
+uiDumpTree(treeOnlyNode1);
+uiDumpTree(treeOnlyNode1,%F);
+uiDumpTree(treeOnlyNode1,%T);
 
 // wrong inputs
-if( execstr("uiDumpTree(treeOnlyNode1,123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Boolean expected.\n"), "uiDumpTree",2);
+assert_checkerror("uiDumpTree(treeOnlyNode1,123)", refMsg);
 
-treeNode1 = uiCreateTree(node1, leaf11,leaf12)
-treeNode3 = uiCreateTree(node3, leaf31,leaf32)
-treeRoot = uiCreateTree(root, node1,node2,node3)
+treeNode1 = uiCreateTree(node1, leaf11,leaf12);
+treeNode3 = uiCreateTree(node3, leaf31,leaf32);
+treeRoot = uiCreateTree(root, node1,node2,node3);
 
 // right inputs
-uiDumpTree(treeRoot)
-uiDumpTree(treeRoot,%F)
-uiDumpTree(treeRoot,%T)
+uiDumpTree(treeRoot);
+uiDumpTree(treeRoot,%F);
+uiDumpTree(treeRoot,%T);
 
 // wrong inputs
-if( execstr("uiDumpTree(treeRoot,123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: Boolean expected.\n"), "uiDumpTree",2);
+assert_checkerror("uiDumpTree(treeRoot,123)", refMsg);
 
 // tree creation with wrong inputs
-if( execstr("myTree = uiCreateTree()","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong number of input argument(s): At least %d expected.\n"), "uiCreateTree",1);
+assert_checkerror("uiCreateTree()", refMsg);
 
 // right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("Undefined variable: %s\n"), "myTree");
+assert_checkerror("uiDumpTree(myTree)", refMsg);
+assert_checkerror("uiDumpTree(myTree, %F)", refMsg);
+assert_checkerror("uiDumpTree(myTree, %T)", refMsg);
+assert_checkerror("uiDumpTree(myTree, 123)", refMsg);
 
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong type for input argument #%d: uitree expected.\n"), "uiCreateTree",1);
+assert_checkerror("myTree = uiCreateTree(123)", refMsg);
 
-if( execstr("myTree = uiCreateTree(123, node1,node2,node3)","errcatch") == 0 ) then pause,end
 
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, 123,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,123,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,node2,123)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("%s: Wrong type for element %d of input argument #%d: uitree expected.\n"), "uiCreateTree", 3, 2);
+assert_checkerror("myTree = uiCreateTree(root, node1, node2, 123)", refMsg);
 
 // tree creation with invalid nodes
-if( execstr("myTree = uiCreateTree(myErrorNode1)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode2)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode4)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode5)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode6)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode7)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode8)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode9)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(myErrorNode1, node1,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, myErrorNode1,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode1,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode1)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-
-if( execstr("myTree = uiCreateTree(myErrorNode2, node1,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, myErrorNode2,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode2)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-
-if( execstr("myTree = uiCreateTree(myErrorNode3, node1,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, myErrorNode3,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode3,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-
-if( execstr("myTree = uiCreateTree(myErrorNode5, node1,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
+refMsg = msprintf(_("Undefined variable: %s\n"), "myErrorNode1");
+assert_checkerror("uiDumpTree(myErrorNode1)", refMsg);
+assert_checkerror("myTree = uiCreateTree(myErrorNode1, node1, node2, 123)", refMsg);
+assert_checkerror("myTree = uiCreateTree(root, myErrorNode1,node2,node3)", refMsg);
+assert_checkerror("myTree = uiCreateTree(root, node1,myErrorNode1,node3)", refMsg);
+assert_checkerror("myTree = uiCreateTree(root, node1,node2,myErrorNode1)", refMsg);
 
-if( execstr("myTree = uiCreateTree(root, myErrorNode5,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode5,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode5)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-
-if( execstr("myTree = uiCreateTree(myErrorNode8, node1,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, myErrorNode8,node2,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,myErrorNode8,node3)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end
-
-if( execstr("myTree = uiCreateTree(root, node1,node2,myErrorNode8)","errcatch") == 0 ) then pause,end
-
-// right inputs
-if( execstr("uiDumpTree(myTree)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%F)","errcatch") == 0 ) then pause,end
-if( execstr("uiDumpTree(myTree,%T)","errcatch") == 0 ) then pause,end
-
-// wrong inputs
-if( execstr("uiDumpTree(myTree,123)","errcatch") == 0 ) then pause,end