Skip to content

Commit 8d4e547

Browse files
authored
Merge pull request #1469 from google/virt-fn-test
Additional virtual function test
2 parents 1621210 + 7a86dfc commit 8d4e547

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

integration-tests/tests/integration_test.rs

+29
Original file line numberDiff line numberDiff line change
@@ -10239,6 +10239,35 @@ fn test_issue486_multi_types() {
1023910239
);
1024010240
}
1024110241

10242+
#[test]
10243+
#[ignore] // https://github.com/google/autocxx/issues/774
10244+
fn test_virtual_methods_additional() {
10245+
let hdr = indoc! {"
10246+
#pragma once
10247+
10248+
class A {
10249+
public:
10250+
A() {}
10251+
~A() {}
10252+
// the following line makes Test2 Opaque, and deprives it of a make_unique()
10253+
// comment next line, uncomment the one after to obtain a make_unique() for Test2
10254+
virtual int b() = 0;
10255+
// int b() { return 2; }
10256+
};
10257+
10258+
class B: public A {
10259+
public:
10260+
B() {}
10261+
~B() {}
10262+
int b() { return 3; }
10263+
};
10264+
"};
10265+
let rs = quote! {
10266+
let b = cxx::B::make_unique();
10267+
};
10268+
run_test("", hdr, rs, &["B"], &[]);
10269+
}
10270+
1024210271
#[test]
1024310272
/// Tests types with various forms of copy, move, and default constructors. Calls the things which
1024410273
/// should be generated, and will produce C++ compile failures if other wrappers are generated.

0 commit comments

Comments
 (0)