summaryrefslogtreecommitdiff
path: root/Examples/test-suite/d
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2022-09-17 10:23:51 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2022-09-17 10:23:51 +0100
commite97181ebc07a4755c1ab3e6f08eef12a3f9de07e (patch)
tree16dc71ce60c3a97a93976af5fdd5e86482aaa8c1 /Examples/test-suite/d
parentf0af17b3244d98109a62e3fda5ab6e5fc458283d (diff)
downloadswig-e97181ebc07a4755c1ab3e6f08eef12a3f9de07e.tar.gz
Add missing typecheck typemaps for std::auto_ptr and std::unique_ptr
To fix overloading when using these types.
Diffstat (limited to 'Examples/test-suite/d')
-rw-r--r--Examples/test-suite/d/cpp11_std_unique_ptr_runme.1.d9
-rw-r--r--Examples/test-suite/d/cpp11_std_unique_ptr_runme.2.d9
-rw-r--r--Examples/test-suite/d/li_std_auto_ptr_runme.1.d9
-rw-r--r--Examples/test-suite/d/li_std_auto_ptr_runme.2.d9
4 files changed, 36 insertions, 0 deletions
diff --git a/Examples/test-suite/d/cpp11_std_unique_ptr_runme.1.d b/Examples/test-suite/d/cpp11_std_unique_ptr_runme.1.d
index b83392a85..b8e466414 100644
--- a/Examples/test-suite/d/cpp11_std_unique_ptr_runme.1.d
+++ b/Examples/test-suite/d/cpp11_std_unique_ptr_runme.1.d
@@ -91,6 +91,15 @@ void main() {
takeKlassUniquePtr(make_null());
checkCount(0);
+ // overloaded parameters
+ if (overloadTest() != 0)
+ throw new Exception("overloadTest failed");
+ if (overloadTest(null) != 1)
+ throw new Exception("overloadTest failed");
+ if (overloadTest(new Klass("over")) != 1)
+ throw new Exception("overloadTest failed");
+ checkCount(0);
+
// unique_ptr as output
Klass k1 = makeKlassUniquePtr("first");
diff --git a/Examples/test-suite/d/cpp11_std_unique_ptr_runme.2.d b/Examples/test-suite/d/cpp11_std_unique_ptr_runme.2.d
index b83392a85..b8e466414 100644
--- a/Examples/test-suite/d/cpp11_std_unique_ptr_runme.2.d
+++ b/Examples/test-suite/d/cpp11_std_unique_ptr_runme.2.d
@@ -91,6 +91,15 @@ void main() {
takeKlassUniquePtr(make_null());
checkCount(0);
+ // overloaded parameters
+ if (overloadTest() != 0)
+ throw new Exception("overloadTest failed");
+ if (overloadTest(null) != 1)
+ throw new Exception("overloadTest failed");
+ if (overloadTest(new Klass("over")) != 1)
+ throw new Exception("overloadTest failed");
+ checkCount(0);
+
// unique_ptr as output
Klass k1 = makeKlassUniquePtr("first");
diff --git a/Examples/test-suite/d/li_std_auto_ptr_runme.1.d b/Examples/test-suite/d/li_std_auto_ptr_runme.1.d
index 3ad86dc61..86fac68b5 100644
--- a/Examples/test-suite/d/li_std_auto_ptr_runme.1.d
+++ b/Examples/test-suite/d/li_std_auto_ptr_runme.1.d
@@ -91,6 +91,15 @@ void main() {
takeKlassAutoPtr(make_null());
checkCount(0);
+ // overloaded parameters
+ if (overloadTest() != 0)
+ throw new Exception("overloadTest failed");
+ if (overloadTest(null) != 1)
+ throw new Exception("overloadTest failed");
+ if (overloadTest(new Klass("over")) != 1)
+ throw new Exception("overloadTest failed");
+ checkCount(0);
+
// auto_ptr as output
Klass k1 = makeKlassAutoPtr("first");
diff --git a/Examples/test-suite/d/li_std_auto_ptr_runme.2.d b/Examples/test-suite/d/li_std_auto_ptr_runme.2.d
index 3ad86dc61..86fac68b5 100644
--- a/Examples/test-suite/d/li_std_auto_ptr_runme.2.d
+++ b/Examples/test-suite/d/li_std_auto_ptr_runme.2.d
@@ -91,6 +91,15 @@ void main() {
takeKlassAutoPtr(make_null());
checkCount(0);
+ // overloaded parameters
+ if (overloadTest() != 0)
+ throw new Exception("overloadTest failed");
+ if (overloadTest(null) != 1)
+ throw new Exception("overloadTest failed");
+ if (overloadTest(new Klass("over")) != 1)
+ throw new Exception("overloadTest failed");
+ checkCount(0);
+
// auto_ptr as output
Klass k1 = makeKlassAutoPtr("first");