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
5TestCase := Window {
6 property <int> t_: 8;
7 property <int> t_old: -1;
8 background: {
9 if (t_ == 8) { t_old = t_; t_=1; }
10 t_ == 1 ? white : black
11 }
12
13 property <bool> test: background == Colors.white && t_ == 1 && t_old == 8;
14}
15
16/*
17```cpp
18auto handle = TestCase::create();
19const TestCase &instance = *handle;
20assert(instance.get_test());
21```
22
23```rust
24let instance = TestCase::new().unwrap();
25assert!(instance.get_test());
26
27```
28
29```js
30var instance = new slint.TestCase({});
31assert(instance.test);
32```
33*/
34
35
36
37}
38
39#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
40 use i_slint_backend_testing as slint_testing;
41 slint_testing::init();
42 let instance = TestCase::new().unwrap();
43 assert!(instance.get_test());
44
45 Ok(())
46}