mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
43 lines
1.2 KiB
Text
43 lines
1.2 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
TestCase := Rectangle {
|
|
property <bool> verify:
|
|
sin(0) == 0 &&
|
|
cos(0) == 1 &&
|
|
round(1000* cos(360deg)) == 1000 && round(1000*sin(360deg)) == 0 &&
|
|
round(1000* sin(180deg)) == 0 && round(1000*cos(180deg)) == -1000 &&
|
|
round(1000 * sin(90deg)) == 1000 && round(1000*cos(90deg)) == 0 &&
|
|
round(atan(tan(45deg))/0.1deg) == 450 &&
|
|
round(asin(sin(45deg))/0.1deg) == 450 &&
|
|
round(acos(cos(45deg))/0.1deg) == 450 &&
|
|
atan2(0, 0) == 0 &&
|
|
atan2(0, 10) == 0deg &&
|
|
atan2(10, 10) == 45deg &&
|
|
atan2(10, 0) == 90deg &&
|
|
atan2(10, -10) == 135deg &&
|
|
atan2(0, -10) == 180deg &&
|
|
atan2(-10, -10) == -135deg &&
|
|
atan2(-10, 0) == -90deg &&
|
|
atan2(-10, 10) == -45deg &&
|
|
true;
|
|
property <bool> test: verify;
|
|
}
|
|
/*
|
|
```cpp
|
|
auto handle = TestCase::create();
|
|
const TestCase &instance = *handle;
|
|
assert(instance.get_verify());
|
|
```
|
|
|
|
|
|
```rust
|
|
let instance = TestCase::new().unwrap();
|
|
assert!(instance.get_verify());
|
|
```
|
|
|
|
```js
|
|
var instance = new slint.TestCase({});
|
|
assert(instance.verify);
|
|
```
|
|
*/
|