From bdc90eefc004103e494e2e8bf7d0e430456d2124 Mon Sep 17 00:00:00 2001 From: Brian Silverman Date: Sun, 13 Feb 2022 23:00:33 -0800 Subject: [PATCH 1/2] Add a failing test with `shared_ptr` Compiling the C++ code fails. --- integration-tests/src/tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/integration-tests/src/tests.rs b/integration-tests/src/tests.rs index 31ef9f778..90568e5c5 100644 --- a/integration-tests/src/tests.rs +++ b/integration-tests/src/tests.rs @@ -5785,6 +5785,24 @@ fn test_shared_ptr() { ); } +#[test] +fn test_shared_ptr_const() { + let hdr = indoc! {" + #include + inline std::shared_ptr make_shared_int() { + return std::make_shared(3); + } + inline int take_shared_int(std::shared_ptr a) { + return *a; + } + "}; + let rs = quote! { + let a = ffi::make_shared_int(); + assert_eq!(ffi::take_shared_int(a.clone()), autocxx::c_int(3)); + }; + run_test("", hdr, rs, &["make_shared_int", "take_shared_int"], &[]); +} + #[test] fn test_rust_reference() { let hdr = indoc! {" From aa2dfe044e3d95e344279df9be370ca1ed542f29 Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Mon, 14 Feb 2022 11:40:26 -0800 Subject: [PATCH 2/2] Ignore the new test --- integration-tests/src/tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/integration-tests/src/tests.rs b/integration-tests/src/tests.rs index 90568e5c5..afc84cc24 100644 --- a/integration-tests/src/tests.rs +++ b/integration-tests/src/tests.rs @@ -5786,6 +5786,7 @@ fn test_shared_ptr() { } #[test] +#[ignore] // https://github.com/google/autocxx/issues/799 fn test_shared_ptr_const() { let hdr = indoc! {" #include