1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
3 | |
4 | //include_path: ../../../examples/printerdemo/ui/images/ |
5 | TestCase := Rectangle { |
6 | property <image> empty_image: @image-url("" ); |
7 | property <image> cat: @image-url("cat.jpg" ); |
8 | |
9 | property <int> empty_width: empty_image.width; |
10 | property <int> empty_height: empty_image.height; |
11 | property <int> cat_width: cat.width; |
12 | property <int> cat_height: cat.height; |
13 | |
14 | property <bool> test: empty_width == 0 && empty_height == 0 && cat_width == 320 && cat_height == 480; |
15 | } |
16 | |
17 | /* |
18 | |
19 | ```cpp |
20 | auto handle = TestCase::create(); |
21 | const TestCase &instance = *handle; |
22 | assert_eq(instance.get_empty_width(), 0); |
23 | assert_eq(instance.get_empty_height(), 0); |
24 | assert_eq(instance.get_cat_width(), 320); |
25 | assert_eq(instance.get_cat_height(), 480); |
26 | ``` |
27 | |
28 | |
29 | ```rust |
30 | let instance = TestCase::new().unwrap(); |
31 | assert_eq!(instance.get_empty_width(), 0); |
32 | assert_eq!(instance.get_empty_height(), 0); |
33 | assert_eq!(instance.get_cat_width(), 320); |
34 | assert_eq!(instance.get_cat_height(), 480); |
35 | ``` |
36 | |
37 | ```js |
38 | var instance = new slint.TestCase(); |
39 | assert.equal(instance.empty_width, 0); |
40 | assert.equal(instance.empty_height, 0); |
41 | assert.equal(instance.cat_width, 320); |
42 | assert.equal(instance.cat_height, 480); |
43 | ``` |
44 | |
45 | */ |
46 | |