* Bug 14606 fixed: now `[names,mem]=who()` returns memory used by variables
[scilab.git] / scilab / modules / core / tests / nonreg_tests / bug_14606.macosx.dia.ref
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2018 - St├ęphane Mottelet
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 //
8 // <-- TEST WITH GRAPHIC -->
9 // <-- ENGLISH IMPOSED -->
10 //
11 // <-- Non-regression test for bug 14606 -->
12 //
13 // <-- Bugzilla URL -->
14 // http://bugzilla.scilab.org/show_bug.cgi?id=14606
15 //
16 // <-- Short Description -->
17 // "who" doesn"t return memory size
18 bug_14606_double = ones(10,10);
19 bug_14606_uint8 = uint8(ones(10,10));
20 bug_14606_uint16 = uint16(ones(10,10));
21 bug_14606_uint32 = uint32(ones(10,10));
22 bug_14606_uint64 = uint64(ones(10,10));
23 bug_14606_int8 = int8(ones(10,10));
24 bug_14606_int16 = int16(ones(10,10));
25 bug_14606_int32 = int32(ones(10,10));
26 bug_14606_int64 = int64(ones(10,10));
27 bug_14606_bool = eye(10,10)==1;
28 bug_14606_poly = [%s 1+%s;1 1];
29 bug_14606_rat = 1./[%s 1+%s;1 1];
30 bug_14606_list = list(bug_14606_double, bug_14606_uint64, bug_14606_poly);
31 deff("out=%tlist_14606_size(x)","out=%nan");
32 deff("out=%mlist_14606_size(x)","out=%nan");
33 bug_14606_tlist = tlist(["tlist_14606","field1","field2"], 1:3, ["Scilab" "is" "not" "Basile"]);
34 bug_14606_mlist = mlist(["mlist_14606","field1","field2"], 1:3, ["Scilab" "is" "not" "Basile"]);
35 bug_14606_syslin=syslin('c',[0,1;0,0],[1;1],[1,1]);
36 bug_14606_sparse= sparse([1 1;2 2;3 3],1:3,[3 3]);
37 bug_14606_sparseboolean= sparse([1 1;2 2;3 3],1:3,[3 3]) > 1;
38 bug_14606_struct=struct("list1",list("testlist",1,2), "matrix1", [1 2 3; 4 5 6], "boolean1", %t);
39 bug_14606_struct=struct("list1",list("testlist",1,2), "matrix1", [1 2 3; 4 5 6], "boolean1", %t);
40 bug_14606_cell={bug_14606_struct, bug_14606_sparseboolean, bug_14606_poly};
41 bug_14606_handle=[sdf(),sda()];
42 bug_14606_pointer=lufact(bug_14606_sparse);
43 deff("out=bug_14606_macro(x,y)","out=x+y");
44 libdir=TMPDIR+"/bug_14606";
45 mkdir(libdir);
46 mputl(["function out=bug_14606_macro_file(x,y)","out=x+y","endfunction"],libdir+"/bug_14606_macro_file.sci");
47 genlib("bug_14606_lib",libdir,%f,%t);
48 -- Creation of [bug_14606_lib] (Macros) --
49 genlib: Processing file: bug_14606_macro_file.sci
50 clear bug_14606_lib
51 bug_14606_lib=lib(libdir); // output variable is compulsory otherwise Scilab crashes after next line
52 bug_14606_macro_file(1,1);
53 whos -name bug_14606
54 Name                     Type           Size           Bytes        
55  
56 bug_14606_bool           boolean        10x10          0            
57 bug_14606_cell           ce             1x3            0            
58 bug_14606_double         constant       10x10          0            
59 bug_14606_handle         handle         1x2            0            
60 bug_14606_int16          int16          10x10          0            
61 bug_14606_int32          int32          10x10          0            
62 bug_14606_int64          int64          10x10          0            
63 bug_14606_int8           int8           10x10          0            
64 bug_14606_lib            library                       0            
65 bug_14606_list           list           3              0            
66 bug_14606_macro          function                      0            
67 bug_14606_macro_file     function                      0            
68 bug_14606_mlist          mlist_14606    Nan            0            
69 bug_14606_pointer        pointer                       0            
70 bug_14606_poly           polynomial     2x2            0            
71 bug_14606_rat            rational       2x2            0            
72 bug_14606_sparse         sparse         3x3            0            
73 bug_14606_sparseboolean  boolean sparse 3x3            0            
74 bug_14606_struct         st             1x1            0            
75 bug_14606_syslin         state-space    1x1            0            
76 bug_14606_tlist          tlist_14606    Nan            0            
77 bug_14606_uint16         uint16         10x10          0            
78 bug_14606_uint32         uint32         10x10          0            
79 bug_14606_uint64         uint64         10x10          0            
80 bug_14606_uint8          uint8          10x10          0            
81 ludel(bug_14606_pointer)
82 bug_14606_var=zeros(10,10);
83 global bug_14606_var
84 whos -name bug_14606_var
85 Name                     Type           Size           Bytes        
86  
87 bug_14606_var            constant       10x10          0            
88 bug_14606_var            constant*      10x10          0            
89 clear bug_14606_var
90 whos -name bug_14606_var
91 Name                     Type           Size           Bytes        
92  
93 bug_14606_var            constant*      10x10          0