1 | #![allow (deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/expr"# ] |
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 | TestCase := Rectangle { |
6 | property <bool> verify: |
7 | sin(0) == 0 && |
8 | cos(0) == 1 && |
9 | round(1000* cos(360deg)) == 1000 && round(1000*sin(360deg)) == 0 && |
10 | round(1000* sin(180deg)) == 0 && round(1000*cos(180deg)) == -1000 && |
11 | round(1000 * sin(90deg)) == 1000 && round(1000*cos(90deg)) == 0 && |
12 | round(atan(tan(45deg))/0.1deg) == 450 && |
13 | round(asin(sin(45deg))/0.1deg) == 450 && |
14 | round(acos(cos(45deg))/0.1deg) == 450 && |
15 | true; |
16 | property <bool> test: verify; |
17 | } |
18 | /* |
19 | ```cpp |
20 | auto handle = TestCase::create(); |
21 | const TestCase &instance = *handle; |
22 | assert(instance.get_verify()); |
23 | ``` |
24 | |
25 | |
26 | ```rust |
27 | let instance = TestCase::new().unwrap(); |
28 | assert!(instance.get_verify()); |
29 | ``` |
30 | |
31 | ```js |
32 | var instance = new slint.TestCase({}); |
33 | assert(instance.verify); |
34 | ``` |
35 | */ |
36 | } |
37 | |
38 | #[test ] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> { |
39 | use i_slint_backend_testing as slint_testing; |
40 | slint_testing::init(); |
41 | let instance = TestCase::new().unwrap(); |
42 | assert!(instance.get_verify()); |
43 | Ok(()) |
44 | } |