Skip to content

Commit 922a716

Browse files
committed
Moar tests.
1 parent b653568 commit 922a716

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(non_snake_case)]
5+
6+
7+
const Foo_Bar: Foo = Foo(2);
8+
const Foo_Baz: Foo = Foo(4);
9+
const Foo_Duplicated: Foo = Foo(4);
10+
const Foo_Negative: Foo = Foo(-3);
11+
#[repr(C)]
12+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
13+
pub struct Foo(pub i32);
14+
const Buz_Bar: Buz = Buz(2);
15+
const Buz_Baz: Buz = Buz(4);
16+
const Buz_Duplicated: Buz = Buz(4);
17+
const Buz_Negative: Buz = Buz(-3);
18+
#[repr(C)]
19+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20+
pub struct Buz(pub i8);

tests/headers/bitfield-enum-basic.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// bindgen-flags: --bitfield-enum ".*" -- -std=c++11
2+
3+
enum Foo {
4+
Bar = 1 << 1,
5+
Baz = 1 << 2,
6+
Duplicated = 1 << 2,
7+
Negative = -3,
8+
};
9+
10+
enum class Buz : signed char {
11+
Bar = 1 << 1,
12+
Baz = 1 << 2,
13+
Duplicated = 1 << 2,
14+
Negative = -3,
15+
};

0 commit comments

Comments
 (0)