GCC Code Coverage Report


Directory: src/gate/
File: src/gate/ui/tests/gateui_cpp_test/gateui_cpp_tests.cpp
Date: 2026-09-21 06:26:40
Exec Total Coverage
Lines: 432 471 91.7%
Functions: 15 23 65.2%
Branches: 491 1002 49.0%

Line Branch Exec Source
1 /* GATE PROJECT LICENSE:
2 +----------------------------------------------------------------------------+
3 | Copyright(c) 2018-2026, Stefan Meislinger |
4 | All rights reserved. |
5 | |
6 | Redistribution and use in source and binary forms, with or without |
7 | modification, are permitted provided that the following conditions are met:|
8 | |
9 | 1. Redistributions of source code must retain the above copyright notice, |
10 | this list of conditions and the following disclaimer. |
11 | 2. Redistributions in binary form must reproduce the above copyright |
12 | notice, this list of conditions and the following disclaimer in the |
13 | documentation and/or other materials provided with the distribution. |
14 | |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"|
16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
18 | ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
25 | THE POSSIBILITY OF SUCH DAMAGE. |
26 +----------------------------------------------------------------------------+
27 */
28
29
30 #include "gate/gatemain.h"
31 #include "gate/results.h"
32
33 #include "gate/applications.hpp"
34 #include "gate/maps.hpp"
35 #include "gate/strings.hpp"
36 #include "gate/streams.hpp"
37 #include "gate/times.hpp"
38 #include "gate/files.hpp"
39 #include "gate/wrappers.hpp"
40 #include "gate/utilities.hpp"
41 #include "gate/numbers.hpp"
42 #include "gate/system/os.hpp"
43 #include "gate/threading.hpp"
44
45 #include "gate/ui/gateui.hpp"
46 #include "gate/ui/forms.hpp"
47 #include "gate/ui/buttons.hpp"
48 #include "gate/ui/labels.hpp"
49 #include "gate/ui/panels.hpp"
50 #include "gate/ui/textboxes.hpp"
51 #include "gate/ui/treeviews.hpp"
52 #include "gate/ui/listviews.hpp"
53 #include "gate/ui/splitters.hpp"
54 #include "gate/ui/paintsurfaces.hpp"
55 #include "gate/ui/dialogs.hpp"
56 #include "gate/ui/toolbars.hpp"
57 #include "gate/ui/statusbars.hpp"
58 #include "gate/ui/checkboxes.hpp"
59 #include "gate/ui/comboboxes.hpp"
60 #include "gate/ui/timers.hpp"
61 #include "gate/ui/spinners.hpp"
62 #include "gate/ui/splitters.hpp"
63 #include "gate/ui/tabs.hpp"
64 #include "gate/ui/dialogs.hpp"
65
66 #include "gate/graphics/pixmapimages.hpp"
67 #include "gate/icons/application.xpm"
68 #include "gate/icons/refresh.xpm"
69 #include "gate/icons/folder.xpm"
70 #include "gate/icons/cut.xpm"
71 #include "gate/icons/copy.xpm"
72 #include "gate/icons/paste.xpm"
73 #include "gate/icons/cancel.xpm"
74
75 #if defined(GATE_COMPILER_MSVC) && defined(GATE_LEAK_DETECTION) && defined(GATE_SYS_WIN) && !defined(GATE_SYS_WINCE) && (GATE_ARCH != GATE_ARCH_ARM32) && (GATE_ARCH != GATE_ARCH_ARM64)
76 # include <vld.h>
77 #endif
78
79 static gate::bool_t run_app_tests = false;
80 static gate::bool_t run_app_tests_no_close = false;
81
82 namespace gate
83 {
84 namespace apps
85 {
86
87 class GATE_API_LOCAL VTest : public App
88 {
89 private:
90 Optional<ui::Host> uihost;
91
92 ui::Form form;
93 ui::Menu menu;
94 ui::Menu menuFile;
95 ui::Menu menuHelp;
96
97 ui::Toolbar tb;
98 ui::Treeview treeview;
99 ui::Listview listview;
100 ui::TabControl tabs;
101 ui::Listbox lstbox;
102 ui::Textbox txtMulti;
103 ui::Statusbar sbStatus;
104
105 ui::Label lbl;
106 ui::Button btn;
107 ui::Textbox txtSimple;
108 ui::Checkbox chk;
109 ui::Itemview iv;
110 ui::Combobox cmb;
111 ui::Progressbar pgb;
112 ui::Spinbox spin;
113 ui::PaintSurface painter;
114 ui::Splitter split;
115 ui::Textbox splitText1;
116 ui::Textbox splitText2;
117
118 ui::FramePanel frame;
119 ui::Button btn2;
120
121 ui::Layout layout;
122
123 ui::Layout tabLayout;
124 ui::Layout tabLayout2;
125 ui::Layout tabLayout2Frame;
126 ui::Layout tabLayoutSplitter;
127
128 ui::Timer testTimer1;
129 gate::enumint_t testState;
130
131 graph::RasterImage imageApplication;
132 graph::RasterImage imageFolder;
133
134 static gate::uint16_t const MenuKey_FileInfo = 0x01;
135 static gate::uint16_t const MenuKey_FileExit = 0x0f;
136 static gate::uint16_t const MenuKey_HelpAbout = 0x91;
137
138 4 graph::RasterImage& getAppImage()
139 {
140
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (this->imageApplication.empty())
141 {
142 1 graph::PixmapImages::parse(this->imageApplication, gate_icon_application_xpm);
143 }
144 4 return this->imageApplication;
145 }
146
147 1 graph::RasterImage& getFolderImage()
148 {
149
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (this->imageFolder.empty())
150 {
151 1 graph::PixmapImages::parse(this->imageFolder, gate_icon_folder_xpm);
152 }
153 1 return this->imageFolder;
154 }
155
156 void commandExit()
157 {
158 this->uihost->quit();
159 }
160
161 void commandHelp()
162 {
163 ui::MessageDialog msg;
164 msg.show(this->form, "Sample message text", "Sample title");
165 }
166
167 void Form_Closed(ui::Form* sender, ui::EventArg* arg)
168 {
169 this->commandExit();
170 }
171
172 1 void btn_Clicked(ui::Button* sender, ui::EventArg* arg)
173 {
174
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String oldText = this->btn.getText();
175
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String txt = this->txtSimple.getText();
176
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (txt != oldText)
177 {
178
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->btn.setText(txt);
179 }
180 1 }
181
182 1 void chk_Clicked(ui::Checkbox* sender, ui::EventArg* arg)
183 {
184
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 static StaticString const checkedText = "Checkbox is checked";
185
2/4
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 static StaticString const uncheckedText = "Checkbox is unchecked";
186
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 bool_t const checked = this->chk.isChecked();
187
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
2 String const newText = checked ? checkedText : uncheckedText;
188
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String oldText = this->chk.getText();
189
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (oldText != newText)
190 {
191
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->chk.setText(newText);
192 }
193 1 }
194
195 void btn2_Clicked(ui::Button* sender, ui::EventArg* arg)
196 {
197 ui::MessageDialog msgDlg;
198 ui::InputDialog inDlg;
199 Optional<String> inputText = inDlg.show(this->form, "Tell me:", "Input Dialog");
200 if(inputText.empty())
201 {
202 msgDlg.show(this->form, "No Input!", "Warning");
203 }
204 else
205 {
206 msgDlg.show(this->form, *inputText, "Your Input:");
207 }
208 }
209
210 void tb_Clicked(ui::Toolbar* sender, ui::Toolbar::ToolbarEventArg* arg)
211 {
212 }
213 2 void treeview_Select(ui::Treeview* sender, ui::Treeview::ItemArg* arg)
214 {
215
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
4 String text = this->treeview.getItemText(arg->Item);
216
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 this->treeview.getItemParam(arg->Item);
217
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 this->sbStatus.setText(text);
218 2 }
219 void listview_Select(ui::Listview* sender, ui::Listview::IndexArg* arg)
220 {
221 String text = this->listview.getItemText(arg->ListIndex);
222 this->listview.getItemParam(arg->ListIndex);
223 this->sbStatus.setText(text);
224 }
225
226 2 void painter_Paint(ui::PaintSurface* sender, ui::PaintSurface::PaintEventArg* arg)
227 {
228
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 arg->Context.rect(arg->DrawRectangle, ui::Color::Blue, 0, ui::Color::Blue);
229 2 int32_t w = arg->DrawRectangle.getWidth();
230 2 int32_t h = arg->DrawRectangle.getHeight();
231 2 int32_t mx = w / 2;
232 2 int32_t my = h / 2;
233
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
4 ArrayList<ui::Point> points;
234 points
235
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 << ui::Point(0, my)
236
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 << ui::Point(mx, 0)
237
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 << ui::Point(w, my)
238
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 << ui::Point(mx, h)
239
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 << ui::Point(0, my)
240 ;
241
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
2 arg->Context.polygon(points.toArray(), ui::Color::Yellow, 2);
242
2/4
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
4 GATEXX_TRY_IGNORE(arg->Context.getPixel(ui::Point(mx, my)));
243
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 arg->Context.setPixel(ui::Point(mx, my), ui::Color::White);
244
1/2
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
2 arg->Context.line(ui::Point(0, my), ui::Point(w, my), ui::Color::Yellow, 2);
245
1/2
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
2 arg->Context.line(ui::Point(mx, 0), ui::Point(mx, h), ui::Color::Yellow, 2);
246
247
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 graph::RasterImage& image = this->getAppImage();
248 {
249
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
4 ui::Graphics imageGraph(*this->uihost, image);
250 2 ui::Graphics virtualGraph(*this->uihost,
251 4 static_cast<uint32_t>(imageGraph.getWidth()),
252
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
2 static_cast<uint32_t>(imageGraph.getHeight()));
253
1/2
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
2 virtualGraph.drawEx(imageGraph);
254
1/2
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
2 arg->Context.draw(imageGraph, ui::Point(mx, my));
255 }
256 {
257
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 ui::Graphics controlGraph(*sender);
258 }
259
260
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 ui::Font font = this->uihost->getDefaultFont(ui::Host::FontType_Standard);
261
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 font.setColor(ui::Color::White);
262
3/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
2 static const StaticString text = "Hello";
263 static const char_32_t c32 = 'A';
264
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 arg->Context.getCharWidths(font, &c32, 1);
265
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 ui::Size sz = arg->Context.getTextSize(font, text);
266 2 ui::Position pos(mx - sz.width, my - sz.height, sz.width, sz.height);
267
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 arg->Context.print(font, text, pos);
268
269 {
270
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
4 ui::Graphics virtualGraph(*this->uihost, image.getWidth(), image.getHeight(), 24);
271
1/2
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
2 virtualGraph.drawImage(image);
272
3/6
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
2 virtualGraph.rect(ui::Position(0, 0, image.getWidth() - 1, image.getHeight() - 1), ui::Color::Red, 2);
273
1/4
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
2 virtualGraph.polygon(points.toArray(), ui::Color::Red, 1, ui::Color::Yellow);
274 }
275 }
276
277 void handleMenuAction(gate_uint16_t menuid)
278 {
279 if (menuid == MenuKey_FileExit) { this->commandExit(); }
280 else if (menuid == MenuKey_FileInfo) { this->commandHelp(); }
281 else if (menuid == MenuKey_HelpAbout) { this->commandHelp(); }
282 }
283
284 void Form_Menu(ui::Form* sender, ui::MenuArg* arg)
285 {
286 this->handleMenuAction(arg->MenuEntry.id);
287 }
288
289 3 void useControlProperties(ui::Control& ctrl)
290 {
291
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 if (ctrl.isCreated())
292 {
293
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 ui::Position pos = ctrl.getPosition();
294
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 ui::Size sz = ctrl.getSize();
295
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 ctrl.setPosition(pos);
296
297
2/4
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
3 ctrl.setEnabled(ctrl.isEnabled());
298
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 ctrl.isVisible();
299
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 ctrl.setVisible(true);
300
2/4
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
3 if (ctrl.isFocused())
301 {
302 ctrl.setFocus();
303 }
304 }
305 3 }
306
307 1 static void asyncCallback()
308 {
309 1 ThisThread::sleep(1);
310 1 }
311
312 5 void timer1_Elapsed(ui::Timer* sender, ui::Timer::TimerArg* arg)
313 {
314 5 gate::enumint_t const state = ++this->testState;
315
316
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
5 if (state == 1)
317 {
318
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 useControlProperties(this->txtSimple);
319
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 useControlProperties(this->btn);
320
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 useControlProperties(this->chk);
321
322
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->txtSimple.setText("Hello");
323
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String lblText = this->lbl.getText();
324
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->lbl.setText(lblText);
325
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->lbl.performAction(ui::Label::Action_Activate);
326
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->btn.performAction(ui::Button::Action_Activate);
327
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->txtMulti.setText("Hello World");
328
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->txtMulti.getLineCount();
329
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->txtMulti.getCurrentColumn();
330
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->txtMulti.getCurrentLine();
331
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->txtMulti.setSelection(2, 5);
332 1 gate_uint32_t l = 0, r = 0;
333
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->txtMulti.getSelection(l, r);
334
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->txtMulti.getSelectionText();
335
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->txtMulti.replaceSelection("110_");
336
337 {
338 uint32_t mini, maxi;
339
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 mini = this->pgb.getMinimum();
340
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 maxi = this->pgb.getMaximum();
341
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->pgb.getMinMax(mini, maxi);
342
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->pgb.getValue();
343
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->pgb.setValue((mini + maxi) / 2);
344
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->pgb.setPercent(50.0f);
345 }
346
347 {
348
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->chk.setChecked(!this->chk.isChecked());
349
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->chk.performAction(ui::Checkbox::Action_Activate);
350 }
351
352 {
353
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 size_t const cnt = this->cmb.getItemCount();
354
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.setSelectedItem(cnt - 1);
355 1 gate_size_t selIndex = 0;
356 2 String selText;
357 1 void* selParam = NULL;
358 1 this->cmb.getSelectedItem(&selIndex, &selText, &selParam);
359
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 selParam = this->cmb.getItemParam(selIndex);
360
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 selText = this->cmb.getItemText(selIndex);
361
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String const newText = selText + "!";
362
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.setItemText(selIndex, newText);
363
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.setSelectedItem(cnt - 1);
364
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.performAction(ui::Combobox::Action_Activate);
365
366 1 gate_size_t foundIndex = 0;
367
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.findItemParam(selParam, foundIndex);
368 }
369
370 {
371
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 gate_size_t index = this->lstbox.getItemCount();
372
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->lstbox.setSelectedItem(1);
373
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->lstbox.getSelectedItem(index);
374
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String const text = this->lstbox.getItemText(index);
375
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String const newText = text + "!";
376
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->lstbox.setItemText(index, newText);
377
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 void* const param = this->lstbox.getItemParam(index);
378
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->lstbox.findItemParam(param);
379 }
380
381 {
382
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 if (this->listview.getItemCount() > 0)
383 {
384 1 size_t ndx = 0;
385
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.setItemSelected(ndx, true);
386
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.getSelectedItem(ndx);
387
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String oldText = this->listview.getItemText(ndx, 1);
388
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 String newText = oldText + "!";
389
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.setItemText(ndx, newText, 1);
390
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.getSelectedItems();
391
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.setItemChecked(ndx, false);
392
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.getCheckedItems();
393
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 void* param = this->listview.getItemParam(ndx);
394
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.findItemParam(param);
395
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->listview.insertItem(0, "Prequel");
396 }
397 }
398
399 {
400
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.setFocus();
401
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 Array<ui::Treeview::item_t> children = this->treeview.getItemChildren(0);
402
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 for(size_t ndx = 0; ndx != children.length(); ++ndx)
403 {
404 1 ui::Treeview::item_t parent = 0;
405 1 ui::Treeview::item_t child = children[ndx];
406
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String oldText = this->treeview.getItemText(child);
407
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 String newText = oldText + "!";
408
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.setItemText(child, newText);
409
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.getItemParam(child);
410
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.getParentItem(child, parent);
411
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.isItemExpanded(child);
412
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.selectItem(child);
413
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.getSelectedItem(child);
414
415
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.performAction(ui::Treeview::Action_Activate);
416
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.performAction(ui::Treeview::Action_ContextMenu);
417 }
418 }
419
420 {
421
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->iv.setFocus();
422
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 size_t cnt = this->iv.getItemCount();
423
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 times.
3 for (size_t ndx = 0; ndx != cnt; ++ndx)
424 {
425
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 this->iv.getItemTitle(ndx);
426
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 this->iv.getItemSubtitle(ndx);
427
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 this->iv.getItemAddiontialText(ndx);
428
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 void* param = this->iv.getItemParam(ndx);
429
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 gate::size_t index = this->iv.findItemParam(param);
430 }
431 }
432
433
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->form.refresh();
434 }
435
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
4 else if (state == 2)
436 {
437 1 size_t const tabCount = this->tabs.getTabCount();
438
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 if (tabCount > 0)
439 {
440 1 this->tabs.setSelected(0);
441
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 times.
6 for (size_t ndx = 0; ndx != tabCount; ++ndx)
442 {
443
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
10 String oldText = this->tabs.getTabText(ndx);
444
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
10 String newText = oldText + "!";
445
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 this->tabs.setTabText(ndx, newText);
446 }
447 1 size_t selected = this->tabs.getSelected();
448
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 if (selected < tabCount)
449 {
450 1 this->tabs.setSelected(selected + 1);
451 }
452 }
453 }
454
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 2 times.
3 else if (state == 3)
455 {
456 1 this->tabs.setSelected(3);
457 1 this->painter.redraw();
458 }
459
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
2 else if (state == 4)
460 {
461
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->painter.performAction(ui::PaintSurface::Action_Activate);
462
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->painter.performAction(ui::PaintSurface::Action_ContextMenu);
463
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->painter.performAction(ui::PaintSurface::Action_KeyPress, 13); // send enter key
464
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 Runnable asyncFunc = RunnableFunction::create(&asyncCallback);
465
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->uihost->execute(asyncFunc);
466
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->uihost->processEvents();
467 }
468 else
469 {
470 1 sender->stop();
471
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 if (!run_app_tests_no_close)
472 {
473 1 this->uihost->quit();
474 }
475 }
476 5 }
477
478 public:
479 1 VTest()
480
33/66
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 1 times.
✗ Branch 25 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 42 taken 1 times.
✗ Branch 43 not taken.
✓ Branch 45 taken 1 times.
✗ Branch 46 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 54 taken 1 times.
✗ Branch 55 not taken.
✓ Branch 57 taken 1 times.
✗ Branch 58 not taken.
✓ Branch 60 taken 1 times.
✗ Branch 61 not taken.
✓ Branch 63 taken 1 times.
✗ Branch 64 not taken.
✓ Branch 66 taken 1 times.
✗ Branch 67 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 72 taken 1 times.
✗ Branch 73 not taken.
✓ Branch 75 taken 1 times.
✗ Branch 76 not taken.
✓ Branch 78 taken 1 times.
✗ Branch 79 not taken.
✓ Branch 81 taken 1 times.
✗ Branch 82 not taken.
✓ Branch 84 taken 1 times.
✗ Branch 85 not taken.
✓ Branch 87 taken 1 times.
✗ Branch 88 not taken.
✓ Branch 90 taken 1 times.
✗ Branch 91 not taken.
✓ Branch 93 taken 1 times.
✗ Branch 94 not taken.
✓ Branch 96 taken 1 times.
✗ Branch 97 not taken.
✓ Branch 99 taken 1 times.
✗ Branch 100 not taken.
1 : testState(0)
481 {
482
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 menuFile.add("Info", MenuKey_FileInfo);
483
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 menuFile.addSeparator();
484
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 menuFile.add("Exit", MenuKey_FileExit);
485
486
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 menuHelp.add("About", MenuKey_HelpAbout);
487
488
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 menu.add("File", 0, 0, &menuFile);
489
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 menu.add("Help", 0, 0, &menuHelp);
490
491
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->form.MenuEvent += ui::Form::MenuEventHandler(this, &VTest::Form_Menu);
492
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->btn.ClickEvent += ui::Button::ClickEventHandler(this, &VTest::btn_Clicked);
493
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->chk.ClickEvent += ui::Checkbox::ClickEventHandler(this, &VTest::chk_Clicked);
494
495
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->btn2.ClickEvent += ui::Button::ClickEventHandler(this, &VTest::btn2_Clicked);
496
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->tb.ClickEvent += ui::Toolbar::ClickEventHandler(this, &VTest::tb_Clicked);
497
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->treeview.SelectEvent += ui::Treeview::SelectEventHandler(this, &VTest::treeview_Select);
498
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->listview.SelectEvent += ui::Listview::SelectEventHandler(this, &VTest::listview_Select);
499
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->painter.PaintEvent += ui::PaintSurface::PaintEventHandler(this, &VTest::painter_Paint);
500
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->testTimer1.IntervalEvent += ui::Timer::IntervalEventHandler(this, &VTest::timer1_Elapsed);
501 1 }
502 2 ~VTest() noexcept
503 2 {
504 2 }
505
506 1 virtual void onInit()
507 {
508
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->uihost.emplace<uintptr_t const>(this->getHandle());
509
510
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 const int32_t pixels = this->uihost->getPixelsOfPoints(10.0f);
511
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 const real32_t points = this->uihost->getPointsOfPixels(pixels);
512
513
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.clear();
514
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setBorder(1);
515
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setRowSpace(3);
516
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setColumnSpace(3);
517
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t colLeft = this->layout.addColumn(ui::Layout::Type_UnitScale, 8.0f);
518
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setColumn(colLeft, ui::Layout::Type_UnitScale, 8.0f);
519
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t colMid = this->layout.addColumn();
520
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t colRight = this->layout.addColumn(ui::Layout::Type_Percent, 25.0f);
521
522
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t rowTop = this->layout.addRow(ui::Layout::Type_UnitScale, 2.0f);
523
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setRow(rowTop, ui::Layout::Type_UnitScale, 2.0f);
524
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t rowData1 = this->layout.addRow();
525
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t rowData2 = this->layout.addRow();
526
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t rowBottom = this->layout.addRow(ui::Layout::Type_UnitScale, 1.0f);
527
528
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setControl(this->tb, rowTop, colLeft, 1, 3);
529 {
530 uint32_t rowTest, colTest;
531
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.findControl(this->tb, rowTest, colTest);
532 }
533
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setControl(this->treeview, rowData1, colLeft);
534
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setControl(this->listview, rowData2, colLeft);
535
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setControl(this->tabs, rowData1, colMid, 2, 1);
536
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setControl(this->lstbox, rowData1, colRight);
537
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setControl(this->txtMulti, rowData2, colRight);
538
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setControl(this->sbStatus, rowBottom, colLeft, 1, 3);
539
540
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->form.CloseEvent += ui::Form::CloseEventHandler(this, &VTest::Form_Closed);
541
542
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->form.create(*this->uihost, NULL, String::createStaticFrom("vTest"),
543 1 ui::Form::Flag_Enabled | ui::Form::Flag_Resizable | ui::Form::Flag_Maximizable | ui::Form::Flag_Minimizable
544 //| ui::Form::Flag_Visible
545 );
546
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->form.setMenu(&this->menu);
547
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 ui::Host::getHost(this->form);
548
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 const String formText = this->form.getText();
549
550
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->uihost->getLineHeight();
551
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->uihost->getControlHeight();
552
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->uihost->getUnitLength();
553
554 1 ui::Position stdPos(10, 10, 10, 10);
555
556
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tb.create(this->form, stdPos);
557 {
558
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 ui::RasterImage& image = this->getAppImage();
559
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tb.add(image, NULL);
560
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tb.addSeparator();
561
562
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const int32_t pixels = this->tb.getIdealHeight();
563
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 if (pixels > 0)
564 {
565 1 uint32_t rowTb = 0, colTb = 0;
566
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 if (this->layout.findControl(this->tb, rowTb, colTb))
567 {
568
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->layout.setRow(rowTb, ui::Layout::Type_Pixel, static_cast<real32_t>(pixels));
569 }
570 }
571 }
572
573
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->sbStatus.create(this->form, ui::Position(10, 10, 10, 10), "StatusBAR");
574
575
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->txtMulti.create(this->form, stdPos, "Hello" GATE_STR_NEWLINE "world",
576
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 ui::Textbox::Flag_Enabled | ui::Textbox::Flag_Visible | ui::Textbox::Flag_Multiline);
577
578 {
579
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->lstbox.create(this->form, stdPos);
580
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->lstbox.removeAllItems();
581
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->lstbox.addItem("Hello");
582
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->lstbox.addItem("World");
583
2/2
✓ Branch 0 taken 25 times.
✓ Branch 1 taken 1 times.
26 for (uint32_t n = 0; n < 25; ++n)
584 {
585
3/6
✓ Branch 1 taken 25 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 25 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 25 times.
✗ Branch 8 not taken.
25 this->lstbox.addItem("Entry #" + numbers::to_string(n));
586 }
587
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 times.
6 for (uint32_t n = 0; n < 5; ++n)
588 {
589
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 size_t count = this->lstbox.getItemCount();
590
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 this->lstbox.removeItem(count - 1);
591 }
592 }
593
594 {
595
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.create(this->form,
596 ui::Position(10, 10, 10, 10),
597 1 gate::ui::Treeview::Flag_Visible | gate::ui::Treeview::Flag_Enabled | gate::ui::Treeview::Flag_Icons
598 );
599
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 graph::RasterImage& folderImage = this->getFolderImage();
600
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 intptr_t folderIconIndex = this->treeview.addIcon(folderImage);
601
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 ui::Treeview::item_t root = this->treeview.addItem(NULL, "MyRoot", NULL, folderIconIndex);
602
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->treeview.addItem(&root, "Sub1");
603
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->treeview.addItem(&root, "Sub2");
604
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 ui::Treeview::item_t s3 = this->treeview.addItem(&root, "Sub3");
605
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.removeItem(s3);
606
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.collapseItem(root);
607
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->treeview.expandItem(root);
608 }
609
610 {
611
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.create(this->form,
612 ui::Position(10, 10, 10, 10),
613 1 gate::ui::Listview::Flag_Visible | gate::ui::Listview::Flag_Enabled | gate::ui::Listview::Flag_Icons
614 );
615
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.removeAllItems();
616
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 ui::RasterImage& appImage = this->getAppImage();
617
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 gate::intptr_t appIconIndex = this->listview.addIcon(appImage);
618
619
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 ArrayList<ui::Listview::Column> cols;
620
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
1 cols.add(ui::Listview::Column("First", 60));
621
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
1 cols.add(ui::Listview::Column("Second", 100));
622
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
1 cols.add(ui::Listview::Column("Third", 200));
623
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->listview.setColumns(cols.toArray());
624
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.beginTransaction();
625
2/2
✓ Branch 0 taken 25 times.
✓ Branch 1 taken 1 times.
26 for (uint32_t n = 0; n < 25; ++n)
626 {
627 25 void* param = reinterpret_cast<void*>(static_cast<uintptr_t>(n));
628
2/2
✓ Branch 0 taken 13 times.
✓ Branch 1 taken 12 times.
25 intptr_t const iconIndex = (n % 2 == 0) ? appIconIndex : gate::ui::Listview::InvalidIcon;
629
3/6
✓ Branch 1 taken 25 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 25 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 25 times.
✗ Branch 8 not taken.
25 size_t const index = this->listview.addItem("Entry #" + numbers::to_string(n), param, iconIndex);
630
3/6
✓ Branch 1 taken 25 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 25 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 25 times.
✗ Branch 8 not taken.
25 this->listview.setItemText(index, "SubItem " + numbers::to_string(n), 1);
631 }
632
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.endTransaction();
633
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 size_t cntCols = this->listview.getColumnCount();
634
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
4 for (size_t n = 0; n != cntCols; ++n)
635 {
636 6 String text;
637 3 uint32_t width = 0;
638
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 this->listview.getColumn(n, text, width);
639 }
640
641
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.setItemSelected(0, true);
642
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->listview.isItemSelected(0);
643
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 1 times.
6 for (uint32_t n = 0; n < 5; ++n)
644 {
645
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 size_t count = this->listview.getItemCount();
646
1/2
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
5 this->listview.removeItem(count - 1);
647 }
648 }
649
650 {
651
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->tabs.create(this->form, ui::Position(10, 10, 10, 10));
652
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->tabs.addTab("Tab1");
653
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->tabs.addTab("Tab2");
654
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->tabs.addTab("Tab3");
655
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->tabs.addTab("Tab4");
656
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->tabs.addTab("Tab5");
657
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->tabs.removeTab(this->tabs.getTabCount() - 1);
658
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->tabs.addTab("Tab5");
659 }
660
661 {
662
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 ui::TabPanel panel1 = this->tabs.getTabPanel(0);
663
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->lbl.create(panel1, ui::Position(0, 0, 128, 28), "Label");
664
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->chk.create(panel1, ui::Position(0, 32, 128, 32), "CheckMe", true);
665
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->iv.create(panel1, ui::Position(0, 70, 128, 256));
666
4/8
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
1 this->iv.addItem("Hello", "World", "from Me");
667
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->iv.removeAllItems();
668
4/8
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
1 gate::size_t ndx1 = this->iv.addItem("Hello", "World", "from Me", ui::Itemview::InvalidIcon, (void*)111);
669
4/8
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
1 gate::size_t ndx2 = this->iv.addItem("This", "is a", "test", ui::Itemview::InvalidIcon, (void*)222);
670
4/8
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
1 gate::size_t ndx3 = this->iv.addItem("To", "be", "removed");
671
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->iv.setItemTitle(ndx3, "TO");
672
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->iv.setItemSubtitle(ndx3, "BE");
673
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 this->iv.setItemAdditionalText(ndx3, "DELETED");
674
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->iv.removeItem(ndx3);
675
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->iv.setItemSelected(ndx2);
676 1 gate::size_t selIndex = 10;
677
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 if(this->iv.getSelectedItem(selIndex))
678 {
679
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->iv.isItemSelected(selIndex);
680 }
681 }
682
683 {
684
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 ui::TabPanel panel2 = this->tabs.getTabPanel(1);
685
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout.clear();
686
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t tabLeft = this->tabLayout.addColumn();
687
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t tabRight = this->tabLayout.addColumn();
688
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 uint32_t tabTop = this->tabLayout.addRow(ui::Layout::Type_UnitScale, 1.0f);
689
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout.setControl(this->txtSimple, tabTop, tabLeft);
690
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout.setControl(this->btn, tabTop, tabRight);
691
692
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->btn.create(panel2, ui::Position(0, 0, 120, 28), "PushButton");
693
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->txtSimple.create(panel2, ui::Position(0, 32, 120, 32), "TextField");
694
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 panel2.setLayout(&this->tabLayout);
695 }
696
697 {
698
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 ui::TabPanel panel3 = this->tabs.getTabPanel(2);
699 {
700
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabs.getTabParam(2);
701
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 ui::TabPanel panel3Copy(panel3);
702 }
703
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2.clear();
704
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2.addColumn();
705
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2.addRow();
706
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2.setControl(this->frame, 0, 0);
707
708
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->frame.create(panel3, ui::Position(0, 0, 140, 96), "Frame");
709
710
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->btn2.create(this->frame, ui::Position(0, 0, 120, 64), "Test Input Dialog");
711
712 {
713
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->cmb.create(this->frame, ui::Position(0, 64, 128, 32));
714 //this->cmb.removeAllItems();
715
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.removeAllItems();
716
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 size_t index1 = this->cmb.addItem("entry_1");
717
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 size_t index2 = this->cmb.addItem("entry_2");
718
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 size_t index3 = this->cmb.addItem("entry_3");
719
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.getItemParam(index2);
720
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.removeItem(index3);
721
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.setSelectedItem(index1);
722
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->cmb.getSelectedIndex();
723 }
724
725 {
726
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->pgb.create(this->frame, ui::Position(0, 100, 128, 24));
727
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->pgb.setMinMax(0, 100);
728
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->pgb.setValue(75);
729
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->pgb.setValue(33);
730 }
731
732 {
733
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->spin.create(this->frame, ui::Position(0, 130, 128, 24));
734
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->spin.setMinimum(0);
735
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->spin.setMaximum(32);
736
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 gate::int64_t spinMin = this->spin.getMinimum();
737
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 gate::int64_t spinMax = this->spin.getMaximum();
738
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->spin.setMinMax(spinMin, spinMax);
739 gate::int64_t a, b;
740
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->spin.getMinMax(a, b);
741
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->spin.setValue(16);
742
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 gate::int64_t v = this->spin.getValue();
743 }
744
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 panel3.setLayout(&this->tabLayout2);
745
746 {
747
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2Frame.clear();
748
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const size_t c = this->tabLayout2Frame.addColumn();
749
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const size_t r1 = this->tabLayout2Frame.addRow(ui::Layout::Type_UnitScale, 1.5);
750
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2Frame.addRow(ui::Layout::Type_UnitScale, 0.5);
751
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const size_t r2 = this->tabLayout2Frame.addRow(ui::Layout::Type_UnitScale, 1.5);
752
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2Frame.addRow(ui::Layout::Type_UnitScale, 0.5);
753
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const size_t r3 = this->tabLayout2Frame.addRow(ui::Layout::Type_UnitScale, 1.5);
754
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2Frame.addRow(ui::Layout::Type_UnitScale, 0.5);
755
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const size_t r4 = this->tabLayout2Frame.addRow(ui::Layout::Type_UnitScale, 1.5);
756
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2Frame.setControl(this->btn2, r1, c);
757
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2Frame.setControl(this->cmb, r2, c);
758
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2Frame.setControl(this->pgb, r3, c);
759
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayout2Frame.setControl(this->spin, r4, c);
760
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->frame.setLayout(&this->tabLayout2Frame);
761 }
762 }
763
764 {
765
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 ui::TabPanel panel3 = this->tabs.getTabPanel(3);
766
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->painter.create(panel3, ui::Position(0, 0, 160, 120));
767
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 ui::Cursor cur(*this->uihost, ui::Cursor::StockId_Busy);
768
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 ui::Cursor cur2(cur);
769
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->painter.setCursor(cur2);
770 }
771
772 {
773
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 ui::TabPanel panel4 = this->tabs.getTabPanel(4);
774
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 this->split.create(panel4, ui::Position(0, 0, 200, 200));
775
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->split.setMinimum(32);
776
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->splitText1.create(this->split, ui::Position(0, 0, 200, 200), "Text1");
777
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 this->splitText2.create(this->split, ui::Position(0, 0, 200, 200), "Text2");
778
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->split.setFirst(this->splitText1);
779
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->split.setSecond(this->splitText2);
780
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayoutSplitter.clear();
781
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const uint32_t c = this->tabLayoutSplitter.addColumn();
782
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const uint32_t r = this->tabLayoutSplitter.addRow();
783
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->tabLayoutSplitter.setControl(this->split, r, c);
784
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 panel4.setLayout(&this->tabLayoutSplitter);
785
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 ui::Control* ptrParent = this->splitText1.getParent();
786
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 const uint32_t txtLen = this->splitText1.getTextLength();
787 }
788
789
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->form.setLayout(&this->layout);
790
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->form.setVisible(true);
791
792
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->form.getChildren();
793
794
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 if(run_app_tests)
795 {
796
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->testTimer1.isStarted();
797
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->testTimer1.create(this->form);
798
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->testTimer1.start(1000);
799
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 this->testTimer1.isStarted();
800 }
801 1 }
802
803 1 void onUninit()
804 {
805
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if(this->testTimer1.isCreated())
806 {
807 1 this->testTimer1.destroy();
808 }
809 1 this->tabs.clear();
810 1 this->form.destroy();
811 1 this->uihost.reset();
812 1 }
813
814 1 virtual void run()
815 {
816 1 this->uihost->run();
817 1 this->onUninit();
818 1 }
819 };
820
821 } // end of namespace apps
822 } // end of namespace gate
823
824 1 int gate_main(char const* program, char const* const* arguments, gate_size_t argcount, gate_uintptr_t apphandle)
825 {
826
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 gate::apps::VTest vtest;
827
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 if (argcount > 0)
828 {
829
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 if (0 == gate_str_comp_ic(arguments[0], "--runtests"))
830 {
831 1 run_app_tests = true;
832 }
833
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (argcount > 1)
834 {
835 if (0 == gate_str_comp_ic(arguments[1], "--noclose"))
836 {
837 run_app_tests_no_close = true;
838 }
839 }
840 }
841
842
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 int exitcode = gate::App::runApp(vtest, program, arguments, argcount, apphandle);
843 2 return exitcode;
844 }
845