1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/types/../../../examples/printerdemo/ui/images/"#]
2#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/types"#]
3// Copyright © SixtyFPS GmbH <info@slint.dev>
4// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
5
6//include_path: ../../../examples/printerdemo/ui/images/
7TestCase := Rectangle {
8 property <image> empty_image: @image-url("");
9 property <image> cat: @image-url("cat.jpg");
10
11 property <int> empty_width: empty_image.width;
12 property <int> empty_height: empty_image.height;
13 property <int> cat_width: cat.width;
14 property <int> cat_height: cat.height;
15
16 property <bool> test: empty_width == 0 && empty_height == 0 && cat_width == 320 && cat_height == 480;
17}
18
19/*
20
21```cpp
22auto handle = TestCase::create();
23const TestCase &instance = *handle;
24assert_eq(instance.get_empty_width(), 0);
25assert_eq(instance.get_empty_height(), 0);
26assert_eq(instance.get_cat_width(), 320);
27assert_eq(instance.get_cat_height(), 480);
28```
29
30
31```rust
32let instance = TestCase::new().unwrap();
33assert_eq!(instance.get_empty_width(), 0);
34assert_eq!(instance.get_empty_height(), 0);
35assert_eq!(instance.get_cat_width(), 320);
36assert_eq!(instance.get_cat_height(), 480);
37```
38
39```js
40var instance = new slint.TestCase();
41assert.equal(instance.empty_width, 0);
42assert.equal(instance.empty_height, 0);
43assert.equal(instance.cat_width, 320);
44assert.equal(instance.cat_height, 480);
45```
46
47*/
48}
49
50#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
51 use i_slint_backend_testing as slint_testing;
52 slint_testing::init();
53 let instance = TestCase::new().unwrap();
54 assert_eq!(instance.get_empty_width(), 0);
55 assert_eq!(instance.get_empty_height(), 0);
56 assert_eq!(instance.get_cat_width(), 320);
57 assert_eq!(instance.get_cat_height(), 480);
58 Ok(())
59}