From 70729b25f64aa14cc5987297e22b83f86e5cfb8c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 11 Feb 2014 03:32:49 +0000 Subject: [PATCH] Fix != comparison for gdicmn classes. Fixes #15772 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etg/gdicmn.py | 8 ++++---- unittests/test_gdicmn.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/etg/gdicmn.py b/etg/gdicmn.py index f0815314..5114b227 100644 --- a/etg/gdicmn.py +++ b/etg/gdicmn.py @@ -86,7 +86,7 @@ def run(): # sequences. c.addCppMethod('bool', '__eq__', '(const wxPoint& other)', body="return *self == *other;") - c.addCppMethod('bool', '__neq__', '(const wxPoint& other)', + c.addCppMethod('bool', '__ne__', '(const wxPoint& other)', body="return *self != *other;") c.addItem(etgtools.WigCode("""\ @@ -153,7 +153,7 @@ def run(): c.addCppMethod('bool', '__eq__', '(const wxSize& other)', body="return *self == *other;") - c.addCppMethod('bool', '__neq__', '(const wxSize& other)', + c.addCppMethod('bool', '__ne__', '(const wxSize& other)', body="return *self != *other;") c.addItem(etgtools.WigCode("""\ @@ -219,7 +219,7 @@ def run(): c.addCppMethod('bool', '__eq__', '(const wxRect& other)', body="return *self == *other;") - c.addCppMethod('bool', '__neq__', '(const wxRect& other)', + c.addCppMethod('bool', '__ne__', '(const wxRect& other)', body="return *self != *other;") c.addItem(etgtools.WigCode("""\ @@ -288,7 +288,7 @@ def run(): c.addCppMethod('bool', '__eq__', '(const wxRealPoint& other)', body="return *self == *other;") - c.addCppMethod('bool', '__neq__', '(const wxRealPoint& other)', + c.addCppMethod('bool', '__ne__', '(const wxRealPoint& other)', body="return *self != *other;") c.addItem(etgtools.WigCode("""\ diff --git a/unittests/test_gdicmn.py b/unittests/test_gdicmn.py index 3c9a5db4..c10cebc8 100644 --- a/unittests/test_gdicmn.py +++ b/unittests/test_gdicmn.py @@ -69,6 +69,16 @@ class Point(unittest.TestCase): p = p1 / 5 p1 += p2 p1 -= p2 + + def test_operators2(self): + p1 = wx.Point(4,5) + p2 = wx.Point(4,5) + p3 = wx.Point(9,9) + self.assertTrue(p1 == p2) + self.assertFalse(p1 != p2) + self.assertFalse(p1 == p3) + self.assertTrue(p1 != p3) + def test_magic(self): p = wx.Point(5,6)