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/
5TestCase := 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
20auto handle = TestCase::create();
21const TestCase &instance = *handle;
22assert_eq(instance.get_empty_width(), 0);
23assert_eq(instance.get_empty_height(), 0);
24assert_eq(instance.get_cat_width(), 320);
25assert_eq(instance.get_cat_height(), 480);
26```
27
28
29```rust
30let instance = TestCase::new().unwrap();
31assert_eq!(instance.get_empty_width(), 0);
32assert_eq!(instance.get_empty_height(), 0);
33assert_eq!(instance.get_cat_width(), 320);
34assert_eq!(instance.get_cat_height(), 480);
35```
36
37```js
38var instance = new slint.TestCase();
39assert.equal(instance.empty_width, 0);
40assert.equal(instance.empty_height, 0);
41assert.equal(instance.cat_width, 320);
42assert.equal(instance.cat_height, 480);
43```
44
45*/
46