Xcos MVC: allow passing mlists as Superblocks' subdiagrams
[scilab.git] / scilab / modules / xcos / tests / unit_tests / xcosPal.dia.ref
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) DIGITEO - 2010-2010 - ClĂ©ment DAVID <clement.david@scilab.org>
3 //
4 // This file is distributed under the same license as the Scilab package.
5 // <-- XCOS TEST -->
6 //
7 // <-- Short Description -->
8 // White-box test for the xcosPal macro.
9 fields=["name";"blockNames";"icons";"style"]
10 fields  = 
11 !name        !
12 !            !
13 !blockNames  !
14 !            !
15 !icons       !
16 !            !
17 !style       !
18 name = "My palette";
19 exec(SCI + "/modules/scicos/palettes/Lookup_Tables.cosf", -1); // getting an scs_m
20 pal = xcosPal();
21 assert_checkequal(fieldnames(pal), fields);
22 pal = xcosPal(name);
23 assert_checkequal(fieldnames(pal), fields);
24 assert_checkequal(pal.name, name);
25 pal = xcosPal(scs_m);
26 assert_checkequal(fieldnames(pal), fields);
27 assert_checkequal(pal.name, "Lookup_Tables");
28 assert_checkfalse(isempty(pal.blockNames));
29 assert_checkequal(size(pal.blockNames), size(pal.icons));
30 assert_checkequal(size(pal.blockNames), size(pal.style));
31 pal = xcosPal([], scs_m);
32 assert_checkequal(fieldnames(pal), fields);
33 assert_checkequal(pal.name, "Lookup_Tables");
34 assert_checkfalse(isempty(pal.blockNames));
35 assert_checkequal(size(pal.blockNames), size(pal.icons));
36 assert_checkequal(size(pal.blockNames), size(pal.style));
37 pal = xcosPal(name, scs_m);
38 assert_checkequal(fieldnames(pal), fields);
39 // scs_m name will always be used
40 assert_checkequal(pal.name, "Lookup_Tables");
41 assert_checkfalse(isempty(pal.blockNames));
42 assert_checkequal(size(pal.blockNames), size(pal.icons));
43 assert_checkequal(size(pal.blockNames), size(pal.style));