Skip to content

Commit

Permalink
Add test for issue #1229
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Feb 6, 2023
1 parent b579e7c commit cb16073
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions integration-tests/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11827,6 +11827,47 @@ fn test_issue_1214() {
run_test("", hdr, quote! {}, &["C"], &[]);
}

#[test]
fn test_issue_1229() {
let hdr = indoc! {"
struct Thing {
float id;
Thing(float id) : id(id) {}
};
struct Item {
float id;
Item(float id) : id(id) {}
};
"};
let hexathorpe = Token![#](Span::call_site());
let rs = quote! {
use autocxx::WithinUniquePtr;

autocxx::include_cpp! {
#hexathorpe include "input.h"
name!(thing)
safety!(unsafe)
generate!("Thing")
}
autocxx::include_cpp! {
#hexathorpe include "input.h"
name!(item)
safety!(unsafe)
generate!("Item")
}

fn main() {
let thing = thing::Thing::new(15.).within_unique_ptr();
let item = item::Item::new(15.).within_unique_ptr();
}
};

do_run_test_manual("", hdr, rs, None, None).unwrap();
}

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

0 comments on commit cb16073

Please sign in to comment.