Skip to content

Commit

Permalink
tests: Add another fit-macro-constant-types test.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Dec 19, 2020
1 parent 5c82186 commit 4ce4b93
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
54 changes: 54 additions & 0 deletions tests/expectations/tests/fit-macro-constant-types-signed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]

pub const N0: i8 = 0;
pub const N1: i8 = 1;
pub const N2: i8 = 2;
pub const N_1: i8 = -1;
pub const N_2: i8 = -2;
pub const MAX_U16: i32 = 65535;
pub const MAX_I16: i16 = 32767;
pub const MAX_I16_Plus1: i32 = 32768;
pub const MAX_U16_Plus1: i32 = 65536;
pub const MAX_I16_Minus1: i16 = 32766;
pub const MAX_U16_Minus1: i32 = 65534;
pub const MIN_U16: i8 = 0;
pub const MIN_I16: i16 = -32768;
pub const MIN_U16_Plus1: i8 = 1;
pub const MIN_I16_Plus1: i16 = -32767;
pub const MIN_U16_Minus1: i8 = -1;
pub const MIN_I16_Minus1: i32 = -32769;
pub const MAX_U32: i64 = 4294967295;
pub const MAX_I32: i32 = 2147483647;
pub const MAX_I32_Plus1: i64 = 2147483648;
pub const MAX_U32_Plus1: i64 = 4294967296;
pub const MAX_I32_Minus1: i32 = 2147483646;
pub const MAX_U32_Minus1: i64 = 4294967294;
pub const MIN_U32: i8 = 0;
pub const MIN_I32: i32 = -2147483648;
pub const MIN_U32_Plus1: i8 = 1;
pub const MIN_I32_Plus1: i32 = -2147483647;
pub const MIN_U32_Minus1: i8 = -1;
pub const MIN_I32_Minus1: i64 = -2147483649;
pub const LONG12: i64 = 123456789012;
pub const LONG_12: i64 = -123456789012;
extern "C" {
pub fn foo(
arg1: ::std::os::raw::c_int,
arg2: ::std::os::raw::c_int,
arg3: ::std::os::raw::c_uint,
arg4: ::std::os::raw::c_char,
arg5: ::std::os::raw::c_uchar,
arg6: ::std::os::raw::c_schar,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn bar(
arg1: ::std::os::raw::c_long,
arg2: ::std::os::raw::c_longlong,
) -> ::std::os::raw::c_long;
}
2 changes: 2 additions & 0 deletions tests/headers/fit-macro-constant-types-signed.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// bindgen-flags: --default-macro-constant-type=signed --fit-macro-constant-types
#include "default-macro-constant-type.h"

0 comments on commit 4ce4b93

Please sign in to comment.