Tests for namespaced opaque extern types.
diff --git a/tests/ffi/tests.cc b/tests/ffi/tests.cc
index 2c37397..db51435 100644
--- a/tests/ffi/tests.cc
+++ b/tests/ffi/tests.cc
@@ -478,12 +478,25 @@
}
}
+void c_take_opaque_ns_ptr(std::unique_ptr<::F::F> f) {
+ if (f->f == 40) {
+ cxx_test_suite_set_correct();
+ }
+}
+
void c_take_opaque_ref(const E& e) {
if (e.e == 40 && e.e_str == "hello") {
cxx_test_suite_set_correct();
}
}
+void c_take_opaque_ns_ref(const ::F::F& f) {
+ if (f.f == 40 && f.f_str == "hello") {
+ cxx_test_suite_set_correct();
+ }
+}
+
+
std::unique_ptr<D> c_return_trivial_ptr() {
auto d = std::unique_ptr<D>(new D());
d->d = 30;
@@ -503,6 +516,13 @@
return e;
}
+std::unique_ptr<::F::F> c_return_ns_opaque_ptr() {
+ auto f = std::unique_ptr<::F::F>(new ::F::F());
+ f->f = 40;
+ f->f_str = std::string("hello");
+ return f;
+}
+
extern "C" const char *cxx_run_test() noexcept {
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)