Add tests for make_unique with no constructors.
@@ -7004,6 +7004,34 @@ fn test_pv_subclass_namespaced_superclass() {
);
}
+#[test]
+fn test_no_constructor_make_unique() {
+ let hdr = indoc! {"
+ #include <stdint.h>
+ struct A {
+ uint32_t a;
+ };
+ "};
+ let rs = quote! {
+ ffi::A::make_unique();
+ };
+ run_test("", hdr, rs, &["A"], &[]);
+}
+
+#[test]
+fn test_no_constructor_pod_make_unique() {
+ let hdr = indoc! {"
+ #include <stdint.h>
+ struct A {
+ uint32_t a;
+ };
+ "};
+ let rs = quote! {
+ ffi::A::make_unique();
+ };
+ run_test("", hdr, rs, &[], &["A"]);
+}
+
// Yet to test:
// - Ifdef
// - Out param pointers
