Skip to content

Commit

Permalink
Moar tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Nov 8, 2016
1 parent 04f98a0 commit 399781d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/expectations/tests/bitfield-enum-basic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* automatically generated by rust-bindgen */


#![allow(non_snake_case)]


const Foo_Bar: Foo = Foo(2);
const Foo_Baz: Foo = Foo(4);
const Foo_Duplicated: Foo = Foo(4);
const Foo_Negative: Foo = Foo(-3);
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Foo(pub i32);
const Buz_Bar: Buz = Buz(2);
const Buz_Baz: Buz = Buz(4);
const Buz_Duplicated: Buz = Buz(4);
const Buz_Negative: Buz = Buz(-3);
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Buz(pub i8);
15 changes: 15 additions & 0 deletions tests/headers/bitfield-enum-basic.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// bindgen-flags: --bitfield-enum ".*" -- -std=c++11

enum Foo {
Bar = 1 << 1,
Baz = 1 << 2,
Duplicated = 1 << 2,
Negative = -3,
};

enum class Buz : signed char {
Bar = 1 << 1,
Baz = 1 << 2,
Duplicated = 1 << 2,
Negative = -3,
};

0 comments on commit 399781d

Please sign in to comment.