From 73ea48ba4a7fc2dd82c18aa18cda73fb4a4c9252 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 25 Nov 2018 23:39:15 +0100 Subject: [PATCH 1/2] Add recently added nested_in_template to the list of test cases This should have been part of 30bb977a6436fa7903aca041606c1110d37a2401 See #1358. --- Examples/test-suite/common.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index 3b46354b9..fbde676ed 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -321,6 +321,7 @@ CPP_TEST_CASES += \ nested_directors \ nested_comment \ nested_ignore \ + nested_in_template \ nested_scope \ nested_template_base \ nested_workaround \ From 5e7426dcc6f269c10895a3bff6237a39e05888e4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 26 Nov 2018 14:47:20 +0100 Subject: [PATCH 2/2] Avoid comparing doubles in nested_in_template.i unit test This should also have been part of 30bb977a6436fa7903aca041606c1110d37a2401 See #1358. --- Examples/test-suite/csharp/nested_in_template_runme.cs | 4 ++-- Examples/test-suite/nested_in_template.i | 4 ++-- Examples/test-suite/python/nested_in_template_runme.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Examples/test-suite/csharp/nested_in_template_runme.cs b/Examples/test-suite/csharp/nested_in_template_runme.cs index 6d6f2e8a1..e57e03999 100644 --- a/Examples/test-suite/csharp/nested_in_template_runme.cs +++ b/Examples/test-suite/csharp/nested_in_template_runme.cs @@ -3,8 +3,8 @@ using nested_in_templateNamespace; public class runme { static void Main() { - var cd = new OuterTemplate1.ConcreteDerived(8.8); - if (cd.m_value != 8.8) + var cd = new OuterTemplate1.ConcreteDerived(88); + if (cd.m_value != 88) throw new Exception("ConcreteDerived not created correctly"); } } diff --git a/Examples/test-suite/nested_in_template.i b/Examples/test-suite/nested_in_template.i index d878c62b0..2e79fa574 100644 --- a/Examples/test-suite/nested_in_template.i +++ b/Examples/test-suite/nested_in_template.i @@ -20,13 +20,13 @@ struct OuterTemplate<1> struct ConcreteDerived : AbstractBase { ConcreteDerived() : m_value(0.) {} - explicit ConcreteDerived(double value) : m_value(value) {} + explicit ConcreteDerived(int value) : m_value(value) {} virtual bool IsSameAs(const AbstractBase& other) const { return m_value == static_cast(other).m_value; } - double m_value; + int m_value; }; }; %} diff --git a/Examples/test-suite/python/nested_in_template_runme.py b/Examples/test-suite/python/nested_in_template_runme.py index b4aa25b9b..69afd1604 100644 --- a/Examples/test-suite/python/nested_in_template_runme.py +++ b/Examples/test-suite/python/nested_in_template_runme.py @@ -1,5 +1,5 @@ from nested_in_template import * -cd = ConcreteDerived(8.8) -if cd.m_value != 8.8: +cd = ConcreteDerived(88) +if cd.m_value != 88: raise RuntimeError("ConcreteDerived not created correctly")