Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for issue #1229 #1235

Merged
merged 2 commits into from
Feb 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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