56db6e216181f6c59b71e1c95dedb5e4d84d1f9e
[scilab.git] / scilab / modules / graphics / tests / unit_tests / xset_xget.dia.ref
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2011 - Scilab Enterprises - Bruno JOFRET
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 // <-- TEST WITH GRAPHIC -->
8 // test xset and xget
9 // colormap
10 c_map = graycolormap(512);
11 xset("colormap", c_map);
12 out = xget("colormap");
13 assert_checkequal(out, c_map);
14 // mark size
15 xset("mark size", 456);
16 out = xget("mark size");
17 assert_checkequal(out, 456);
18 // mark
19 xset("mark", 4, 5);
20 out = xget("mark");
21 assert_checkequal(out, [4 5]);
22 // font
23 out = xget("font");
24 assert_checkequal(out, [6 1]);
25 xset("font", 8, 2);
26 out = xget("font");
27 assert_checkequal(out, [8 2]);
28 // line style
29 xset("line style", 8);
30 out = xget("line style");
31 assert_checkequal(out, 8);
32 // font size
33 out = xget("font size");
34 assert_checkequal(out, 2);
35 xset("font size", 42);
36 out = xget("font size");
37 assert_checkequal(out, 42);
38 // fpf
39 out = xget("fpf");
40 assert_checkequal(out, "");
41 xset("fpf", "%s.%s");
42 out = xget("fpf");
43 assert_checkequal(out, "%s.%s");
44 // auto clear
45 out = xget("auto clear");
46 assert_checkequal(out, "off");
47 xset("auto clear", "on")
48 out = xget("auto clear");
49 assert_checkequal(out, "on");
50 // dashes
51 out = xget("dashes");
52 assert_checkequal(out, 8);
53 xset("dashes", 2);
54 out = xget("dashes");
55 assert_checkequal(out, 2);
56 // hidden3d
57 out = xget("hidden3d");
58 assert_checkequal(out, 4);
59 xset("hidden3d", 21);
60 out = xget("hidden3d");
61 assert_checkequal(out, 21);
62 // window figure
63 f = gcf();
64 out = xget("window");
65 assert_checkequal(out, f.figure_id);
66 out = xget("figure");
67 assert_checkequal(out, f.figure_id);
68 // thickness
69 out = xget("thickness");
70 assert_checkequal(out, 1);
71 xset("thickness", 5);
72 out = xget("thickness");
73 assert_checkequal(out, 5);
74 // wdim wpdim
75 out = xget("wdim");
76 assert_checkequal(out, f.figure_size);
77 out = xget("wpdim");
78 assert_checkequal(out, f.figure_size);
79 // wpos
80 out = xget("wpos");
81 assert_checkequal(out, f.position([1, 2]));
82 // viewport
83 out = xget("viewport");
84 assert_checkequal(out, f.viewport);
85 // background
86 out = xget("background");
87 assert_checkequal(out, -2);
88 // color foreground pattern
89 out = xget("color");
90 assert_checkequal(out, -1);
91 out = xget("foreground");
92 assert_checkequal(out, -1);
93 out = xget("pattern");
94 assert_checkequal(out, -1);
95 // lastpattern
96 out = xget("lastpattern");
97 assert_checkequal(out, 512);
98 // line mode
99 out = xget("line mode");
100 assert_checkequal(out, 1);
101 // pixmap
102 out = xget("pixmap");
103 assert_checkequal(out, 0);
104 // white
105 out = xget("white");
106 assert_checkequal(out, 514);
107 // wresize
108 out = xget("wresize");
109 assert_checkequal(out, 1);
110 // clipgrf
111 out = xget("clipgrf");
112 assert_checkequal(out, 0);
113 // clipoff
114 out = xget("clipoff");
115 assert_checkequal(out, 1);
116 // clipping => clip_box + clip_state
117 xset("clipping", 1,2,3,4);
118 out = xget("clipping");
119 assert_checkequal(out, [1,2,3,4]);
120 // XSET
121 // wdim
122 xset("wdim",1000,500)
123 assert_checkequal(xget("wdim"), [1000,500]);
124 xset("wdim",[1000,500]) // 500 is ignored here
125 wdim=xget("wdim");
126 assert_checkequal(wdim(1), 1000);
127 ierr = execstr("xset(""colormap"");","errcatch");
128 assert_checkequal(ierr, 999);
129 ierr = execstr("xset(""mark size"");","errcatch");
130 assert_checkequal(ierr, 999);
131 ierr = execstr("xset(""mark"");","errcatch");
132 assert_checkequal(ierr, 999);
133 ierr = execstr("xset(""font size"");","errcatch");
134 assert_checkequal(ierr, 999);
135 ierr = execstr("xset(""line style"");","errcatch");
136 assert_checkequal(ierr, 999);
137 ierr = execstr("xset(""font size"");","errcatch");
138 assert_checkequal(ierr, 999);
139 ierr = execstr("xset(""fpf"");","errcatch");
140 assert_checkequal(ierr, 999);
141 ierr = execstr("xset(""auto clear"");","errcatch");
142 assert_checkequal(ierr, 999);
143 ierr = execstr("xset(""dashes"");","errcatch");
144 assert_checkequal(ierr, 999);
145 ierr = execstr("xset(""hidden3d"");","errcatch");
146 assert_checkequal(ierr, 999);
147 ierr = execstr("xset(""figure"");","errcatch");
148 assert_checkequal(ierr, 999);
149 ierr = execstr("xset(""window"");","errcatch");
150 assert_checkequal(ierr, 999);
151 ierr = execstr("xset(""thickness"");","errcatch");
152 assert_checkequal(ierr, 999);
153 ierr = execstr("xset(""wdim"");","errcatch");
154 assert_checkequal(ierr, 999);
155 ierr = execstr("xset(""wpdim"");","errcatch");
156 assert_checkequal(ierr, 999);
157 ierr = execstr("xset(""wpos"");","errcatch");
158 assert_checkequal(ierr, 999);
159 ierr = execstr("xset(""viewport"");","errcatch");
160 assert_checkequal(ierr, 999);
161 ierr = execstr("xset(""background"");","errcatch");
162 assert_checkequal(ierr, 999);
163 ierr = execstr("xset(""color"");","errcatch");
164 assert_checkequal(ierr, 999);
165 ierr = execstr("xset(""foreground"");","errcatch");
166 assert_checkequal(ierr, 999);
167 ierr = execstr("xset(""pattern"");","errcatch");
168 assert_checkequal(ierr, 999);
169 ierr = execstr("xset(""line mode"");","errcatch");
170 assert_checkequal(ierr, 999);
171 ierr = execstr("xset(""pixmap"");","errcatch");
172 assert_checkequal(ierr, 999);
173 ierr = execstr("xset(""wresize"");","errcatch");
174 assert_checkequal(ierr, 999);
175 ierr = execstr("xset(""default"", ""test"");","errcatch");
176 assert_checkequal(ierr, 999);