diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-01-24 15:20:53 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:51:49 -0300 |
commit | a51b488ca06d412c7071f4f44e556d45b022ec81 (patch) | |
tree | 6803ab812c3daf5572315fd011349d6c4bddee0f | |
parent | b66595efa544b2675fef7ec2c6832dba5d8c1177 (diff) |
Fix bug#633 - "bool of null QDate (possibly other empty QString/null QObj types?) returns True for empty instance; probably should be False"
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/QtCore/qdate_test.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e0ebbe7f..6196013f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,7 +156,7 @@ if (NOT SITE_PACKAGE) endif() endif() -set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic) +set(GENERATOR_EXTRA_FLAGS --generatorSet=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero) add_subdirectory(libpyside) if(QT_QTUITOOLS_FOUND AND QT_QTDESIGNER_FOUND) diff --git a/tests/QtCore/qdate_test.py b/tests/QtCore/qdate_test.py index 49234486f..e1386ab2b 100644 --- a/tests/QtCore/qdate_test.py +++ b/tests/QtCore/qdate_test.py @@ -23,6 +23,11 @@ class TestQDate (unittest.TestCase): self.assertEqual(week, 52) self.assertEqual(yearNumber, 1999) + def testBooleanCast(self): + today = QDate.currentDate() + self.assertTrue(today) + nodate = QDate() + self.assertFalse(nodate) if __name__ == '__main__': unittest.main() |