Skip to content

Commit

Permalink
Merge pull request #1223 from google/test-for-1214
Browse files Browse the repository at this point in the history
Fix enum u16 representation.
  • Loading branch information
adetaylor authored Jan 31, 2023
2 parents a3ab76c + a6ffcc1 commit 21a0070
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ log = "0.4"
proc-macro2 = "1.0.11"
quote = "1.0"
indoc = "1.0"
autocxx-bindgen = "=0.62.0"
autocxx-bindgen = "=0.62.1"
#autocxx-bindgen = { git = "https://github.com/adetaylor/rust-bindgen", branch = "merge-upstream-0.62" }
itertools = "0.10.3"
cc = { version = "1.0", optional = true }
Expand Down
28 changes: 25 additions & 3 deletions integration-tests/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7335,14 +7335,24 @@ fn test_issue_956() {
let hdr = indoc! {"
#include <cstdint>
inline void take_int(int&) {}
inline void take_uin16(uint16_t&) {}
inline void take_char16(char16_t &) {}
inline void take_uint16(uint16_t) {}
inline void take_us(unsigned short) {}
inline void take_char16(char16_t) {}
inline void take_uint16_ref(uint16_t&) {}
inline void take_char16_ref(char16_t &) {}
"};
run_test(
"",
hdr,
quote! {},
&["take_int", "take_uin16", "take_char16"],
&[
"take_int",
"take_uint16",
"take_char16",
"take_uint16_ref",
"take_char16_ref",
"take_us",
],
&[],
);
}
Expand Down Expand Up @@ -11805,6 +11815,18 @@ fn test_issue_1192() {
);
}

#[test]
fn test_issue_1214() {
let hdr = indoc! {"
#include <cstdint>
enum class C: uint16_t {
A,
B,
};
"};
run_test("", hdr, quote! {}, &["C"], &[]);
}

// Yet to test:
// - Ifdef
// - Out param pointers
Expand Down

0 comments on commit 21a0070

Please sign in to comment.