| 1 | module composite |
| 2 | |
| 3 | import vx11 |
| 4 | |
| 5 | #include "@VMODROOT/composite/tests/abi.h" |
| 6 | |
| 7 | fn C.vx11_composite_test_constants(&i32) &vx11.CLong |
| 8 | fn C.vx11_composite_test_name() &char |
| 9 | |
| 10 | fn test_constants_match_headers() { |
| 11 | mut count := i32(0) |
| 12 | values := C.vx11_composite_test_constants(&count) |
| 13 | expected := [i64(major_version), minor_version, redirect_automatic, redirect_manual, |
| 14 | x_query_version, x_redirect_window, x_redirect_subwindows, x_unredirect_window, |
| 15 | x_unredirect_subwindows, x_create_region_from_border_clip, x_name_window_pixmap, |
| 16 | x_get_overlay_window, x_release_overlay_window, number_requests, number_events, library_major, |
| 17 | library_minor, library_revision, library_version] |
| 18 | assert int(count) == expected.len |
| 19 | for i, value in expected { |
| 20 | assert value == i64(unsafe { values[i] }), 'constant ${i}' |
| 21 | } |
| 22 | assert name == unsafe { cstring_to_vstring(C.vx11_composite_test_name()) } |
| 23 | } |
| 24 | |
| 25 | fn test_linked_library_version() { |
| 26 | assert version() == library_version |
| 27 | } |
| 28 | |