From 30028f9e3f51fd8b752c594328b170a23f58abd4 Mon Sep 17 00:00:00 2001 From: Emilio Cobos Álvarez Date: Fri, 14 Oct 2016 14:19:12 +0200 Subject: Tests --- tests/expectations/template_alias.rs | 12 ++++++++++++ tests/expectations/template_alias_basic.rs | 7 +++++++ tests/expectations/template_alias_namespace.rs | 21 +++++++++++++++++++++ tests/headers/template_alias.hpp | 13 +++++++++++++ tests/headers/template_alias_basic.hpp | 4 ++++ tests/headers/template_alias_namespace.hpp | 13 +++++++++++++ 6 files changed, 70 insertions(+) create mode 100644 tests/expectations/template_alias.rs create mode 100644 tests/expectations/template_alias_basic.rs create mode 100644 tests/expectations/template_alias_namespace.rs create mode 100644 tests/headers/template_alias.hpp create mode 100644 tests/headers/template_alias_basic.hpp create mode 100644 tests/headers/template_alias_namespace.hpp diff --git a/tests/expectations/template_alias.rs b/tests/expectations/template_alias.rs new file mode 100644 index 00000000..6457381f --- /dev/null +++ b/tests/expectations/template_alias.rs @@ -0,0 +1,12 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +pub type Wrapped = T; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Rooted { + pub ptr: Wrapped, +} diff --git a/tests/expectations/template_alias_basic.rs b/tests/expectations/template_alias_basic.rs new file mode 100644 index 00000000..656fff33 --- /dev/null +++ b/tests/expectations/template_alias_basic.rs @@ -0,0 +1,7 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +pub type Wrapped = T; diff --git a/tests/expectations/template_alias_namespace.rs b/tests/expectations/template_alias_namespace.rs new file mode 100644 index 00000000..475c2b05 --- /dev/null +++ b/tests/expectations/template_alias_namespace.rs @@ -0,0 +1,21 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +pub mod root { + use root; + pub mod JS { + use root; + pub mod detail { + use root; + pub type Wrapped = T; + } + #[repr(C)] + #[derive(Debug, Copy, Clone)] + pub struct Rooted { + pub ptr: root::JS::detail::Wrapped, + } + } +} diff --git a/tests/headers/template_alias.hpp b/tests/headers/template_alias.hpp new file mode 100644 index 00000000..646d9f40 --- /dev/null +++ b/tests/headers/template_alias.hpp @@ -0,0 +1,13 @@ +// bindgen-flags: -- -std=c++14 + +namespace JS { +namespace detail { + template + using Wrapped = T; +} + +template +struct Rooted { + detail::Wrapped ptr; +}; +} diff --git a/tests/headers/template_alias_basic.hpp b/tests/headers/template_alias_basic.hpp new file mode 100644 index 00000000..964f6e27 --- /dev/null +++ b/tests/headers/template_alias_basic.hpp @@ -0,0 +1,4 @@ +// bindgen-flags: -- -std=c++11 + +template +using Wrapped = T; diff --git a/tests/headers/template_alias_namespace.hpp b/tests/headers/template_alias_namespace.hpp new file mode 100644 index 00000000..bd637166 --- /dev/null +++ b/tests/headers/template_alias_namespace.hpp @@ -0,0 +1,13 @@ +// bindgen-flags: --enable-cxx-namespaces -- -std=c++14 + +namespace JS { +namespace detail { + template + using Wrapped = T; +} + +template +struct Rooted { + detail::Wrapped ptr; +}; +} -- cgit v1.2.3