1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/bindings"#]
2// Copyright © SixtyFPS GmbH <info@slint.dev>
3// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
4
5SubElem := Rectangle {
6 property <int> value: 55;
7 callback change();
8 change => { value += 44; }
9}
10
11TestCase := Rectangle {
12 callback change();
13 change => { sub.change(); sub2.change(); }
14 property <int> toplevel: sub.value + sub2.value;
15 sub := SubElem { }
16 sub2 := SubElem { value : 1; }
17}
18
19
20/*
21
22```rust
23let instance = TestCase::new().unwrap();
24assert_eq!(instance.get_toplevel(), 56);
25instance.invoke_change();
26assert_eq!(instance.get_toplevel(), 56+44+44);
27```
28
29
30```cpp
31auto handle = TestCase::create();
32const TestCase &instance = *handle;
33assert_eq(instance.get_toplevel(), 56);
34instance.invoke_change();
35assert_eq(instance.get_toplevel(), 56+44+44);
36```
37
38```js
39var instance = new slint.TestCase({});
40assert.equal(instance.toplevel, 56);
41instance.change();
42assert.equal(instance.toplevel, 56+44+44);
43```
44
45*/
46}
47
48#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
49 use i_slint_backend_testing as slint_testing;
50 slint_testing::init();
51 let instance = TestCase::new().unwrap();
52 assert_eq!(instance.get_toplevel(), 56);
53 instance.invoke_change();
54 assert_eq!(instance.get_toplevel(), 56+44+44);
55 Ok(())
56}