1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/crashes"#]
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
5// Test for issue #781
6
7global Glop := {
8 property <int> r;
9}
10
11SubSubCompo := Rectangle {
12 property <int> val;
13 TouchArea {
14 clicked => { Glop.r = val; }
15 }
16}
17SubCompo := SubSubCompo { }
18
19export TestCase := Window {
20 width: 300px;
21 height: 300px;
22 HorizontalLayout {
23 SubCompo { val: 88; }
24 SubCompo { val: 99; }
25 }
26
27 property <int> result: Glop.r;
28}
29
30/*
31```cpp
32auto handle = TestCase::create();
33const TestCase &instance = *handle;
34slint_testing::send_mouse_click(&instance, 295., 295.);
35assert_eq(instance.get_result(), 99);
36```
37
38```rust
39let instance = TestCase::new().unwrap();
40slint_testing::send_mouse_click(&instance, 295., 295.);
41assert_eq!(instance.get_result(), 99);
42```
43
44*/
45}
46
47#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
48 use i_slint_backend_testing as slint_testing;
49 slint_testing::init();
50 let instance = TestCase::new().unwrap();
51 slint_testing::send_mouse_click(&instance, x:295., y:295.);
52 assert_eq!(instance.get_result(), 99);
53 Ok(())
54}