Skip to content

Commit

Permalink
Added tests for array pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
elichai authored and emilio committed May 22, 2019
1 parent 24091a8 commit fc762a5
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/expectations/tests/with_array_pointers_arguments.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* automatically generated by rust-bindgen */

#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]

extern "C" {
pub fn test_fn(
a: f32,
arr: *mut [::std::os::raw::c_int; 20usize],
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn test_fn2(
arr: *const [f32; 20usize],
b: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
21 changes: 21 additions & 0 deletions tests/expectations/tests/without_array_pointers_arguments.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* automatically generated by rust-bindgen */

#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]

extern "C" {
pub fn test_fn(
a: f32,
arr: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn test_fn2(
arr: *const f32,
b: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
5 changes: 5 additions & 0 deletions tests/headers/with_array_pointers_arguments.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// bindgen-flags: --use-array-pointers-in-arguments

int test_fn(float a, int arr[20]);

int test_fn2(const float arr[20], int b);
4 changes: 4 additions & 0 deletions tests/headers/without_array_pointers_arguments.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

int test_fn(float a, int arr[20]);

int test_fn2(const float arr[20], int b);

0 comments on commit fc762a5

Please sign in to comment.