test-crates/cffi-pure/test_cffi_pure.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | import cffi_pure |
| 4 | |
| 5 | |
| 6 | def test_range(): |
| 7 | point = cffi_pure.lib.get_origin() |
| 8 | point.x = 10 |
| 9 | point.y = 10 |
| 10 | |
| 11 | assert not cffi_pure.lib.is_in_range(point, 14) |
| 12 | assert cffi_pure.lib.is_in_range(point, 15) |
| 13 | |
| 14 | |
| 15 | def test_ffi(): |
| 16 | point = cffi_pure.ffi.new("Point *", (10, 20)) |
| 17 | assert point.x == 10 |
| 18 | assert point.y == 20 |