From 28cbb290b77d7676d9c87db7ba63d41c905582e7 Mon Sep 17 00:00:00 2001 From: nujhong Date: Wed, 9 Oct 2024 02:13:00 +1100 Subject: [PATCH] test: add failing test case #1371 --- integration-tests/tests/integration_test.rs | 36 ++++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/integration-tests/tests/integration_test.rs b/integration-tests/tests/integration_test.rs index 853e17b1b..592394e51 100644 --- a/integration-tests/tests/integration_test.rs +++ b/integration-tests/tests/integration_test.rs @@ -12131,7 +12131,7 @@ fn test_virtual_methods() { // TODO: currently this class cannot be detected as virtual as there // is no metadata captured to show that this destructor is virtual - // uncommenting this (as well as corresponding sections below) gives a + // uncommenting this (as well as corresponding sections below) gives a // 'instantiation of abstract class' error. // class Partial5 : public Base { // public: @@ -12232,13 +12232,13 @@ fn test_issue_1229() { let hdr = indoc! {" struct Thing { float id; - + Thing(float id) : id(id) {} }; struct Item { float id; - + Item(float id) : id(id) {} }; "}; @@ -12353,29 +12353,29 @@ fn test_cpp_union_pod() { typedef unsigned long long UInt64_t; struct ManagedPtr_t_; typedef struct ManagedPtr_t_ ManagedPtr_t; - + typedef int (*ManagedPtr_ManagerFunction_t)( ManagedPtr_t *managedPtr, const ManagedPtr_t *srcPtr, int operation); - + typedef union { int intValue; void *ptr; } ManagedPtr_t_data_; - + struct ManagedPtr_t_ { void *pointer; ManagedPtr_t_data_ userData[4]; ManagedPtr_ManagerFunction_t manager; }; - + typedef struct CorrelationId_t_ { unsigned int size : 8; unsigned int valueType : 4; unsigned int classId : 16; unsigned int reserved : 4; - + union { UInt64_t intValue; ManagedPtr_t ptrValue; @@ -12403,6 +12403,26 @@ fn test_override_typedef_fn() { run_test("", hdr, quote! {}, &["Foo"], &[]); } +#[test] +fn test_namespaced_string() { + let hdr = indoc! {" + namespace a { + // Replacing `String` with another non-conflicting name will pass + class String {}; + } // namespace tester + + class Foo { + public: + a::String create_custom_string() { + return a::String(); + } + }; + + "}; + + run_test("", hdr, quote! {}, &["Foo"], &[]); +} + // Yet to test: // - Ifdef // - Out param pointers