From 39236c01ae6c9bc99ee3a02d8294679e12d9b734 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 22 May 2017 16:44:51 +0200 Subject: move everying into sources/pyside2 in preparation for a subtree merge. this should not be necessary to do in a separate commit, but git is a tad stupid about following history correctly without it. --- sources/pyside2/tests/CMakeLists.txt | 61 + sources/pyside2/tests/QtConcurrent/CMakeLists.txt | 1 + .../tests/QtConcurrent/this_module_loads_test.py | 39 + sources/pyside2/tests/QtCore/CMakeLists.txt | 121 + .../pyside2/tests/QtCore/blocking_signals_test.py | 134 + sources/pyside2/tests/QtCore/bug_1019.py | 60 + sources/pyside2/tests/QtCore/bug_1031.py | 33 + sources/pyside2/tests/QtCore/bug_1063.py | 58 + sources/pyside2/tests/QtCore/bug_1069.py | 50 + sources/pyside2/tests/QtCore/bug_278_test.py | 52 + sources/pyside2/tests/QtCore/bug_332.py | 46 + sources/pyside2/tests/QtCore/bug_408.py | 56 + sources/pyside2/tests/QtCore/bug_428.py | 46 + sources/pyside2/tests/QtCore/bug_462.py | 74 + sources/pyside2/tests/QtCore/bug_505.py | 50 + sources/pyside2/tests/QtCore/bug_515.py | 46 + sources/pyside2/tests/QtCore/bug_606.py | 62 + sources/pyside2/tests/QtCore/bug_656.py | 37 + sources/pyside2/tests/QtCore/bug_686.py | 116 + sources/pyside2/tests/QtCore/bug_699.py | 45 + sources/pyside2/tests/QtCore/bug_706.py | 55 + sources/pyside2/tests/QtCore/bug_820.py | 97 + sources/pyside2/tests/QtCore/bug_826.py | 57 + sources/pyside2/tests/QtCore/bug_829.py | 50 + sources/pyside2/tests/QtCore/bug_835.py | 93 + sources/pyside2/tests/QtCore/bug_920.py | 53 + sources/pyside2/tests/QtCore/bug_927.py | 52 + sources/pyside2/tests/QtCore/bug_931.py | 49 + sources/pyside2/tests/QtCore/bug_938.py | 42 + sources/pyside2/tests/QtCore/bug_953.py | 46 + sources/pyside2/tests/QtCore/bug_987.py | 43 + sources/pyside2/tests/QtCore/bug_994.py | 54 + sources/pyside2/tests/QtCore/bug_PYSIDE-164.py | 69 + sources/pyside2/tests/QtCore/bug_PYSIDE-42.py | 44 + sources/pyside2/tests/QtCore/child_event_test.py | 81 + sources/pyside2/tests/QtCore/classinfo_test.py | 110 + sources/pyside2/tests/QtCore/deepcopy_test.py | 111 + sources/pyside2/tests/QtCore/deletelater_test.py | 50 + sources/pyside2/tests/QtCore/destroysignal_test.py | 55 + sources/pyside2/tests/QtCore/duck_punching_test.py | 102 + sources/pyside2/tests/QtCore/hash_test.py | 86 + sources/pyside2/tests/QtCore/inherits_test.py | 44 + sources/pyside2/tests/QtCore/max_signals.py | 62 + .../pyside2/tests/QtCore/missing_symbols_test.py | 43 + sources/pyside2/tests/QtCore/mockclass_test.py | 55 + sources/pyside2/tests/QtCore/python_conversion.py | 93 + sources/pyside2/tests/QtCore/qabs_test.py | 48 + .../tests/QtCore/qabstractitemmodel_test.py | 56 + .../tests/QtCore/qabstracttransition_test.py | 184 + .../pyside2/tests/QtCore/qanimationgroup_test.py | 53 + sources/pyside2/tests/QtCore/qbitarray_test.py | 148 + .../QtCore/qbytearray_buffer_protocol_test.py | 53 + .../qbytearray_concatenation_operator_test.py | 72 + .../tests/QtCore/qbytearray_operator_iadd_test.py | 92 + .../tests/QtCore/qbytearray_operator_test.py | 116 + sources/pyside2/tests/QtCore/qbytearray_test.py | 194 ++ sources/pyside2/tests/QtCore/qcollator_test.py | 61 + .../tests/QtCore/qcommandlineparser_test.py | 56 + .../tests/QtCore/qcoreapplication_instance_test.py | 49 + sources/pyside2/tests/QtCore/qdatastream_test.py | 355 ++ sources/pyside2/tests/QtCore/qdate_test.py | 62 + sources/pyside2/tests/QtCore/qdatetime_test.py | 51 + sources/pyside2/tests/QtCore/qeasingcurve_test.py | 54 + sources/pyside2/tests/QtCore/qenum_test.py | 74 + sources/pyside2/tests/QtCore/qevent_test.py | 53 + sources/pyside2/tests/QtCore/qfile_test.py | 88 + sources/pyside2/tests/QtCore/qfileinfo_test.py | 44 + sources/pyside2/tests/QtCore/qflags_test.py | 121 + sources/pyside2/tests/QtCore/qhandle_test.py | 45 + .../tests/QtCore/qinstallmsghandler_test.py | 80 + sources/pyside2/tests/QtCore/qlinef_test.py | 49 + sources/pyside2/tests/QtCore/qlocale_test.py | 69 + sources/pyside2/tests/QtCore/qmetaobject_test.py | 84 + sources/pyside2/tests/QtCore/qmimedatabase_test.py | 78 + .../QtCore/qmodelindex_internalpointer_test.py | 78 + .../tests/QtCore/qobject_children_segfault_test.py | 56 + .../tests/QtCore/qobject_connect_notify_test.py | 104 + sources/pyside2/tests/QtCore/qobject_destructor.py | 47 + .../tests/QtCore/qobject_event_filter_test.py | 143 + .../pyside2/tests/QtCore/qobject_inherits_test.py | 91 + .../tests/QtCore/qobject_objectproperty_test.py | 58 + .../pyside2/tests/QtCore/qobject_parent_test.py | 287 ++ .../pyside2/tests/QtCore/qobject_property_test.py | 69 + .../tests/QtCore/qobject_protected_methods_test.py | 67 + sources/pyside2/tests/QtCore/qobject_test.py | 72 + .../tests/QtCore/qobject_timer_event_test.py | 73 + .../tests/QtCore/qobject_tr_as_instance_test.py | 67 + sources/pyside2/tests/QtCore/qpoint_test.py | 48 + sources/pyside2/tests/QtCore/qprocess_test.py | 58 + .../pyside2/tests/QtCore/qproperty_decorator.py | 63 + sources/pyside2/tests/QtCore/qrect_test.py | 141 + sources/pyside2/tests/QtCore/qregexp_test.py | 48 + sources/pyside2/tests/QtCore/qresource_test.py | 70 + sources/pyside2/tests/QtCore/qsize_test.py | 55 + sources/pyside2/tests/QtCore/qslot_object_test.py | 76 + sources/pyside2/tests/QtCore/qsrand_test.py | 44 + .../pyside2/tests/QtCore/qstandardpaths_test.py | 50 + sources/pyside2/tests/QtCore/qstate_test.py | 64 + sources/pyside2/tests/QtCore/qstatemachine_test.py | 97 + sources/pyside2/tests/QtCore/qstorageinfo_test.py | 43 + sources/pyside2/tests/QtCore/qstring_test.py | 51 + sources/pyside2/tests/QtCore/qsysinfo_test.py | 42 + sources/pyside2/tests/QtCore/qtext_codec_test.py | 48 + sources/pyside2/tests/QtCore/qtextstream_test.py | 115 + .../pyside2/tests/QtCore/qthread_prod_cons_test.py | 136 + .../pyside2/tests/QtCore/qthread_signal_test.py | 91 + sources/pyside2/tests/QtCore/qthread_test.py | 108 + .../pyside2/tests/QtCore/qtimer_singleshot_test.py | 106 + .../pyside2/tests/QtCore/qtimer_timeout_test.py | 87 + sources/pyside2/tests/QtCore/qtnamespace_test.py | 48 + sources/pyside2/tests/QtCore/quoteEnUS.txt | 1 + sources/pyside2/tests/QtCore/qurl_test.py | 125 + sources/pyside2/tests/QtCore/repr_test.py | 105 + sources/pyside2/tests/QtCore/resources.qrc | 7 + sources/pyside2/tests/QtCore/resources_mc.py | 3571 ++++++++++++++++++++ sources/pyside2/tests/QtCore/sample.png | Bin 0 -> 55944 bytes .../pyside2/tests/QtCore/setprop_on_ctor_test.py | 41 + .../pyside2/tests/QtCore/staticMetaObject_test.py | 51 + sources/pyside2/tests/QtCore/static_method_test.py | 84 + .../tests/QtCore/static_protected_methods_test.py | 59 + .../pyside2/tests/QtCore/thread_signals_test.py | 61 + sources/pyside2/tests/QtCore/tr_noop_test.py | 76 + sources/pyside2/tests/QtCore/translation_test.py | 85 + .../tests/QtCore/translations/trans_latin.qm | Bin 0 -> 125 bytes .../tests/QtCore/translations/trans_latin.ts | 11 + .../tests/QtCore/translations/trans_russian.qm | Bin 0 -> 114 bytes .../tests/QtCore/translations/trans_russian.ts | 11 + sources/pyside2/tests/QtCore/unaryoperator_test.py | 67 + sources/pyside2/tests/QtCore/unicode_test.py | 62 + sources/pyside2/tests/QtCore/versioninfo_test.py | 48 + sources/pyside2/tests/QtDesigner/CMakeLists.txt | 1 + .../tests/QtDesigner/this_module_loads_test.py | 39 + sources/pyside2/tests/QtGui/CMakeLists.txt | 47 + sources/pyside2/tests/QtGui/bug_1091.py | 40 + sources/pyside2/tests/QtGui/bug_300_test.py | 45 + sources/pyside2/tests/QtGui/bug_367.py | 50 + sources/pyside2/tests/QtGui/bug_480.py | 53 + sources/pyside2/tests/QtGui/bug_500.py | 43 + sources/pyside2/tests/QtGui/bug_606.py | 54 + sources/pyside2/tests/QtGui/bug_617.py | 49 + sources/pyside2/tests/QtGui/bug_652.py | 58 + sources/pyside2/tests/QtGui/bug_660.py | 55 + sources/pyside2/tests/QtGui/bug_716.py | 37 + sources/pyside2/tests/QtGui/bug_740.py | 41 + sources/pyside2/tests/QtGui/bug_743.py | 43 + sources/pyside2/tests/QtGui/bug_991.py | 43 + sources/pyside2/tests/QtGui/bug_PYSIDE-344.py | 64 + sources/pyside2/tests/QtGui/bug_PYSIDE-41.py | 72 + sources/pyside2/tests/QtGui/deepcopy_test.py | 150 + .../QtGui/float_to_int_implicit_conversion_test.py | 59 + sources/pyside2/tests/QtGui/pyside_reload_test.py | 84 + sources/pyside2/tests/QtGui/qcolor_reduce_test.py | 59 + sources/pyside2/tests/QtGui/qcolor_test.py | 122 + sources/pyside2/tests/QtGui/qcursor_test.py | 44 + .../tests/QtGui/qdatastream_gui_operators_test.py | 63 + .../pyside2/tests/QtGui/qdesktopservices_test.py | 43 + sources/pyside2/tests/QtGui/qfontmetrics_test.py | 226 ++ sources/pyside2/tests/QtGui/qicon_test.py | 44 + sources/pyside2/tests/QtGui/qitemselection_test.py | 47 + sources/pyside2/tests/QtGui/qkeysequence_test.py | 48 + sources/pyside2/tests/QtGui/qmatrix_test.py | 86 + sources/pyside2/tests/QtGui/qopenglbuffer_test.py | 93 + sources/pyside2/tests/QtGui/qpainter_test.py | 111 + sources/pyside2/tests/QtGui/qpdfwriter_test.py | 47 + sources/pyside2/tests/QtGui/qpixelformat_test.py | 50 + sources/pyside2/tests/QtGui/qpixmap_test.py | 85 + sources/pyside2/tests/QtGui/qpixmapcache_test.py | 72 + sources/pyside2/tests/QtGui/qpolygonf_test.py | 55 + .../pyside2/tests/QtGui/qradialgradient_test.py | 57 + sources/pyside2/tests/QtGui/qrasterwindow_test.py | 86 + sources/pyside2/tests/QtGui/qregion_test.py | 49 + sources/pyside2/tests/QtGui/qstylehints_test.py | 42 + .../tests/QtGui/qtextdocument_undoredo_test.py | 58 + .../tests/QtGui/qtextdocumentwriter_test.py | 47 + sources/pyside2/tests/QtGui/qtextline_test.py | 50 + sources/pyside2/tests/QtGui/qtransform_test.py | 101 + sources/pyside2/tests/QtGui/repr_test.py | 117 + sources/pyside2/tests/QtGui/sample.png | Bin 0 -> 55944 bytes sources/pyside2/tests/QtGui/timed_app_test.py | 41 + sources/pyside2/tests/QtHelp/CMakeLists.txt | 1 + sources/pyside2/tests/QtHelp/help_test.py | 41 + sources/pyside2/tests/QtMacExtras/CMakeLists.txt | 1 + .../tests/QtMacExtras/this_module_loads_test.py | 39 + sources/pyside2/tests/QtMultimedia/CMakeLists.txt | 1 + sources/pyside2/tests/QtMultimedia/audio_test.py | 71 + .../tests/QtMultimediaWidgets/CMakeLists.txt | 1 + .../QtMultimediaWidgets/qmultimediawidgets.py | 59 + sources/pyside2/tests/QtNetwork/CMakeLists.txt | 7 + .../pyside2/tests/QtNetwork/accessManager_test.py | 71 + sources/pyside2/tests/QtNetwork/bug_1084.py | 44 + sources/pyside2/tests/QtNetwork/bug_446.py | 76 + .../pyside2/tests/QtNetwork/qipv6address_test.py | 50 + sources/pyside2/tests/QtNetwork/tcpserver_test.py | 52 + sources/pyside2/tests/QtNetwork/udpsocket_test.py | 78 + sources/pyside2/tests/QtOpenGL/CMakeLists.txt | 2 + sources/pyside2/tests/QtOpenGL/qglbuffer_test.py | 72 + sources/pyside2/tests/QtOpenGL/qglwidget_test.py | 47 + .../pyside2/tests/QtPrintSupport/CMakeLists.txt | 1 + .../tests/QtPrintSupport/this_module_loads_test.py | 39 + sources/pyside2/tests/QtQml/CMakeLists.txt | 20 + sources/pyside2/tests/QtQml/bug_1029.py | 58 + sources/pyside2/tests/QtQml/bug_1029.qml | 43 + sources/pyside2/tests/QtQml/bug_451.py | 100 + sources/pyside2/tests/QtQml/bug_451.qml | 54 + sources/pyside2/tests/QtQml/bug_456.py | 70 + sources/pyside2/tests/QtQml/bug_456.qml | 59 + sources/pyside2/tests/QtQml/bug_557.py | 43 + sources/pyside2/tests/QtQml/bug_726.py | 71 + sources/pyside2/tests/QtQml/bug_726.qml | 59 + sources/pyside2/tests/QtQml/bug_814.py | 73 + sources/pyside2/tests/QtQml/bug_814.qml | 36 + sources/pyside2/tests/QtQml/bug_825.py | 82 + sources/pyside2/tests/QtQml/bug_825.qml | 38 + sources/pyside2/tests/QtQml/bug_847.py | 79 + sources/pyside2/tests/QtQml/bug_847.qml | 62 + sources/pyside2/tests/QtQml/bug_915.py | 58 + sources/pyside2/tests/QtQml/bug_926.py | 69 + sources/pyside2/tests/QtQml/bug_926.qml | 45 + sources/pyside2/tests/QtQml/bug_951.py | 61 + sources/pyside2/tests/QtQml/bug_951.qml | 35 + sources/pyside2/tests/QtQml/bug_995.py | 43 + sources/pyside2/tests/QtQml/bug_995.qml | 40 + sources/pyside2/tests/QtQml/bug_997.py | 52 + sources/pyside2/tests/QtQml/bug_997.qml | 34 + sources/pyside2/tests/QtQml/connect_python_qml.py | 65 + sources/pyside2/tests/QtQml/connect_python_qml.qml | 48 + sources/pyside2/tests/QtQml/hw.qml | 48 + .../pyside2/tests/QtQml/javascript_exceptions.py | 103 + .../pyside2/tests/QtQml/javascript_exceptions.qml | 53 + .../tests/QtQml/qqmlincubator_incubateWhile.py | 96 + .../tests/QtQml/qqmlincubator_incubateWhile.qml | 67 + .../qqmlincubator_incubateWhile_component.qml | 35 + sources/pyside2/tests/QtQml/qqmlnetwork_test.py | 70 + .../pyside2/tests/QtQml/qquickitem_grabToImage.py | 79 + .../pyside2/tests/QtQml/qquickitem_grabToImage.qml | 69 + sources/pyside2/tests/QtQml/qquickview_test.py | 86 + sources/pyside2/tests/QtQml/registertype.py | 118 + sources/pyside2/tests/QtQml/registertype.qml | 57 + sources/pyside2/tests/QtQml/view.qml | 43 + sources/pyside2/tests/QtQml/viewmodel.qml | 42 + sources/pyside2/tests/QtQuick/CMakeLists.txt | 1 + .../tests/QtQuick/this_module_loads_test.py | 39 + .../pyside2/tests/QtQuickWidgets/CMakeLists.txt | 1 + .../tests/QtQuickWidgets/this_module_loads_test.py | 39 + sources/pyside2/tests/QtScript/CMakeLists.txt | 5 + sources/pyside2/tests/QtScript/base_test.py | 32 + sources/pyside2/tests/QtScript/bug_1022.py | 41 + sources/pyside2/tests/QtScript/engine_test.py | 41 + sources/pyside2/tests/QtScript/property_test.py | 90 + .../pyside2/tests/QtScript/qscriptvalue_test.py | 72 + sources/pyside2/tests/QtScriptTools/CMakeLists.txt | 1 + .../pyside2/tests/QtScriptTools/debugger_test.py | 75 + sources/pyside2/tests/QtSql/CMakeLists.txt | 3 + sources/pyside2/tests/QtSql/bug_1013.py | 58 + .../tests/QtSql/qsqldatabaseandqueries_test.py | 99 + sources/pyside2/tests/QtSql/qvarianttype_test.py | 62 + sources/pyside2/tests/QtSvg/CMakeLists.txt | 3 + sources/pyside2/tests/QtSvg/qsvggenerator_test.py | 63 + sources/pyside2/tests/QtSvg/qsvgrenderer_test.py | 53 + sources/pyside2/tests/QtSvg/qsvgwidget_test.py | 55 + sources/pyside2/tests/QtSvg/tiger.svg | 730 ++++ sources/pyside2/tests/QtTest/CMakeLists.txt | 3 + sources/pyside2/tests/QtTest/click_test.py | 55 + sources/pyside2/tests/QtTest/eventfilter_test.py | 75 + sources/pyside2/tests/QtTest/touchevent_test.py | 77 + sources/pyside2/tests/QtUiTools/CMakeLists.txt | 13 + sources/pyside2/tests/QtUiTools/action.ui | 16 + sources/pyside2/tests/QtUiTools/bug_1060.py | 46 + sources/pyside2/tests/QtUiTools/bug_1060.ui | 19 + sources/pyside2/tests/QtUiTools/bug_360.py | 64 + sources/pyside2/tests/QtUiTools/bug_376.py | 47 + sources/pyside2/tests/QtUiTools/bug_392.py | 75 + sources/pyside2/tests/QtUiTools/bug_426.py | 46 + sources/pyside2/tests/QtUiTools/bug_426.ui | 19 + sources/pyside2/tests/QtUiTools/bug_552.py | 49 + sources/pyside2/tests/QtUiTools/bug_552.ui | 42 + sources/pyside2/tests/QtUiTools/bug_797.py | 39 + sources/pyside2/tests/QtUiTools/bug_909.py | 52 + sources/pyside2/tests/QtUiTools/bug_909.ui | 31 + sources/pyside2/tests/QtUiTools/bug_913.py | 51 + sources/pyside2/tests/QtUiTools/bug_913.ui | 57 + sources/pyside2/tests/QtUiTools/bug_958.py | 52 + sources/pyside2/tests/QtUiTools/bug_958.ui | 48 + sources/pyside2/tests/QtUiTools/bug_965.py | 48 + sources/pyside2/tests/QtUiTools/bug_965.ui | 27 + sources/pyside2/tests/QtUiTools/minimal.ui | 6 + sources/pyside2/tests/QtUiTools/pycustomwidget.ui | 36 + sources/pyside2/tests/QtUiTools/pycustomwidget2.ui | 48 + sources/pyside2/tests/QtUiTools/test.ui | 48 + sources/pyside2/tests/QtUiTools/ui_test.py | 41 + sources/pyside2/tests/QtUiTools/uiloader_test.py | 71 + sources/pyside2/tests/QtWebChannel/CMakeLists.txt | 1 + .../tests/QtWebChannel/this_module_loads_test.py | 39 + sources/pyside2/tests/QtWebEngine/CMakeLists.txt | 1 + .../tests/QtWebEngine/this_module_loads_test.py | 39 + .../tests/QtWebEngineWidgets/CMakeLists.txt | 29 + .../pyside-474-qtwebengineview.py | 49 + .../QtWebEngineWidgets/this_module_loads_test.py | 39 + sources/pyside2/tests/QtWebKit/CMakeLists.txt | 11 + sources/pyside2/tests/QtWebKit/bug_448.py | 47 + sources/pyside2/tests/QtWebKit/bug_694.py | 78 + sources/pyside2/tests/QtWebKit/bug_803.py | 46 + sources/pyside2/tests/QtWebKit/bug_899.py | 64 + sources/pyside2/tests/QtWebKit/bug_959.py | 128 + sources/pyside2/tests/QtWebKit/fox.html | 7 + sources/pyside2/tests/QtWebKit/qml_plugin_test.py | 88 + sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys | 1 + .../pyside2/tests/QtWebKit/qmlplugin/index.html | 5 + .../tests/QtWebKit/qvariantlist_property_test.py | 71 + .../QtWebKit/shouldInterruptjavascript_test.py | 56 + sources/pyside2/tests/QtWebKit/webframe_test.py | 62 + sources/pyside2/tests/QtWebKit/webpage_test.py | 88 + sources/pyside2/tests/QtWebKit/webview_test.py | 94 + .../pyside2/tests/QtWebKitWidgets/CMakeLists.txt | 1 + .../QtWebKitWidgets/this_module_loads_test.py | 39 + sources/pyside2/tests/QtWebSockets/CMakeLists.txt | 1 + .../tests/QtWebSockets/this_module_loads_test.py | 39 + sources/pyside2/tests/QtWidgets/CMakeLists.txt | 134 + sources/pyside2/tests/QtWidgets/action_clear.py | 74 + sources/pyside2/tests/QtWidgets/add_action_test.py | 71 + sources/pyside2/tests/QtWidgets/api2_test.py | 89 + .../pyside2/tests/QtWidgets/application_test.py | 51 + sources/pyside2/tests/QtWidgets/bug_1002.py | 47 + sources/pyside2/tests/QtWidgets/bug_1006.py | 111 + sources/pyside2/tests/QtWidgets/bug_1048.py | 36 + sources/pyside2/tests/QtWidgets/bug_1077.py | 45 + sources/pyside2/tests/QtWidgets/bug_172.py | 41 + sources/pyside2/tests/QtWidgets/bug_243.py | 45 + sources/pyside2/tests/QtWidgets/bug_307.py | 54 + sources/pyside2/tests/QtWidgets/bug_324.py | 60 + sources/pyside2/tests/QtWidgets/bug_338.py | 55 + sources/pyside2/tests/QtWidgets/bug_363.py | 54 + sources/pyside2/tests/QtWidgets/bug_389.py | 43 + sources/pyside2/tests/QtWidgets/bug_400.py | 54 + sources/pyside2/tests/QtWidgets/bug_416.py | 71 + sources/pyside2/tests/QtWidgets/bug_429.py | 38 + sources/pyside2/tests/QtWidgets/bug_430.py | 42 + sources/pyside2/tests/QtWidgets/bug_433.py | 43 + sources/pyside2/tests/QtWidgets/bug_467.py | 47 + sources/pyside2/tests/QtWidgets/bug_493.py | 51 + sources/pyside2/tests/QtWidgets/bug_512.py | 50 + sources/pyside2/tests/QtWidgets/bug_525.py | 49 + sources/pyside2/tests/QtWidgets/bug_546.py | 42 + sources/pyside2/tests/QtWidgets/bug_547.py | 85 + sources/pyside2/tests/QtWidgets/bug_549.py | 44 + sources/pyside2/tests/QtWidgets/bug_569.py | 47 + sources/pyside2/tests/QtWidgets/bug_575.py | 48 + sources/pyside2/tests/QtWidgets/bug_576.py | 62 + sources/pyside2/tests/QtWidgets/bug_585.py | 54 + sources/pyside2/tests/QtWidgets/bug_589.py | 47 + sources/pyside2/tests/QtWidgets/bug_632.py | 48 + sources/pyside2/tests/QtWidgets/bug_635.py | 57 + sources/pyside2/tests/QtWidgets/bug_640.py | 39 + sources/pyside2/tests/QtWidgets/bug_653.py | 45 + sources/pyside2/tests/QtWidgets/bug_662.py | 57 + sources/pyside2/tests/QtWidgets/bug_667.py | 53 + sources/pyside2/tests/QtWidgets/bug_668.py | 50 + sources/pyside2/tests/QtWidgets/bug_674.py | 51 + sources/pyside2/tests/QtWidgets/bug_675.py | 43 + sources/pyside2/tests/QtWidgets/bug_688.py | 116 + sources/pyside2/tests/QtWidgets/bug_693.py | 58 + sources/pyside2/tests/QtWidgets/bug_696.py | 55 + sources/pyside2/tests/QtWidgets/bug_711.py | 53 + sources/pyside2/tests/QtWidgets/bug_714.py | 50 + sources/pyside2/tests/QtWidgets/bug_722.py | 52 + sources/pyside2/tests/QtWidgets/bug_728.py | 36 + sources/pyside2/tests/QtWidgets/bug_736.py | 47 + sources/pyside2/tests/QtWidgets/bug_750.py | 54 + sources/pyside2/tests/QtWidgets/bug_778.py | 50 + sources/pyside2/tests/QtWidgets/bug_785.py | 58 + sources/pyside2/tests/QtWidgets/bug_793.py | 58 + sources/pyside2/tests/QtWidgets/bug_811.py | 61 + sources/pyside2/tests/QtWidgets/bug_834.py | 46 + sources/pyside2/tests/QtWidgets/bug_836.py | 56 + sources/pyside2/tests/QtWidgets/bug_844.py | 46 + sources/pyside2/tests/QtWidgets/bug_854.py | 68 + sources/pyside2/tests/QtWidgets/bug_860.py | 63 + sources/pyside2/tests/QtWidgets/bug_862.py | 67 + sources/pyside2/tests/QtWidgets/bug_871.py | 70 + sources/pyside2/tests/QtWidgets/bug_879.py | 58 + sources/pyside2/tests/QtWidgets/bug_919.py | 66 + sources/pyside2/tests/QtWidgets/bug_921.py | 79 + sources/pyside2/tests/QtWidgets/bug_941.py | 45 + sources/pyside2/tests/QtWidgets/bug_964.py | 47 + sources/pyside2/tests/QtWidgets/bug_967.py | 46 + sources/pyside2/tests/QtWidgets/bug_972.py | 67 + sources/pyside2/tests/QtWidgets/bug_979.py | 37 + sources/pyside2/tests/QtWidgets/bug_988.py | 46 + sources/pyside2/tests/QtWidgets/bug_998.py | 38 + .../tests/QtWidgets/customproxywidget_test.py | 62 + .../pyside2/tests/QtWidgets/event_filter_test.py | 67 + .../tests/QtWidgets/grandparent_method_test.py | 50 + .../pyside2/tests/QtWidgets/hashabletype_test.py | 46 + sources/pyside2/tests/QtWidgets/import_test.py | 2 + .../pyside2/tests/QtWidgets/keep_reference_test.py | 103 + .../tests/QtWidgets/missing_symbols_test.py | 57 + .../pyside2/tests/QtWidgets/paint_event_test.py | 98 + .../pyside2/tests/QtWidgets/parent_method_test.py | 52 + .../tests/QtWidgets/python_properties_test.py | 44 + .../QtWidgets/qabstracttextdocumentlayout_test.py | 75 + sources/pyside2/tests/QtWidgets/qaction_test.py | 69 + sources/pyside2/tests/QtWidgets/qapp_test.py | 46 + .../QtWidgets/qapplication_exit_segfault_test.py | 44 + .../tests/QtWidgets/qapplication_singleton_test.py | 39 + sources/pyside2/tests/QtWidgets/qbrush_test.py | 52 + sources/pyside2/tests/QtWidgets/qdynamic_signal.py | 55 + .../pyside2/tests/QtWidgets/qfontdialog_test.py | 51 + .../pyside2/tests/QtWidgets/qformlayout_test.py | 84 + .../QtWidgets/qgraphicsitem_isblocked_test.py | 58 + .../pyside2/tests/QtWidgets/qgraphicsitem_test.py | 63 + .../tests/QtWidgets/qgraphicsproxywidget_test.py | 58 + .../pyside2/tests/QtWidgets/qgraphicsscene_test.py | 197 ++ sources/pyside2/tests/QtWidgets/qimage_test.py | 308 ++ .../tests/QtWidgets/qinputdialog_get_test.py | 52 + .../tests/QtWidgets/qkeysequenceedit_test.py | 46 + .../pyside2/tests/QtWidgets/qlayout_ref_test.py | 179 + sources/pyside2/tests/QtWidgets/qlayout_test.py | 140 + sources/pyside2/tests/QtWidgets/qlcdnumber_test.py | 44 + .../pyside2/tests/QtWidgets/qlistwidget_test.py | 82 + .../tests/QtWidgets/qlistwidgetitem_test.py | 56 + .../pyside2/tests/QtWidgets/qmainwindow_test.py | 113 + sources/pyside2/tests/QtWidgets/qmenu_test.py | 86 + sources/pyside2/tests/QtWidgets/qmenuadd_test.py | 53 + sources/pyside2/tests/QtWidgets/qobject_mi_test.py | 70 + sources/pyside2/tests/QtWidgets/qpen_test.py | 72 + sources/pyside2/tests/QtWidgets/qpicture_test.py | 66 + .../pyside2/tests/QtWidgets/qpixmap_constructor.py | 279 ++ .../pyside2/tests/QtWidgets/qpushbutton_test.py | 69 + sources/pyside2/tests/QtWidgets/qshortcut_test.py | 76 + sources/pyside2/tests/QtWidgets/qsplitter_test.py | 44 + .../tests/QtWidgets/qstandarditemmodel_test.py | 112 + .../tests/QtWidgets/qstring_qkeysequence_test.py | 61 + sources/pyside2/tests/QtWidgets/qstyle_test.py | 59 + sources/pyside2/tests/QtWidgets/qtableview_test.py | 44 + sources/pyside2/tests/QtWidgets/qtabwidget_test.py | 56 + .../tests/QtWidgets/qtextedit_signal_test.py | 65 + sources/pyside2/tests/QtWidgets/qtextedit_test.py | 60 + sources/pyside2/tests/QtWidgets/qtoolbar_test.py | 62 + sources/pyside2/tests/QtWidgets/qtoolbox_test.py | 59 + sources/pyside2/tests/QtWidgets/qvalidator_test.py | 114 + sources/pyside2/tests/QtWidgets/qvariant_test.py | 50 + .../tests/QtWidgets/qwidget_setlayout_test.py | 61 + sources/pyside2/tests/QtWidgets/qwidget_test.py | 55 + .../tests/QtWidgets/reference_count_test.py | 99 + .../QtWidgets/returnquadruplesofnumbers_test.py | 95 + sources/pyside2/tests/QtWidgets/sample.png | Bin 0 -> 55944 bytes .../pyside2/tests/QtWidgets/standardpixmap_test.py | 43 + .../tests/QtWidgets/test_module_template.py | 40 + .../virtual_protected_inheritance_test.py | 97 + .../tests/QtWidgets/virtual_pure_override_test.py | 77 + .../pyside2/tests/QtWidgets/wrong_return_test.py | 58 + sources/pyside2/tests/QtWinExtras/CMakeLists.txt | 1 + .../tests/QtWinExtras/this_module_loads_test.py | 39 + sources/pyside2/tests/QtX11Extras/CMakeLists.txt | 1 + .../tests/QtX11Extras/this_module_loads_test.py | 39 + sources/pyside2/tests/QtXml/CMakeLists.txt | 2 + sources/pyside2/tests/QtXml/qdomdocument_test.py | 96 + .../pyside2/tests/QtXml/qxmlsimplereader_test.py | 64 + sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt | 1 + sources/pyside2/tests/QtXmlPatterns/import_test.py | 58 + sources/pyside2/tests/mac/CMakeLists.txt | 1 + sources/pyside2/tests/mac/qmacstyle_test.py | 45 + sources/pyside2/tests/manually/README.txt | 5 + sources/pyside2/tests/manually/bug_841.py | 79 + sources/pyside2/tests/pysidetest/CMakeLists.txt | 120 + sources/pyside2/tests/pysidetest/bug_1016.py | 40 + sources/pyside2/tests/pysidetest/curr_errors.txt | 12 + .../pyside2/tests/pysidetest/decoratedslot_test.py | 67 + .../tests/pysidetest/delegatecreateseditor_test.py | 83 + sources/pyside2/tests/pysidetest/enum_test.py | 44 + sources/pyside2/tests/pysidetest/hiddenobject.cpp | 44 + sources/pyside2/tests/pysidetest/hiddenobject.h | 55 + .../pysidetest/homonymoussignalandmethod_test.py | 81 + .../pyside2/tests/pysidetest/list_signal_test.py | 51 + .../tests/pysidetest/mixin_signal_slots_test.py | 216 ++ sources/pyside2/tests/pysidetest/modelview_test.py | 99 + .../pysidetest/new_inherited_functions_test.py | 215 ++ sources/pyside2/tests/pysidetest/notify_id.py | 76 + .../pyside2/tests/pysidetest/pysidetest_global.h | 34 + sources/pyside2/tests/pysidetest/qvariant_test.py | 45 + .../tests/pysidetest/signal_slot_warning.py | 70 + .../tests/pysidetest/signalandnamespace_test.py | 120 + .../pysidetest/signalemissionfrompython_test.py | 107 + .../pysidetest/signalwithdefaultvalue_test.py | 95 + sources/pyside2/tests/pysidetest/symbols.filter | 7 + sources/pyside2/tests/pysidetest/testobject.cpp | 54 + sources/pyside2/tests/pysidetest/testobject.h | 140 + sources/pyside2/tests/pysidetest/testview.cpp | 52 + sources/pyside2/tests/pysidetest/testview.h | 61 + .../tests/pysidetest/typedef_signal_test.py | 54 + .../tests/pysidetest/typesystem_pysidetest.xml | 64 + sources/pyside2/tests/pysidetest/utils_test.py | 51 + sources/pyside2/tests/pysidetest/version_test.py | 45 + sources/pyside2/tests/run_test.sh | 41 + sources/pyside2/tests/signals/CMakeLists.txt | 40 + .../pyside2/tests/signals/args_dont_match_test.py | 50 + sources/pyside2/tests/signals/bug_189.py | 54 + sources/pyside2/tests/signals/bug_311.py | 70 + sources/pyside2/tests/signals/bug_312.py | 79 + sources/pyside2/tests/signals/bug_319.py | 63 + sources/pyside2/tests/signals/bug_79.py | 69 + sources/pyside2/tests/signals/decorators_test.py | 105 + sources/pyside2/tests/signals/disconnect_test.py | 88 + .../pyside2/tests/signals/invalid_callback_test.py | 56 + sources/pyside2/tests/signals/lambda_gui_test.py | 73 + sources/pyside2/tests/signals/lambda_test.py | 93 + .../pyside2/tests/signals/leaking_signal_test.py | 43 + .../tests/signals/multiple_connections_gui_test.py | 88 + .../tests/signals/multiple_connections_test.py | 103 + sources/pyside2/tests/signals/pysignal_test.py | 214 ++ .../tests/signals/qobject_destroyed_test.py | 50 + .../tests/signals/qobject_receivers_test.py | 76 + .../pyside2/tests/signals/qobject_sender_test.py | 120 + sources/pyside2/tests/signals/ref01_test.py | 55 + sources/pyside2/tests/signals/ref02_test.py | 75 + sources/pyside2/tests/signals/ref03_test.py | 57 + sources/pyside2/tests/signals/ref04_test.py | 84 + sources/pyside2/tests/signals/ref05_test.py | 74 + sources/pyside2/tests/signals/ref06_test.py | 77 + .../tests/signals/segfault_proxyparent_test.py | 86 + sources/pyside2/tests/signals/self_connect_test.py | 65 + .../pyside2/tests/signals/short_circuit_test.py | 91 + .../tests/signals/signal2signal_connect_test.py | 135 + .../tests/signals/signal_autoconnect_test.py | 59 + .../signals/signal_connectiontype_support_test.py | 55 + .../tests/signals/signal_emission_gui_test.py | 141 + .../pyside2/tests/signals/signal_emission_test.py | 152 + sources/pyside2/tests/signals/signal_func_test.py | 49 + .../tests/signals/signal_manager_refcount_test.py | 51 + .../tests/signals/signal_number_limit_test.py | 90 + .../pyside2/tests/signals/signal_object_test.py | 115 + .../pyside2/tests/signals/signal_signature_test.py | 76 + .../signals/signal_with_primitive_type_test.py | 58 + .../tests/signals/slot_reference_count_test.py | 81 + .../tests/signals/static_metaobject_test.py | 86 + .../pyside2/tests/tools/list-class-hierarchy.py | 117 + sources/pyside2/tests/util/color.py | 41 + sources/pyside2/tests/util/helper/__init__.py | 160 + sources/pyside2/tests/util/helper/docmodifier.py | 116 + sources/pyside2/tests/util/httpd.py | 177 + .../util/module_wrapper/PySide/QtAssistant.py | 2 + .../tests/util/module_wrapper/PySide/QtCore.py | 2 + .../tests/util/module_wrapper/PySide/QtDesigner.py | 2 + .../tests/util/module_wrapper/PySide/QtGui.py | 2 + .../tests/util/module_wrapper/PySide/QtHelp.py | 2 + .../tests/util/module_wrapper/PySide/QtNetwork.py | 2 + .../tests/util/module_wrapper/PySide/QtScript.py | 2 + .../tests/util/module_wrapper/PySide/QtSql.py | 2 + .../tests/util/module_wrapper/PySide/QtSvg.py | 2 + .../tests/util/module_wrapper/PySide/QtTest.py | 2 + .../tests/util/module_wrapper/PySide/QtWebKit.py | 2 + .../tests/util/module_wrapper/PySide/QtXml.py | 2 + .../util/module_wrapper/PySide/QtXmlPatterns.py | 2 + .../tests/util/module_wrapper/PySide/__init__.py | 0 sources/pyside2/tests/util/processtimer.py | 77 + sources/pyside2/tests/util/py2xfunctions.py | 46 + sources/pyside2/tests/util/py3kcompat.py | 38 + sources/pyside2/tests/util/py3xfunctions.py | 54 + sources/pyside2/tests/util/pyqt_diff.py | 64 + sources/pyside2/tests/util/pyqtcheck.py | 74 + sources/pyside2/tests/util/rename_imports.sh | 42 + sources/pyside2/tests/util/test_processtimer.py | 93 + sources/pyside2/tests/util/use_pyqt4.sh | 3 + sources/pyside2/tests/util/use_pyside.sh | 3 + sources/pyside2/tests/util/valgrind-python.supp | 349 ++ 565 files changed, 39205 insertions(+) create mode 100644 sources/pyside2/tests/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtConcurrent/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtConcurrent/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtCore/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtCore/blocking_signals_test.py create mode 100644 sources/pyside2/tests/QtCore/bug_1019.py create mode 100644 sources/pyside2/tests/QtCore/bug_1031.py create mode 100644 sources/pyside2/tests/QtCore/bug_1063.py create mode 100644 sources/pyside2/tests/QtCore/bug_1069.py create mode 100644 sources/pyside2/tests/QtCore/bug_278_test.py create mode 100644 sources/pyside2/tests/QtCore/bug_332.py create mode 100644 sources/pyside2/tests/QtCore/bug_408.py create mode 100644 sources/pyside2/tests/QtCore/bug_428.py create mode 100644 sources/pyside2/tests/QtCore/bug_462.py create mode 100644 sources/pyside2/tests/QtCore/bug_505.py create mode 100644 sources/pyside2/tests/QtCore/bug_515.py create mode 100644 sources/pyside2/tests/QtCore/bug_606.py create mode 100644 sources/pyside2/tests/QtCore/bug_656.py create mode 100644 sources/pyside2/tests/QtCore/bug_686.py create mode 100644 sources/pyside2/tests/QtCore/bug_699.py create mode 100644 sources/pyside2/tests/QtCore/bug_706.py create mode 100644 sources/pyside2/tests/QtCore/bug_820.py create mode 100644 sources/pyside2/tests/QtCore/bug_826.py create mode 100644 sources/pyside2/tests/QtCore/bug_829.py create mode 100644 sources/pyside2/tests/QtCore/bug_835.py create mode 100644 sources/pyside2/tests/QtCore/bug_920.py create mode 100644 sources/pyside2/tests/QtCore/bug_927.py create mode 100644 sources/pyside2/tests/QtCore/bug_931.py create mode 100644 sources/pyside2/tests/QtCore/bug_938.py create mode 100644 sources/pyside2/tests/QtCore/bug_953.py create mode 100644 sources/pyside2/tests/QtCore/bug_987.py create mode 100644 sources/pyside2/tests/QtCore/bug_994.py create mode 100644 sources/pyside2/tests/QtCore/bug_PYSIDE-164.py create mode 100644 sources/pyside2/tests/QtCore/bug_PYSIDE-42.py create mode 100644 sources/pyside2/tests/QtCore/child_event_test.py create mode 100644 sources/pyside2/tests/QtCore/classinfo_test.py create mode 100644 sources/pyside2/tests/QtCore/deepcopy_test.py create mode 100644 sources/pyside2/tests/QtCore/deletelater_test.py create mode 100644 sources/pyside2/tests/QtCore/destroysignal_test.py create mode 100644 sources/pyside2/tests/QtCore/duck_punching_test.py create mode 100644 sources/pyside2/tests/QtCore/hash_test.py create mode 100644 sources/pyside2/tests/QtCore/inherits_test.py create mode 100644 sources/pyside2/tests/QtCore/max_signals.py create mode 100644 sources/pyside2/tests/QtCore/missing_symbols_test.py create mode 100644 sources/pyside2/tests/QtCore/mockclass_test.py create mode 100644 sources/pyside2/tests/QtCore/python_conversion.py create mode 100644 sources/pyside2/tests/QtCore/qabs_test.py create mode 100644 sources/pyside2/tests/QtCore/qabstractitemmodel_test.py create mode 100644 sources/pyside2/tests/QtCore/qabstracttransition_test.py create mode 100644 sources/pyside2/tests/QtCore/qanimationgroup_test.py create mode 100644 sources/pyside2/tests/QtCore/qbitarray_test.py create mode 100644 sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py create mode 100644 sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py create mode 100644 sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py create mode 100644 sources/pyside2/tests/QtCore/qbytearray_operator_test.py create mode 100644 sources/pyside2/tests/QtCore/qbytearray_test.py create mode 100644 sources/pyside2/tests/QtCore/qcollator_test.py create mode 100644 sources/pyside2/tests/QtCore/qcommandlineparser_test.py create mode 100644 sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py create mode 100644 sources/pyside2/tests/QtCore/qdatastream_test.py create mode 100644 sources/pyside2/tests/QtCore/qdate_test.py create mode 100644 sources/pyside2/tests/QtCore/qdatetime_test.py create mode 100644 sources/pyside2/tests/QtCore/qeasingcurve_test.py create mode 100644 sources/pyside2/tests/QtCore/qenum_test.py create mode 100644 sources/pyside2/tests/QtCore/qevent_test.py create mode 100644 sources/pyside2/tests/QtCore/qfile_test.py create mode 100644 sources/pyside2/tests/QtCore/qfileinfo_test.py create mode 100644 sources/pyside2/tests/QtCore/qflags_test.py create mode 100644 sources/pyside2/tests/QtCore/qhandle_test.py create mode 100644 sources/pyside2/tests/QtCore/qinstallmsghandler_test.py create mode 100644 sources/pyside2/tests/QtCore/qlinef_test.py create mode 100644 sources/pyside2/tests/QtCore/qlocale_test.py create mode 100644 sources/pyside2/tests/QtCore/qmetaobject_test.py create mode 100644 sources/pyside2/tests/QtCore/qmimedatabase_test.py create mode 100644 sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_children_segfault_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_connect_notify_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_destructor.py create mode 100644 sources/pyside2/tests/QtCore/qobject_event_filter_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_inherits_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_objectproperty_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_parent_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_property_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_protected_methods_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_timer_event_test.py create mode 100644 sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py create mode 100644 sources/pyside2/tests/QtCore/qpoint_test.py create mode 100644 sources/pyside2/tests/QtCore/qprocess_test.py create mode 100644 sources/pyside2/tests/QtCore/qproperty_decorator.py create mode 100644 sources/pyside2/tests/QtCore/qrect_test.py create mode 100644 sources/pyside2/tests/QtCore/qregexp_test.py create mode 100644 sources/pyside2/tests/QtCore/qresource_test.py create mode 100644 sources/pyside2/tests/QtCore/qsize_test.py create mode 100644 sources/pyside2/tests/QtCore/qslot_object_test.py create mode 100644 sources/pyside2/tests/QtCore/qsrand_test.py create mode 100644 sources/pyside2/tests/QtCore/qstandardpaths_test.py create mode 100644 sources/pyside2/tests/QtCore/qstate_test.py create mode 100644 sources/pyside2/tests/QtCore/qstatemachine_test.py create mode 100644 sources/pyside2/tests/QtCore/qstorageinfo_test.py create mode 100644 sources/pyside2/tests/QtCore/qstring_test.py create mode 100644 sources/pyside2/tests/QtCore/qsysinfo_test.py create mode 100644 sources/pyside2/tests/QtCore/qtext_codec_test.py create mode 100644 sources/pyside2/tests/QtCore/qtextstream_test.py create mode 100644 sources/pyside2/tests/QtCore/qthread_prod_cons_test.py create mode 100644 sources/pyside2/tests/QtCore/qthread_signal_test.py create mode 100644 sources/pyside2/tests/QtCore/qthread_test.py create mode 100644 sources/pyside2/tests/QtCore/qtimer_singleshot_test.py create mode 100644 sources/pyside2/tests/QtCore/qtimer_timeout_test.py create mode 100644 sources/pyside2/tests/QtCore/qtnamespace_test.py create mode 100644 sources/pyside2/tests/QtCore/quoteEnUS.txt create mode 100644 sources/pyside2/tests/QtCore/qurl_test.py create mode 100644 sources/pyside2/tests/QtCore/repr_test.py create mode 100644 sources/pyside2/tests/QtCore/resources.qrc create mode 100644 sources/pyside2/tests/QtCore/resources_mc.py create mode 100644 sources/pyside2/tests/QtCore/sample.png create mode 100644 sources/pyside2/tests/QtCore/setprop_on_ctor_test.py create mode 100644 sources/pyside2/tests/QtCore/staticMetaObject_test.py create mode 100644 sources/pyside2/tests/QtCore/static_method_test.py create mode 100644 sources/pyside2/tests/QtCore/static_protected_methods_test.py create mode 100644 sources/pyside2/tests/QtCore/thread_signals_test.py create mode 100644 sources/pyside2/tests/QtCore/tr_noop_test.py create mode 100644 sources/pyside2/tests/QtCore/translation_test.py create mode 100644 sources/pyside2/tests/QtCore/translations/trans_latin.qm create mode 100644 sources/pyside2/tests/QtCore/translations/trans_latin.ts create mode 100644 sources/pyside2/tests/QtCore/translations/trans_russian.qm create mode 100644 sources/pyside2/tests/QtCore/translations/trans_russian.ts create mode 100644 sources/pyside2/tests/QtCore/unaryoperator_test.py create mode 100644 sources/pyside2/tests/QtCore/unicode_test.py create mode 100644 sources/pyside2/tests/QtCore/versioninfo_test.py create mode 100644 sources/pyside2/tests/QtDesigner/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtDesigner/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtGui/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtGui/bug_1091.py create mode 100644 sources/pyside2/tests/QtGui/bug_300_test.py create mode 100644 sources/pyside2/tests/QtGui/bug_367.py create mode 100644 sources/pyside2/tests/QtGui/bug_480.py create mode 100644 sources/pyside2/tests/QtGui/bug_500.py create mode 100644 sources/pyside2/tests/QtGui/bug_606.py create mode 100644 sources/pyside2/tests/QtGui/bug_617.py create mode 100644 sources/pyside2/tests/QtGui/bug_652.py create mode 100644 sources/pyside2/tests/QtGui/bug_660.py create mode 100644 sources/pyside2/tests/QtGui/bug_716.py create mode 100644 sources/pyside2/tests/QtGui/bug_740.py create mode 100644 sources/pyside2/tests/QtGui/bug_743.py create mode 100644 sources/pyside2/tests/QtGui/bug_991.py create mode 100644 sources/pyside2/tests/QtGui/bug_PYSIDE-344.py create mode 100644 sources/pyside2/tests/QtGui/bug_PYSIDE-41.py create mode 100644 sources/pyside2/tests/QtGui/deepcopy_test.py create mode 100644 sources/pyside2/tests/QtGui/float_to_int_implicit_conversion_test.py create mode 100644 sources/pyside2/tests/QtGui/pyside_reload_test.py create mode 100644 sources/pyside2/tests/QtGui/qcolor_reduce_test.py create mode 100644 sources/pyside2/tests/QtGui/qcolor_test.py create mode 100644 sources/pyside2/tests/QtGui/qcursor_test.py create mode 100644 sources/pyside2/tests/QtGui/qdatastream_gui_operators_test.py create mode 100644 sources/pyside2/tests/QtGui/qdesktopservices_test.py create mode 100644 sources/pyside2/tests/QtGui/qfontmetrics_test.py create mode 100644 sources/pyside2/tests/QtGui/qicon_test.py create mode 100644 sources/pyside2/tests/QtGui/qitemselection_test.py create mode 100644 sources/pyside2/tests/QtGui/qkeysequence_test.py create mode 100644 sources/pyside2/tests/QtGui/qmatrix_test.py create mode 100644 sources/pyside2/tests/QtGui/qopenglbuffer_test.py create mode 100644 sources/pyside2/tests/QtGui/qpainter_test.py create mode 100644 sources/pyside2/tests/QtGui/qpdfwriter_test.py create mode 100644 sources/pyside2/tests/QtGui/qpixelformat_test.py create mode 100644 sources/pyside2/tests/QtGui/qpixmap_test.py create mode 100644 sources/pyside2/tests/QtGui/qpixmapcache_test.py create mode 100644 sources/pyside2/tests/QtGui/qpolygonf_test.py create mode 100644 sources/pyside2/tests/QtGui/qradialgradient_test.py create mode 100644 sources/pyside2/tests/QtGui/qrasterwindow_test.py create mode 100644 sources/pyside2/tests/QtGui/qregion_test.py create mode 100644 sources/pyside2/tests/QtGui/qstylehints_test.py create mode 100644 sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py create mode 100644 sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py create mode 100644 sources/pyside2/tests/QtGui/qtextline_test.py create mode 100644 sources/pyside2/tests/QtGui/qtransform_test.py create mode 100644 sources/pyside2/tests/QtGui/repr_test.py create mode 100644 sources/pyside2/tests/QtGui/sample.png create mode 100644 sources/pyside2/tests/QtGui/timed_app_test.py create mode 100644 sources/pyside2/tests/QtHelp/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtHelp/help_test.py create mode 100644 sources/pyside2/tests/QtMacExtras/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtMacExtras/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtMultimedia/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtMultimedia/audio_test.py create mode 100644 sources/pyside2/tests/QtMultimediaWidgets/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py create mode 100644 sources/pyside2/tests/QtNetwork/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtNetwork/accessManager_test.py create mode 100644 sources/pyside2/tests/QtNetwork/bug_1084.py create mode 100644 sources/pyside2/tests/QtNetwork/bug_446.py create mode 100644 sources/pyside2/tests/QtNetwork/qipv6address_test.py create mode 100644 sources/pyside2/tests/QtNetwork/tcpserver_test.py create mode 100644 sources/pyside2/tests/QtNetwork/udpsocket_test.py create mode 100644 sources/pyside2/tests/QtOpenGL/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtOpenGL/qglbuffer_test.py create mode 100644 sources/pyside2/tests/QtOpenGL/qglwidget_test.py create mode 100644 sources/pyside2/tests/QtPrintSupport/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtPrintSupport/this_module_loads_test.py create mode 100755 sources/pyside2/tests/QtQml/CMakeLists.txt create mode 100755 sources/pyside2/tests/QtQml/bug_1029.py create mode 100755 sources/pyside2/tests/QtQml/bug_1029.qml create mode 100755 sources/pyside2/tests/QtQml/bug_451.py create mode 100755 sources/pyside2/tests/QtQml/bug_451.qml create mode 100755 sources/pyside2/tests/QtQml/bug_456.py create mode 100755 sources/pyside2/tests/QtQml/bug_456.qml create mode 100755 sources/pyside2/tests/QtQml/bug_557.py create mode 100755 sources/pyside2/tests/QtQml/bug_726.py create mode 100755 sources/pyside2/tests/QtQml/bug_726.qml create mode 100755 sources/pyside2/tests/QtQml/bug_814.py create mode 100755 sources/pyside2/tests/QtQml/bug_814.qml create mode 100755 sources/pyside2/tests/QtQml/bug_825.py create mode 100755 sources/pyside2/tests/QtQml/bug_825.qml create mode 100755 sources/pyside2/tests/QtQml/bug_847.py create mode 100755 sources/pyside2/tests/QtQml/bug_847.qml create mode 100755 sources/pyside2/tests/QtQml/bug_915.py create mode 100755 sources/pyside2/tests/QtQml/bug_926.py create mode 100755 sources/pyside2/tests/QtQml/bug_926.qml create mode 100755 sources/pyside2/tests/QtQml/bug_951.py create mode 100755 sources/pyside2/tests/QtQml/bug_951.qml create mode 100755 sources/pyside2/tests/QtQml/bug_995.py create mode 100755 sources/pyside2/tests/QtQml/bug_995.qml create mode 100755 sources/pyside2/tests/QtQml/bug_997.py create mode 100755 sources/pyside2/tests/QtQml/bug_997.qml create mode 100644 sources/pyside2/tests/QtQml/connect_python_qml.py create mode 100755 sources/pyside2/tests/QtQml/connect_python_qml.qml create mode 100755 sources/pyside2/tests/QtQml/hw.qml create mode 100644 sources/pyside2/tests/QtQml/javascript_exceptions.py create mode 100644 sources/pyside2/tests/QtQml/javascript_exceptions.qml create mode 100644 sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py create mode 100644 sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.qml create mode 100644 sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile_component.qml create mode 100755 sources/pyside2/tests/QtQml/qqmlnetwork_test.py create mode 100644 sources/pyside2/tests/QtQml/qquickitem_grabToImage.py create mode 100644 sources/pyside2/tests/QtQml/qquickitem_grabToImage.qml create mode 100755 sources/pyside2/tests/QtQml/qquickview_test.py create mode 100755 sources/pyside2/tests/QtQml/registertype.py create mode 100755 sources/pyside2/tests/QtQml/registertype.qml create mode 100755 sources/pyside2/tests/QtQml/view.qml create mode 100755 sources/pyside2/tests/QtQml/viewmodel.qml create mode 100644 sources/pyside2/tests/QtQuick/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtQuick/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtQuickWidgets/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtQuickWidgets/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtScript/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtScript/base_test.py create mode 100644 sources/pyside2/tests/QtScript/bug_1022.py create mode 100644 sources/pyside2/tests/QtScript/engine_test.py create mode 100644 sources/pyside2/tests/QtScript/property_test.py create mode 100644 sources/pyside2/tests/QtScript/qscriptvalue_test.py create mode 100644 sources/pyside2/tests/QtScriptTools/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtScriptTools/debugger_test.py create mode 100644 sources/pyside2/tests/QtSql/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtSql/bug_1013.py create mode 100644 sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py create mode 100644 sources/pyside2/tests/QtSql/qvarianttype_test.py create mode 100644 sources/pyside2/tests/QtSvg/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtSvg/qsvggenerator_test.py create mode 100644 sources/pyside2/tests/QtSvg/qsvgrenderer_test.py create mode 100644 sources/pyside2/tests/QtSvg/qsvgwidget_test.py create mode 100644 sources/pyside2/tests/QtSvg/tiger.svg create mode 100644 sources/pyside2/tests/QtTest/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtTest/click_test.py create mode 100644 sources/pyside2/tests/QtTest/eventfilter_test.py create mode 100644 sources/pyside2/tests/QtTest/touchevent_test.py create mode 100644 sources/pyside2/tests/QtUiTools/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtUiTools/action.ui create mode 100644 sources/pyside2/tests/QtUiTools/bug_1060.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_1060.ui create mode 100644 sources/pyside2/tests/QtUiTools/bug_360.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_376.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_392.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_426.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_426.ui create mode 100644 sources/pyside2/tests/QtUiTools/bug_552.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_552.ui create mode 100644 sources/pyside2/tests/QtUiTools/bug_797.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_909.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_909.ui create mode 100644 sources/pyside2/tests/QtUiTools/bug_913.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_913.ui create mode 100644 sources/pyside2/tests/QtUiTools/bug_958.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_958.ui create mode 100644 sources/pyside2/tests/QtUiTools/bug_965.py create mode 100644 sources/pyside2/tests/QtUiTools/bug_965.ui create mode 100644 sources/pyside2/tests/QtUiTools/minimal.ui create mode 100644 sources/pyside2/tests/QtUiTools/pycustomwidget.ui create mode 100644 sources/pyside2/tests/QtUiTools/pycustomwidget2.ui create mode 100644 sources/pyside2/tests/QtUiTools/test.ui create mode 100644 sources/pyside2/tests/QtUiTools/ui_test.py create mode 100644 sources/pyside2/tests/QtUiTools/uiloader_test.py create mode 100644 sources/pyside2/tests/QtWebChannel/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtWebChannel/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtWebEngine/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtWebEngine/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtWebEngineWidgets/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py create mode 100644 sources/pyside2/tests/QtWebEngineWidgets/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtWebKit/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtWebKit/bug_448.py create mode 100644 sources/pyside2/tests/QtWebKit/bug_694.py create mode 100644 sources/pyside2/tests/QtWebKit/bug_803.py create mode 100644 sources/pyside2/tests/QtWebKit/bug_899.py create mode 100644 sources/pyside2/tests/QtWebKit/bug_959.py create mode 100644 sources/pyside2/tests/QtWebKit/fox.html create mode 100644 sources/pyside2/tests/QtWebKit/qml_plugin_test.py create mode 100644 sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys create mode 100644 sources/pyside2/tests/QtWebKit/qmlplugin/index.html create mode 100644 sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py create mode 100644 sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py create mode 100644 sources/pyside2/tests/QtWebKit/webframe_test.py create mode 100644 sources/pyside2/tests/QtWebKit/webpage_test.py create mode 100644 sources/pyside2/tests/QtWebKit/webview_test.py create mode 100644 sources/pyside2/tests/QtWebKitWidgets/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtWebKitWidgets/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtWebSockets/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtWebSockets/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtWidgets/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtWidgets/action_clear.py create mode 100644 sources/pyside2/tests/QtWidgets/add_action_test.py create mode 100644 sources/pyside2/tests/QtWidgets/api2_test.py create mode 100644 sources/pyside2/tests/QtWidgets/application_test.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_1002.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_1006.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_1048.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_1077.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_172.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_243.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_307.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_324.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_338.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_363.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_389.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_400.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_416.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_429.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_430.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_433.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_467.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_493.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_512.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_525.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_546.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_547.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_549.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_569.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_575.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_576.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_585.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_589.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_632.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_635.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_640.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_653.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_662.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_667.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_668.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_674.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_675.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_688.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_693.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_696.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_711.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_714.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_722.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_728.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_736.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_750.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_778.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_785.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_793.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_811.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_834.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_836.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_844.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_854.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_860.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_862.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_871.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_879.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_919.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_921.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_941.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_964.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_967.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_972.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_979.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_988.py create mode 100644 sources/pyside2/tests/QtWidgets/bug_998.py create mode 100644 sources/pyside2/tests/QtWidgets/customproxywidget_test.py create mode 100644 sources/pyside2/tests/QtWidgets/event_filter_test.py create mode 100644 sources/pyside2/tests/QtWidgets/grandparent_method_test.py create mode 100644 sources/pyside2/tests/QtWidgets/hashabletype_test.py create mode 100644 sources/pyside2/tests/QtWidgets/import_test.py create mode 100644 sources/pyside2/tests/QtWidgets/keep_reference_test.py create mode 100644 sources/pyside2/tests/QtWidgets/missing_symbols_test.py create mode 100644 sources/pyside2/tests/QtWidgets/paint_event_test.py create mode 100644 sources/pyside2/tests/QtWidgets/parent_method_test.py create mode 100644 sources/pyside2/tests/QtWidgets/python_properties_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qaction_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qapp_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qapplication_exit_segfault_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qapplication_singleton_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qbrush_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qdynamic_signal.py create mode 100644 sources/pyside2/tests/QtWidgets/qfontdialog_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qformlayout_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qgraphicsitem_isblocked_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qgraphicsitem_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qgraphicsproxywidget_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qgraphicsscene_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qimage_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qlayout_ref_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qlayout_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qlcdnumber_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qlistwidget_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qmainwindow_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qmenu_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qmenuadd_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qobject_mi_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qpen_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qpicture_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qpixmap_constructor.py create mode 100644 sources/pyside2/tests/QtWidgets/qpushbutton_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qshortcut_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qsplitter_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qstyle_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qtableview_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qtabwidget_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qtextedit_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qtoolbar_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qtoolbox_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qvalidator_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qvariant_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py create mode 100644 sources/pyside2/tests/QtWidgets/qwidget_test.py create mode 100644 sources/pyside2/tests/QtWidgets/reference_count_test.py create mode 100644 sources/pyside2/tests/QtWidgets/returnquadruplesofnumbers_test.py create mode 100644 sources/pyside2/tests/QtWidgets/sample.png create mode 100644 sources/pyside2/tests/QtWidgets/standardpixmap_test.py create mode 100644 sources/pyside2/tests/QtWidgets/test_module_template.py create mode 100644 sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py create mode 100644 sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py create mode 100644 sources/pyside2/tests/QtWidgets/wrong_return_test.py create mode 100644 sources/pyside2/tests/QtWinExtras/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtWinExtras/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtX11Extras/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtX11Extras/this_module_loads_test.py create mode 100644 sources/pyside2/tests/QtXml/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtXml/qdomdocument_test.py create mode 100644 sources/pyside2/tests/QtXml/qxmlsimplereader_test.py create mode 100644 sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt create mode 100644 sources/pyside2/tests/QtXmlPatterns/import_test.py create mode 100644 sources/pyside2/tests/mac/CMakeLists.txt create mode 100644 sources/pyside2/tests/mac/qmacstyle_test.py create mode 100644 sources/pyside2/tests/manually/README.txt create mode 100644 sources/pyside2/tests/manually/bug_841.py create mode 100644 sources/pyside2/tests/pysidetest/CMakeLists.txt create mode 100644 sources/pyside2/tests/pysidetest/bug_1016.py create mode 100644 sources/pyside2/tests/pysidetest/curr_errors.txt create mode 100644 sources/pyside2/tests/pysidetest/decoratedslot_test.py create mode 100644 sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py create mode 100644 sources/pyside2/tests/pysidetest/enum_test.py create mode 100644 sources/pyside2/tests/pysidetest/hiddenobject.cpp create mode 100644 sources/pyside2/tests/pysidetest/hiddenobject.h create mode 100644 sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py create mode 100644 sources/pyside2/tests/pysidetest/list_signal_test.py create mode 100644 sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py create mode 100644 sources/pyside2/tests/pysidetest/modelview_test.py create mode 100644 sources/pyside2/tests/pysidetest/new_inherited_functions_test.py create mode 100644 sources/pyside2/tests/pysidetest/notify_id.py create mode 100644 sources/pyside2/tests/pysidetest/pysidetest_global.h create mode 100644 sources/pyside2/tests/pysidetest/qvariant_test.py create mode 100644 sources/pyside2/tests/pysidetest/signal_slot_warning.py create mode 100644 sources/pyside2/tests/pysidetest/signalandnamespace_test.py create mode 100644 sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py create mode 100644 sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py create mode 100644 sources/pyside2/tests/pysidetest/symbols.filter create mode 100644 sources/pyside2/tests/pysidetest/testobject.cpp create mode 100644 sources/pyside2/tests/pysidetest/testobject.h create mode 100644 sources/pyside2/tests/pysidetest/testview.cpp create mode 100644 sources/pyside2/tests/pysidetest/testview.h create mode 100644 sources/pyside2/tests/pysidetest/typedef_signal_test.py create mode 100644 sources/pyside2/tests/pysidetest/typesystem_pysidetest.xml create mode 100644 sources/pyside2/tests/pysidetest/utils_test.py create mode 100644 sources/pyside2/tests/pysidetest/version_test.py create mode 100755 sources/pyside2/tests/run_test.sh create mode 100644 sources/pyside2/tests/signals/CMakeLists.txt create mode 100644 sources/pyside2/tests/signals/args_dont_match_test.py create mode 100644 sources/pyside2/tests/signals/bug_189.py create mode 100644 sources/pyside2/tests/signals/bug_311.py create mode 100644 sources/pyside2/tests/signals/bug_312.py create mode 100644 sources/pyside2/tests/signals/bug_319.py create mode 100644 sources/pyside2/tests/signals/bug_79.py create mode 100644 sources/pyside2/tests/signals/decorators_test.py create mode 100644 sources/pyside2/tests/signals/disconnect_test.py create mode 100644 sources/pyside2/tests/signals/invalid_callback_test.py create mode 100644 sources/pyside2/tests/signals/lambda_gui_test.py create mode 100644 sources/pyside2/tests/signals/lambda_test.py create mode 100644 sources/pyside2/tests/signals/leaking_signal_test.py create mode 100644 sources/pyside2/tests/signals/multiple_connections_gui_test.py create mode 100644 sources/pyside2/tests/signals/multiple_connections_test.py create mode 100644 sources/pyside2/tests/signals/pysignal_test.py create mode 100644 sources/pyside2/tests/signals/qobject_destroyed_test.py create mode 100644 sources/pyside2/tests/signals/qobject_receivers_test.py create mode 100644 sources/pyside2/tests/signals/qobject_sender_test.py create mode 100644 sources/pyside2/tests/signals/ref01_test.py create mode 100644 sources/pyside2/tests/signals/ref02_test.py create mode 100644 sources/pyside2/tests/signals/ref03_test.py create mode 100644 sources/pyside2/tests/signals/ref04_test.py create mode 100644 sources/pyside2/tests/signals/ref05_test.py create mode 100644 sources/pyside2/tests/signals/ref06_test.py create mode 100644 sources/pyside2/tests/signals/segfault_proxyparent_test.py create mode 100644 sources/pyside2/tests/signals/self_connect_test.py create mode 100644 sources/pyside2/tests/signals/short_circuit_test.py create mode 100644 sources/pyside2/tests/signals/signal2signal_connect_test.py create mode 100644 sources/pyside2/tests/signals/signal_autoconnect_test.py create mode 100644 sources/pyside2/tests/signals/signal_connectiontype_support_test.py create mode 100644 sources/pyside2/tests/signals/signal_emission_gui_test.py create mode 100644 sources/pyside2/tests/signals/signal_emission_test.py create mode 100644 sources/pyside2/tests/signals/signal_func_test.py create mode 100644 sources/pyside2/tests/signals/signal_manager_refcount_test.py create mode 100644 sources/pyside2/tests/signals/signal_number_limit_test.py create mode 100644 sources/pyside2/tests/signals/signal_object_test.py create mode 100644 sources/pyside2/tests/signals/signal_signature_test.py create mode 100644 sources/pyside2/tests/signals/signal_with_primitive_type_test.py create mode 100644 sources/pyside2/tests/signals/slot_reference_count_test.py create mode 100644 sources/pyside2/tests/signals/static_metaobject_test.py create mode 100755 sources/pyside2/tests/tools/list-class-hierarchy.py create mode 100644 sources/pyside2/tests/util/color.py create mode 100644 sources/pyside2/tests/util/helper/__init__.py create mode 100644 sources/pyside2/tests/util/helper/docmodifier.py create mode 100644 sources/pyside2/tests/util/httpd.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtAssistant.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtCore.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtDesigner.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtGui.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtHelp.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtNetwork.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtScript.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtSql.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtSvg.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtTest.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtWebKit.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtXml.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/QtXmlPatterns.py create mode 100644 sources/pyside2/tests/util/module_wrapper/PySide/__init__.py create mode 100644 sources/pyside2/tests/util/processtimer.py create mode 100644 sources/pyside2/tests/util/py2xfunctions.py create mode 100644 sources/pyside2/tests/util/py3kcompat.py create mode 100644 sources/pyside2/tests/util/py3xfunctions.py create mode 100644 sources/pyside2/tests/util/pyqt_diff.py create mode 100644 sources/pyside2/tests/util/pyqtcheck.py create mode 100755 sources/pyside2/tests/util/rename_imports.sh create mode 100644 sources/pyside2/tests/util/test_processtimer.py create mode 100644 sources/pyside2/tests/util/use_pyqt4.sh create mode 100644 sources/pyside2/tests/util/use_pyside.sh create mode 100644 sources/pyside2/tests/util/valgrind-python.supp (limited to 'sources/pyside2/tests') diff --git a/sources/pyside2/tests/CMakeLists.txt b/sources/pyside2/tests/CMakeLists.txt new file mode 100644 index 000000000..2b7e3b0e1 --- /dev/null +++ b/sources/pyside2/tests/CMakeLists.txt @@ -0,0 +1,61 @@ +if(CMAKE_VERSION VERSION_LESS 2.8) + message("CMake version greater than 2.8 necessary to run tests") +else() + if(NOT CTEST_TESTING_TIMEOUT) + set(CTEST_TESTING_TIMEOUT 60) + endif() + + # tests/QtWidgets/qstandarditemmodel_test.py needs shiboken2 + if(WIN32) + set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util;${CMAKE_BINARY_DIR}/tests/pysidetest;${CMAKE_BINARY_DIR}/../shiboken2/shibokenmodule;$ENV{PYTHONPATH}") + set(TEST_LIBRARY_PATH "${libpyside_BINARY_DIR};${pysidetest_BINARY_DIR};${SHIBOKEN_INCLUDE_DIR}/../../bin;$ENV{PATH}") + set(LIBRARY_PATH_VAR "PATH") + string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}") + string(REPLACE "\\" "/" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}") + + string(REPLACE ";" "\\;" TEST_PYTHONPATH "${TEST_PYTHONPATH}") + string(REPLACE ";" "\\;" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}") + else() + set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util:${CMAKE_BINARY_DIR}/tests/pysidetest:${CMAKE_BINARY_DIR}/../shiboken2/shibokenmodule:$ENV{PYTHONPATH}") + set(TEST_LIBRARY_PATH "${libpyside_BINARY_DIR}:${pysidetest_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}") + set(LIBRARY_PATH_VAR "LD_LIBRARY_PATH") + endif() + + + macro(TEST_QT_MODULE var name) + if(NOT DISABLE_${name} AND ${var}) + add_subdirectory(${name}) + endif() + endmacro() + + macro(PYSIDE_TEST) + string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" ) + set(TEST_NAME "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") + if (${ARGC} EQUAL 1) + set(EXPECT_TO_FAIL 0) + elseif(${ARGC} EQUAL 2) + set(EXPECT_TO_FAIL ${ARGV1}) + else() + message(WARNING "Invalid call of macro PYSIDE_TEST") + endif() + set(TEST_CMD ${XVFB_EXEC} ${SHIBOKEN_PYTHON_INTERPRETER} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}") + add_test(${TEST_NAME} ${TEST_CMD}) + set_tests_properties(${TEST_NAME} PROPERTIES + TIMEOUT ${CTEST_TESTING_TIMEOUT} + WILL_FAIL ${EXPECT_TO_FAIL} + ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH}") + endmacro() + + add_subdirectory(pysidetest) + add_subdirectory(signals) + + foreach(shortname IN LISTS all_module_shortnames) + message(STATUS "preparing tests for module 'Qt${shortname}'") + TEST_QT_MODULE(Qt5${shortname}_FOUND Qt${shortname}) + endforeach() + + #platform specific + if (ENABLE_MAC) + add_subdirectory(mac) + endif () +endif() diff --git a/sources/pyside2/tests/QtConcurrent/CMakeLists.txt b/sources/pyside2/tests/QtConcurrent/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtConcurrent/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtConcurrent/this_module_loads_test.py b/sources/pyside2/tests/QtConcurrent/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtConcurrent/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtCore/CMakeLists.txt b/sources/pyside2/tests/QtCore/CMakeLists.txt new file mode 100644 index 000000000..436af3dac --- /dev/null +++ b/sources/pyside2/tests/QtCore/CMakeLists.txt @@ -0,0 +1,121 @@ +PYSIDE_TEST(bug_278_test.py) +PYSIDE_TEST(bug_332.py) +PYSIDE_TEST(bug_408.py) +PYSIDE_TEST(bug_428.py) +PYSIDE_TEST(bug_462.py) +PYSIDE_TEST(bug_505.py) +PYSIDE_TEST(bug_515.py) +PYSIDE_TEST(bug_606.py) +PYSIDE_TEST(bug_656.py) +PYSIDE_TEST(bug_686.py) +PYSIDE_TEST(bug_699.py) +PYSIDE_TEST(bug_706.py) +PYSIDE_TEST(bug_820.py) +PYSIDE_TEST(bug_826.py) +PYSIDE_TEST(bug_829.py) +PYSIDE_TEST(bug_835.py) +PYSIDE_TEST(bug_920.py) +PYSIDE_TEST(bug_927.py) +PYSIDE_TEST(bug_931.py) +PYSIDE_TEST(bug_938.py) +PYSIDE_TEST(bug_953.py) +PYSIDE_TEST(bug_987.py) +PYSIDE_TEST(bug_994.py) +PYSIDE_TEST(bug_1019.py) +PYSIDE_TEST(bug_1031.py) +PYSIDE_TEST(bug_1063.py) +PYSIDE_TEST(bug_1069.py) +PYSIDE_TEST(bug_PYSIDE-42.py) +PYSIDE_TEST(bug_PYSIDE-164.py) +PYSIDE_TEST(blocking_signals_test.py) +PYSIDE_TEST(classinfo_test.py) +PYSIDE_TEST(child_event_test.py) +PYSIDE_TEST(deepcopy_test.py) +PYSIDE_TEST(deletelater_test.py) +PYSIDE_TEST(destroysignal_test.py) +PYSIDE_TEST(duck_punching_test.py) +PYSIDE_TEST(hash_test.py) +PYSIDE_TEST(inherits_test.py) +PYSIDE_TEST(max_signals.py) +PYSIDE_TEST(missing_symbols_test.py) +PYSIDE_TEST(mockclass_test.py) +PYSIDE_TEST(python_conversion.py) +PYSIDE_TEST(qabs_test.py) +PYSIDE_TEST(qabstractitemmodel_test.py) +PYSIDE_TEST(qabstracttransition_test.py) +PYSIDE_TEST(qanimationgroup_test.py) +PYSIDE_TEST(qbitarray_test.py) +PYSIDE_TEST(qbytearray_buffer_protocol_test.py) +PYSIDE_TEST(qbytearray_concatenation_operator_test.py) +PYSIDE_TEST(qbytearray_operator_iadd_test.py) +PYSIDE_TEST(qbytearray_operator_test.py) +PYSIDE_TEST(qbytearray_test.py) +PYSIDE_TEST(qcollator_test.py) +PYSIDE_TEST(qcommandlineparser_test.py) +PYSIDE_TEST(qcoreapplication_instance_test.py) +PYSIDE_TEST(qdatastream_test.py) +PYSIDE_TEST(qdatetime_test.py) +PYSIDE_TEST(qdate_test.py) +PYSIDE_TEST(qeasingcurve_test.py) +PYSIDE_TEST(qenum_test.py) +PYSIDE_TEST(qevent_test.py) +PYSIDE_TEST(qfileinfo_test.py) +PYSIDE_TEST(qfile_test.py) +PYSIDE_TEST(qflags_test.py) +PYSIDE_TEST(qinstallmsghandler_test.py) +PYSIDE_TEST(qlinef_test.py) +PYSIDE_TEST(qlocale_test.py) +PYSIDE_TEST(qmetaobject_test.py) +PYSIDE_TEST(qmimedatabase_test.py) +PYSIDE_TEST(qmodelindex_internalpointer_test.py) +PYSIDE_TEST(qobject_children_segfault_test.py) +PYSIDE_TEST(qobject_connect_notify_test.py) +PYSIDE_TEST(qobject_destructor.py) +PYSIDE_TEST(qobject_event_filter_test.py) +PYSIDE_TEST(qobject_inherits_test.py) +PYSIDE_TEST(qobject_objectproperty_test.py) +PYSIDE_TEST(qobject_parent_test.py) +PYSIDE_TEST(qobject_property_test.py) +PYSIDE_TEST(qobject_protected_methods_test.py) +PYSIDE_TEST(qobject_test.py) +PYSIDE_TEST(qobject_timer_event_test.py) +PYSIDE_TEST(qobject_tr_as_instance_test.py) +PYSIDE_TEST(qpoint_test.py) +PYSIDE_TEST(qprocess_test.py) +PYSIDE_TEST(qproperty_decorator.py) +PYSIDE_TEST(qrect_test.py) +PYSIDE_TEST(qregexp_test.py) +PYSIDE_TEST(qresource_test.py) +PYSIDE_TEST(qsize_test.py) +PYSIDE_TEST(qslot_object_test.py) +PYSIDE_TEST(qsrand_test.py) +PYSIDE_TEST(qstandardpaths_test.py) +PYSIDE_TEST(qstatemachine_test.py) +PYSIDE_TEST(qstate_test.py) +PYSIDE_TEST(qstorageinfo_test.py) +PYSIDE_TEST(qstring_test.py) +PYSIDE_TEST(qsysinfo_test.py) +PYSIDE_TEST(qtext_codec_test.py) +PYSIDE_TEST(qtextstream_test.py) +PYSIDE_TEST(qthread_prod_cons_test.py) +PYSIDE_TEST(qthread_signal_test.py) +PYSIDE_TEST(qthread_test.py) +PYSIDE_TEST(qtimer_singleshot_test.py) +PYSIDE_TEST(qtimer_timeout_test.py) +PYSIDE_TEST(qtnamespace_test.py) +PYSIDE_TEST(qurl_test.py) +PYSIDE_TEST(repr_test.py) +PYSIDE_TEST(setprop_on_ctor_test.py) +PYSIDE_TEST(staticMetaObject_test.py) +PYSIDE_TEST(static_method_test.py) +PYSIDE_TEST(static_protected_methods_test.py) +PYSIDE_TEST(thread_signals_test.py) +PYSIDE_TEST(tr_noop_test.py) +PYSIDE_TEST(translation_test.py) +PYSIDE_TEST(unaryoperator_test.py) +PYSIDE_TEST(unicode_test.py) +PYSIDE_TEST(versioninfo_test.py) + +if(X11) + PYSIDE_TEST(qhandle_test.py) +endif() diff --git a/sources/pyside2/tests/QtCore/blocking_signals_test.py b/sources/pyside2/tests/QtCore/blocking_signals_test.py new file mode 100644 index 000000000..64d5335aa --- /dev/null +++ b/sources/pyside2/tests/QtCore/blocking_signals_test.py @@ -0,0 +1,134 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test case for QObject.signalsBlocked() and blockSignal()''' + +import unittest +import os +from tempfile import mkstemp + +from PySide2.QtCore import QObject, SIGNAL, QFile + +class TestSignalsBlockedBasic(unittest.TestCase): + '''Basic test case for signalsBlocked''' + + def testBasic(self): + '''QObject.signalsBlocked() and blockSignals() + The signals aren't blocked by default. + blockSignals returns the previous value''' + obj = QObject() + self.assertTrue(not obj.signalsBlocked()) + self.assertTrue(not obj.blockSignals(True)) + self.assertTrue(obj.signalsBlocked()) + self.assertTrue(obj.blockSignals(False)) + +class TestSignalsBlocked(unittest.TestCase): + '''Test case to check if the signals are really blocked''' + + def setUp(self): + #Set up the basic resources needed + self.obj = QObject() + self.args = tuple() + self.called = False + + def tearDown(self): + #Delete used resources + del self.obj + del self.args + + def callback(self, *args): + #Default callback + if args == self.args: + self.called = True + else: + raise TypeError("Invalid arguments") + + def testShortCircuitSignals(self): + #Blocking of Python short-circuit signals + QObject.connect(self.obj, SIGNAL('mysignal()'), self.callback) + + self.obj.emit(SIGNAL('mysignal()')) + self.assertTrue(self.called) + + self.called = False + self.obj.blockSignals(True) + self.obj.emit(SIGNAL('mysignal()')) + self.assertTrue(not self.called) + + def testPythonSignals(self): + #Blocking of Python typed signals + QObject.connect(self.obj, SIGNAL('mysignal(int,int)'), self.callback) + self.args = (1, 3) + + self.obj.emit(SIGNAL('mysignal(int,int)'), *self.args) + self.assertTrue(self.called) + + self.called = False + self.obj.blockSignals(True) + self.obj.emit(SIGNAL('mysignal(int,int)'), *self.args) + self.assertTrue(not self.called) + +class TestQFileSignalBlocking(unittest.TestCase): + '''Test case for blocking the signal QIODevice.aboutToClose()''' + + def setUp(self): + #Set up the needed resources - A temp file and a QFile + self.called = False + handle, self.filename = mkstemp() + os.close(handle) + + self.qfile = QFile(self.filename) + + def tearDown(self): + #Release acquired resources + os.remove(self.filename) + del self.qfile + + def callback(self): + #Default callback + self.called = True + + def testAboutToCloseBlocking(self): + #QIODevice.aboutToClose() blocking + + QObject.connect(self.qfile, SIGNAL('aboutToClose()'), self.callback) + + self.assertTrue(self.qfile.open(QFile.ReadOnly)) + self.qfile.close() + self.assertTrue(self.called) + + self.called = False + self.qfile.blockSignals(True) + + self.assertTrue(self.qfile.open(QFile.ReadOnly)) + self.qfile.close() + self.assertTrue(not self.called) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_1019.py b/sources/pyside2/tests/QtCore/bug_1019.py new file mode 100644 index 000000000..039c66dbd --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_1019.py @@ -0,0 +1,60 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + +class MyTimer (QTimer): + def __init__(self): + QTimer.__init__(self) + self.startCalled = False + + @Slot() + def slotUsedToIncreaseMethodOffset(self): + pass + +class MyTimer2 (MyTimer): + + @Slot() + def slotUsedToIncreaseMethodOffset2(self): + pass + + def start(self): + self.startCalled = True + QCoreApplication.instance().quit() + +class TestBug1019 (unittest.TestCase): + def testIt(self): + app = QCoreApplication([]) + t = MyTimer2() + QTimer.singleShot(0, t.start) + app.exec_() + self.assertTrue(t.startCalled) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_1031.py b/sources/pyside2/tests/QtCore/bug_1031.py new file mode 100644 index 000000000..bdc159f0d --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_1031.py @@ -0,0 +1,33 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import QStateMachine, QState + +mach = QStateMachine() +state = QState(mach) +print(state.machine()) diff --git a/sources/pyside2/tests/QtCore/bug_1063.py b/sources/pyside2/tests/QtCore/bug_1063.py new file mode 100644 index 000000000..0ab09cc35 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_1063.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' unit test for BUG #1063 ''' + +import unittest +import tempfile +from PySide2 import QtCore +import os +import py3kcompat as py3k + +class QTextStreamTestCase(unittest.TestCase): + def setUp(self): + self.temp_file = tempfile.NamedTemporaryFile(delete=False) + self.temp_file.close() + self.f = QtCore.QFile(self.temp_file.name) + self.f.open(QtCore.QIODevice.WriteOnly) + self.strings = (py3k.unicode_('foo'), py3k.unicode_('bar')) + self.stream = QtCore.QTextStream(self.f) + + def testIt(self): + for s in self.strings: + self.stream << s + + self.f.close() + + # make sure we didn't get an empty file + self.assertNotEqual(QtCore.QFile(self.temp_file.name).size(), 0) + + os.unlink(self.temp_file.name) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_1069.py b/sources/pyside2/tests/QtCore/bug_1069.py new file mode 100644 index 000000000..90b66eaed --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_1069.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' unit test for BUG #1069 ''' + +from PySide2 import QtCore +import unittest + +class QDataStreamOpOverloadTestCase(unittest.TestCase): + def setUp(self): + self.ba = QtCore.QByteArray() + self.stream = QtCore.QDataStream(self.ba, QtCore.QIODevice.WriteOnly) + + def testIt(self): + self.stream << "hello" + ok = False + for c in self.ba: + if c != b'\x00': + ok = True + break + + self.assertEqual(ok, True) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_278_test.py b/sources/pyside2/tests/QtCore/bug_278_test.py new file mode 100644 index 000000000..710971e63 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_278_test.py @@ -0,0 +1,52 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2 import QtCore + +def setValue(o): + values = ['Name'] + o.setProperty('test1', values) + +class QQtVersionTest(unittest.TestCase): + '''Tests for QVariant conversion of QStringList''' + + def testGet(self): + o = QtCore.QObject() + setValue(o) + self.assertEqual(o.property('test1'), ['Name']) + + + +if __name__ == '__main__': + unittest.main() + + diff --git a/sources/pyside2/tests/QtCore/bug_332.py b/sources/pyside2/tests/QtCore/bug_332.py new file mode 100644 index 000000000..e863a93db --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_332.py @@ -0,0 +1,46 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import QtCore + +class Lock(QtCore.QMutex): + def tryLock(self,timeoutt=10): + return QtCore.QMutex.tryLock(self,timeoutt) + +class TestBug(unittest.TestCase): + + def testCase(self): + l = Lock() + l.tryLock() # this cause a assertion + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_408.py b/sources/pyside2/tests/QtCore/bug_408.py new file mode 100644 index 000000000..5ccb25ee8 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_408.py @@ -0,0 +1,56 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import * + +class MyDevice(QIODevice): + def __init__(self, txt): + QIODevice.__init__(self) + self.txt = txt + self.ptr = 0 + + def readData(self, size): + size = min(len(self.txt) - self.ptr, size) + retval = self.txt[self.ptr:size] + self.ptr += size + return retval + +class QIODeviceTest(unittest.TestCase): + + def testIt(self): + device = MyDevice("hello world\nhello again") + device.open(QIODevice.ReadOnly) + + s = QTextStream(device) + self.assertEqual(s.readLine(), "hello world") + self.assertEqual(s.readLine(), "hello again") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_428.py b/sources/pyside2/tests/QtCore/bug_428.py new file mode 100644 index 000000000..d256fbfd8 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_428.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject + +class MyBaseObject(QObject): + def __init__(self, number): + self.myMember = 'myMember' + number + QObject.__init__(self) + +class QObjectConstructorTest(unittest.TestCase): + def testBug(self): + for i in range(10): + number = str(i) + obj = MyBaseObject(number) + self.assertEqual(obj.myMember, 'myMember' + number) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_462.py b/sources/pyside2/tests/QtCore/bug_462.py new file mode 100644 index 000000000..14576c09c --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_462.py @@ -0,0 +1,74 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys + +from PySide2.QtCore import QObject, QCoreApplication, QEvent, QThread + +class MyEvent(QEvent): + def __init__(self,i): + print("TYPE:", type(QEvent.User)) + super(MyEvent,self).__init__(QEvent.Type(QEvent.User + 100 )) + self.i = i + +class MyThread (QThread): + def __init__(self,owner): + super(MyThread,self).__init__() + self.owner=owner; + + def run(self): + for i in range(3): + e=MyEvent(i); + QCoreApplication.postEvent(self.owner,e) + +class MyBaseObject(QObject): + def __init__(self): + QObject.__init__(self) + self.events = [] + self.t = MyThread(self) + self.t.start() + + def customEvent(self, event): + self.events.append(event) + if len(self.events) == 3: + self.t.wait() + self.app.quit() + + +class CheckForEventsTypes(unittest.TestCase): + def testTypes(self): + o = MyBaseObject() + o.app = QCoreApplication(sys.argv) + o.app.exec_() + for e in o.events: + self.assertTrue(isinstance(e, MyEvent)) + o.app = None + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_505.py b/sources/pyside2/tests/QtCore/bug_505.py new file mode 100644 index 000000000..115f40ab5 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_505.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject + +class MyBaseObject(QObject): + def __init__(self, parent=None): + QObject.__init__(self, parent) + self.setObjectName("PySide") + + def __del__(self): + if self.objectName() != "PySide": + raise NameError('Fail') + +class CheckForEventsTypes(unittest.TestCase): + def testDelObject(self): + p = MyBaseObject() + o = MyBaseObject(p) + del o + del p + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_515.py b/sources/pyside2/tests/QtCore/bug_515.py new file mode 100644 index 000000000..8d57589d3 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_515.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +""" Unittest for bug #515 """ +""" http://bugs.openbossa.org/show_bug.cgi?id=515 """ + +from PySide2 import QtCore + +callCleanup = False +def _cleanup(): + global callCleanup + callCleanup = True + +def _checkCleanup(): + global callCleanup + assert(callCleanup) + +app = QtCore.QCoreApplication([]) +QtCore.qAddPostRoutine(_cleanup) +QtCore.qAddPostRoutine(_checkCleanup) +del app diff --git a/sources/pyside2/tests/QtCore/bug_606.py b/sources/pyside2/tests/QtCore/bug_606.py new file mode 100644 index 000000000..31aa000f0 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_606.py @@ -0,0 +1,62 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import PySide2 +from PySide2.QtCore import QPoint, QPointF +from PySide2.QtCore import QLine, QLineF +from PySide2.QtCore import QSize, QSizeF + +class testCases(unittest.TestCase): + def testQPointToTuple(self): + p = QPoint(1, 2) + self.assertEqual((1, 2), p.toTuple()) + + def testQPointFToTuple(self): + p = QPointF(1, 2) + self.assertEqual((1, 2), p.toTuple()) + + def testQLineToTuple(self): + l = QLine(1, 2, 3, 4) + self.assertEqual((1, 2, 3, 4), l.toTuple()) + + def testQLineFToTuple(self): + l = QLineF(1, 2, 3, 4) + self.assertEqual((1, 2, 3, 4), l.toTuple()) + + def testQSizeToTuple(self): + s = QSize(1, 2) + self.assertEqual((1, 2), s.toTuple()) + + def testQSizeFToTuple(self): + s = QSizeF(1, 2) + self.assertEqual((1, 2), s.toTuple()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_656.py b/sources/pyside2/tests/QtCore/bug_656.py new file mode 100644 index 000000000..5eb1f2ce4 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_656.py @@ -0,0 +1,37 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * + +class CoreApp(QCoreApplication): + def __init__(self,*args): + super(CoreApp,self).__init__(*args) + # It shouldn't crash after the __init__ call + +import sys +app = CoreApp(sys.argv) diff --git a/sources/pyside2/tests/QtCore/bug_686.py b/sources/pyside2/tests/QtCore/bug_686.py new file mode 100644 index 000000000..a8c0973ee --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_686.py @@ -0,0 +1,116 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import with_statement + +import unittest +from PySide2.QtCore import * + +class MyWriteThread(QThread): + def __init__(self, lock): + QThread.__init__(self) + self.lock = lock + self.started = False + self.canQuit = False + + def run(self): + self.started = True + while not self.lock.tryLockForWrite(): + pass + self.canQuit = True + +class MyReadThread(QThread): + def __init__(self, lock): + QThread.__init__(self) + self.lock = lock + self.started = False + self.canQuit = False + + def run(self): + self.started = True + while not self.lock.tryLockForRead(): + pass + self.canQuit = True + +class MyMutexedThread(QThread): + def __init__(self, mutex): + QThread.__init__(self) + self.mutex = mutex + self.started = False + self.canQuit = False + + def run(self): + self.started = True + while not self.mutex.tryLock(): + pass + self.mutex.unlock() + self.canQuit = True + +class TestQMutex (unittest.TestCase): + + def testReadLocker(self): + lock = QReadWriteLock() + thread = MyWriteThread(lock) + + with QReadLocker(lock): + thread.start() + while not thread.started: + pass + self.assertFalse(thread.canQuit) + + thread.wait(2000) + self.assertTrue(thread.canQuit) + + def testWriteLocker(self): + lock = QReadWriteLock() + thread = MyReadThread(lock) + + with QWriteLocker(lock): + thread.start() + while not thread.started: + pass + self.assertFalse(thread.canQuit) + + thread.wait(2000) + self.assertTrue(thread.canQuit) + + def testMutexLocker(self): + mutex = QMutex() + thread = MyMutexedThread(mutex) + + with QMutexLocker(mutex): + thread.start() + while not thread.started: + pass + self.assertFalse(thread.canQuit) + + thread.wait(2000) + self.assertTrue(thread.canQuit) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_699.py b/sources/pyside2/tests/QtCore/bug_699.py new file mode 100644 index 000000000..203daf60a --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_699.py @@ -0,0 +1,45 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + +class TestBug699 (unittest.TestCase): + + def defClass(self): + class Foo (QObject): + def foo(self): + pass + + prop = Property(foo, foo) + + def testIt(self): + self.assertRaises(TypeError, self.defClass) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_706.py b/sources/pyside2/tests/QtCore/bug_706.py new file mode 100644 index 000000000..58acfe3c0 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_706.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import * + +class MyModel (QAbstractListModel): + def rowCount(self, parent = None): + return 3 + +class TestBug706(unittest.TestCase): + + def mySlot(self, idx, start, end): + self.start = start + self.end = end + + def testIt(self): + self.start = None + self.end = None + + app = QCoreApplication([]) + model = MyModel() + model.columnsAboutToBeInserted.connect(self.mySlot) + model.columnsAboutToBeInserted.emit(QModelIndex(), 0, 1) + self.assertEqual(self.start, 0) + self.assertEqual(self.end, 1) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_820.py b/sources/pyside2/tests/QtCore/bug_820.py new file mode 100644 index 000000000..ef005fd55 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_820.py @@ -0,0 +1,97 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import functools +import unittest + +from PySide2.QtCore import QObject, Slot, Signal, SIGNAL + +def log_exception(): + def log_exception_decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwds): + try: + return func(*args, **kwds) + except Exception: + raise + + return wrapper + + return log_exception_decorator + + +def log_exception2(): + def log_exception_decorator(func): + def wrapper(*args, **kwds): + try: + return func(*args, **kwds) + except Exception: + raise + + return wrapper + + return log_exception_decorator + +class MyObject(QObject): + + def __init__(self, parent=None): + QObject.__init__(self, parent) + self._mySlotcalled = False + self._mySlot2called = False + + @Slot() + @log_exception() + def mySlot(self): + self._mySlotcalled = True + + @Slot(name="mySlot2") + @log_exception2() + def mySlot2(self): + self._mySlot2called = True + + def poke(self): + self.events.emit() + + events = Signal() + + +class SlotWithDecoratorTest(unittest.TestCase): + def testSlots(self): + o = MyObject() + self.assertTrue(o.metaObject().indexOfSlot("mySlot()") > 0) + self.assertTrue(o.metaObject().indexOfSlot("mySlot2()") > 0) + + o.events.connect(o.mySlot) + o.events.connect(o.mySlot2) + o.poke() + self.assertTrue(o._mySlotcalled) + self.assertTrue(o._mySlot2called) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/bug_826.py b/sources/pyside2/tests/QtCore/bug_826.py new file mode 100644 index 000000000..e94e4bdcf --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_826.py @@ -0,0 +1,57 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import QEvent, Qt +import PySide2 + +import unittest + +TEST_EVENT_TYPE = QEvent.Type(QEvent.registerEventType()) + +class TestEvent(QEvent): + TestEventType = QEvent.Type(QEvent.registerEventType()) + + def __init__(self, rand=0): + super(TestEvent, self).__init__(TestEvent.TestEventType) + self._rand = rand + + def getRand(self): + return self._rand + + +class TestEnums(unittest.TestCase): + def testUserTypesValues(self): + self.assertTrue(QEvent.User <= int(TestEvent.TestEventType) <= QEvent.MaxUser) + self.assertTrue(QEvent.User <= int(TEST_EVENT_TYPE) <= QEvent.MaxUser) + + def testUserTypesRepr(self): + self.assertEqual(eval(repr(TestEvent.TestEventType)), TestEvent.TestEventType) + self.assertEqual(eval(repr(TEST_EVENT_TYPE)), TEST_EVENT_TYPE) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_829.py b/sources/pyside2/tests/QtCore/bug_829.py new file mode 100644 index 000000000..5b14f7b59 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_829.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Copyright (C) 2011 Thomas Perl +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# Test case for PySide bug 829 + +import unittest +from PySide2.QtCore import QSettings +import tempfile + +class QVariantConversions(unittest.TestCase): + def testDictionary(self): + confFile = tempfile.NamedTemporaryFile(delete=False) + s = QSettings(confFile.name, QSettings.IniFormat) + # Save value + s.setValue('x', {1: 'a'}) + s.sync() + del s + + # Restore value + s = QSettings(confFile.name, QSettings.IniFormat) + self.assertEqual(s.value('x'), {1: 'a'}) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_835.py b/sources/pyside2/tests/QtCore/bug_835.py new file mode 100644 index 000000000..05918b9b6 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_835.py @@ -0,0 +1,93 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * + +import unittest + +get_counter = 0 +set_counter = 0 + +class Descriptor(object): + def __get__(self, obj, owner): + global get_counter + + if not obj: + return self + + get_counter += 1 + return obj.var + + def __set__(self, obj, value): + global set_counter + + set_counter += 1 + obj.var = value + +class FooBar(QObject): + test = Descriptor() + var = 0 + +class SetAndGetTestCases(unittest.TestCase): + def setUp(self): + global get_counter + global set_counter + + get_counter = 0 + set_counter = 0 + + def testSetMethod(self): + global get_counter + global set_counter + + f = FooBar() + + f.test = 1 + self.assertEqual(get_counter, 0) + self.assertEqual(set_counter, 1) + + get_counter = 0 + set_counter = 0 + + def testGetMethod(self): + global get_counter + global set_counter + + f = FooBar() + f.test = 1 + set_counter = 0 + + ret = f.test + self.assertEqual(get_counter, 1) + self.assertEqual(set_counter, 0) + + get_counter = 0 + set_counter = 0 + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_920.py b/sources/pyside2/tests/QtCore/bug_920.py new file mode 100644 index 000000000..7ffaafc0d --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_920.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest +import PySide2.QtCore as QtCore + +class Signaller(QtCore.QObject): + s1 = QtCore.Signal() + s2 = QtCore.Signal() + +class TestBug920(unittest.TestCase): + + def testIt(self): + s = Signaller() + s.s1.connect(self.onSignal) + s.s2.connect(self.onSignal) + self.assertTrue(s.s1.disconnect(self.onSignal)) + self.assertTrue(s.s2.disconnect(self.onSignal)) + + def onSignal(self): + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_927.py b/sources/pyside2/tests/QtCore/bug_927.py new file mode 100644 index 000000000..98126cf2c --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_927.py @@ -0,0 +1,52 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import time +import unittest + +from PySide2.QtCore import QTime, QRunnable, QThreadPool + +class Task(QRunnable): + def run(self): + t = QTime() + t.start() + time.sleep(2) # Sleep 2 seconds + + +class QThreadPoolTest(unittest.TestCase): + '''This used to cause a segfault due the ownership control on globalInstance function ''' + def testSlowJobs(self): + for i in range(3): + task = Task() + QThreadPool.globalInstance().start(task) + time.sleep(1) # Sleep 1 second + + QThreadPool.globalInstance().waitForDone() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_931.py b/sources/pyside2/tests/QtCore/bug_931.py new file mode 100644 index 000000000..aaec4d470 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_931.py @@ -0,0 +1,49 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, Signal +o = QObject() +class MyObject(QObject): + s = Signal(int) + +class CheckSignalType(unittest.TestCase): + def testSignal(self): + self.assertTrue(isinstance(QObject.destroyed, Signal)) + self.assertEqual(type(QObject.destroyed), Signal) + + self.assertEqual(type(o.destroyed).__name__, "SignalInstance") + self.assertNotEqual(type(o.destroyed), Signal) + + self.assertTrue(isinstance(o.destroyed, Signal)) + self.assertTrue(isinstance(MyObject.s, Signal)) + self.assertFalse(isinstance(int, Signal)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_938.py b/sources/pyside2/tests/QtCore/bug_938.py new file mode 100644 index 000000000..fdab35705 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_938.py @@ -0,0 +1,42 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + +class TestBug938 (unittest.TestCase): + + def testIt(self): + b = QBuffer() + b.open(QBuffer.WriteOnly) + b.write("\x0023\x005") + b.close() + self.assertEqual(b.buffer().size(), 5) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_953.py b/sources/pyside2/tests/QtCore/bug_953.py new file mode 100644 index 000000000..03e87bb37 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_953.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * + +class Dispatcher(QObject): + _me = None + + def __init__(self): + super(Dispatcher, self).__init__() + self._me = self + QTimer.singleShot(0, self._finish) + + def _finish(self): + del self._me # It can't crash here! + QTimer.singleShot(10, QCoreApplication.instance().quit) + +if __name__ == '__main__': + app = QCoreApplication([]) + Dispatcher() + app.exec_() diff --git a/sources/pyside2/tests/QtCore/bug_987.py b/sources/pyside2/tests/QtCore/bug_987.py new file mode 100644 index 000000000..73704f86c --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_987.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import QObject + +import unittest + + +class TestBug987(unittest.TestCase): + def callback(self): + pass + + def testInvalidDisconnection(self): + o = QObject() + self.assertRaises(RuntimeError, o.destroyed.disconnect, self.callback) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_994.py b/sources/pyside2/tests/QtCore/bug_994.py new file mode 100644 index 000000000..27171bb50 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_994.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import py3kcompat as py3k +from PySide2.QtCore import QIODevice, QTextStream + + +class MyIODevice (QIODevice): + def readData(self, amount): + return py3k.b("\0a" * int(amount/2)) + + def readLineData(self, maxSize): + return py3k.b("\0b" * 4) + + def atEnd(self): + return False + +class TestBug944 (unittest.TestCase): + + def testIt(self): + device = MyIODevice() + device.open(QIODevice.ReadOnly) + s = QTextStream(device) + self.assertEqual(s.read(4), "\0a\0a") + self.assertEqual(device.readLine(), "\0b\0b\0b\0b") + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_PYSIDE-164.py b/sources/pyside2/tests/QtCore/bug_PYSIDE-164.py new file mode 100644 index 000000000..8d13b8cb2 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_PYSIDE-164.py @@ -0,0 +1,69 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import unittest + +from PySide2.QtCore import QCoreApplication, QEventLoop, QObject, Qt, QThread, QTimer, SIGNAL + +class Emitter(QThread): + def __init__(self): + QThread.__init__(self) + + def run(self): + print("Before emit.") + self.emit(SIGNAL("signal(int)"), 0) + print("After emit.") + +class Receiver(QObject): + def __init__(self, eventloop): + QObject.__init__(self) + self.eventloop = eventloop + + def receive(self, number): + print("Received number: %d" % number) + self.eventloop.exit(0) + + +class TestBugPYSIDE164(unittest.TestCase): + + def testBlockingSignal(self): + app = QCoreApplication.instance() or QCoreApplication([]) + eventloop = QEventLoop() + emitter = Emitter() + receiver = Receiver(eventloop) + emitter.connect(emitter, SIGNAL("signal(int)"), + receiver.receive, Qt.BlockingQueuedConnection) + emitter.start() + retval = eventloop.exec_() + emitter.wait(2000) + self.assertEqual(retval, 0) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/bug_PYSIDE-42.py b/sources/pyside2/tests/QtCore/bug_PYSIDE-42.py new file mode 100644 index 000000000..15b6fead8 --- /dev/null +++ b/sources/pyside2/tests/QtCore/bug_PYSIDE-42.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +import unittest + +class TestBugPYSIDE42 (unittest.TestCase): + + def testIt(self): + obj1 = QFile() + obj2 = QObject() + hash1 = hash(obj1) + hash2 = hash(obj2) + + self.assertNotEqual(hash1, hash2) + self.assertEqual(hash1, hash(obj1)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/child_event_test.py b/sources/pyside2/tests/QtCore/child_event_test.py new file mode 100644 index 000000000..6b0ac211c --- /dev/null +++ b/sources/pyside2/tests/QtCore/child_event_test.py @@ -0,0 +1,81 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test case for QObject.childEvent and QTimer.childEvent overloading''' + +import unittest +from time import sleep +from PySide2.QtCore import QObject, QTimer, QCoreApplication + +from helper import UsesQCoreApplication + +class ExtQObject(QObject): + def __init__(self): + QObject.__init__(self) + self.child_event_received = False + + def childEvent(self, event): + QObject.childEvent(self, event) + self.child_event_received = True + +class ExtQTimer(QTimer): + def __init__(self): + QTimer.__init__(self) + self.child_event_received = False + + def childEvent(self, event): + QTimer.childEvent(self, event) + self.child_event_received = True + + +class TestChildEvent(UsesQCoreApplication): + '''Test case for QObject::childEvent and QTimer::childEvent''' + + def setUp(self): + UsesQCoreApplication.setUp(self) + + def tearDown(self): + UsesQCoreApplication.tearDown(self) + + def testQObject(self): + parent = ExtQObject() + child = QObject() + child.setParent(parent) + self.assertTrue(parent.child_event_received) + + def testQTimer(self): + parent = ExtQTimer() + child = QObject() + child.setParent(parent) + self.assertTrue(parent.child_event_received) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/classinfo_test.py b/sources/pyside2/tests/QtCore/classinfo_test.py new file mode 100644 index 000000000..1ff67e19a --- /dev/null +++ b/sources/pyside2/tests/QtCore/classinfo_test.py @@ -0,0 +1,110 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest + +from PySide2.QtCore import QObject, QCoreApplication, ClassInfo + +class TestClassInfo(unittest.TestCase): + def test_metadata(self): + @ClassInfo(author='pyside', url='http://www.pyside.org') + class MyObject(QObject): + pass + + o = MyObject() + mo = o.metaObject() + self.assertEqual(mo.classInfoCount(), 2) + + ci = mo.classInfo(0) #author + self.assertEqual(ci.name(), 'author') + self.assertEqual(ci.value(), 'pyside') + + ci = mo.classInfo(1) #url + self.assertEqual(ci.name(), 'url') + self.assertEqual(ci.value(), 'http://www.pyside.org') + + def test_verify_metadata_types(self): + valid_dict = { '123': '456' } + + invalid_dict_1 = { '123': 456 } + invalid_dict_2 = { 123: 456 } + invalid_dict_3 = { 123: '456' } + + ClassInfo(**valid_dict) + + self.assertRaises(TypeError, ClassInfo, **invalid_dict_1) + + # assertRaises only allows for string keywords, so a `try` must be used here. + try: + ClassInfo(**invalid_dict_2) + self.fail('ClassInfo() accepted invalid_dict_2!') + except TypeError: + pass + + try: + ClassInfo(**invalid_dict_3) + self.fail('ClassInfo() accepted invalid_dict_3!') + except TypeError: + pass + + def test_can_not_use_instance_twice(self): + decorator = ClassInfo(author='pyside', url='http://www.pyside.org') + + @decorator + class MyObject1(QObject): + pass + + class MyObject2(QObject): + pass + + self.assertRaises(TypeError, decorator, MyObject2) + + def test_can_only_be_used_on_qobjects(self): + def test_function(): pass + self.assertRaises(TypeError, ClassInfo(), test_function) + + class NotAQObject(object): pass + self.assertRaises(TypeError, ClassInfo(), NotAQObject) + + class QObjectSubclass(QObject): pass + ClassInfo()(QObjectSubclass) + + class SubclassOfNativeQObjectSubclass(QCoreApplication): pass + ClassInfo()(SubclassOfNativeQObjectSubclass) + + class SubclassOfPythonQObjectSubclass(QObjectSubclass): pass + ClassInfo()(SubclassOfPythonQObjectSubclass) + +if __name__ == '__main__': + if sys.version_info[0] < 2: + sys.exit(0) + elif (sys.version_info[0] == 2) and (sys.version_info[1] <= 5): + sys.exit(0) + else: + unittest.main() diff --git a/sources/pyside2/tests/QtCore/deepcopy_test.py b/sources/pyside2/tests/QtCore/deepcopy_test.py new file mode 100644 index 000000000..9d8117449 --- /dev/null +++ b/sources/pyside2/tests/QtCore/deepcopy_test.py @@ -0,0 +1,111 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from copy import deepcopy + +from PySide2.QtCore import QByteArray, QDate, QDateTime, QTime, QLine, QLineF +from PySide2.QtCore import Qt, QSize, QSizeF, QRect, QRectF, QDir, QPoint, QPointF +try: + from PySide2.QtCore import QUuid + HAVE_Q = True +except ImportError: + HAVE_Q = False + +class DeepCopyHelper: + def testCopy(self): + copy = deepcopy([self.original])[0] + self.assertTrue(copy is not self.original) + self.assertEqual(copy, self.original) + +class QByteArrayDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QByteArray('the quick brown fox jumps over the lazy dog') + + +class QDateDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QDate(2010, 11, 22) + + +class QTimeDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QTime(11, 37, 55, 692) + + +class QDateTimeDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QDateTime(2010, 5, 18, 10, 24, 45, 223, Qt.LocalTime) + + +class QSizeDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QSize(42, 190) + + +class QSizeFDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QSizeF(42.7, 190.2) + + +class QRectDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QRect(100, 200, 300, 400) + + +class QRectFDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QRectF(100.33, 200.254, 300.321, 400.123) + +class QLineDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QLine(1, 2, 3, 4) + +class QLineFDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QLineF(1.1, 2.2, 3.3, 4.4) + +class QPointDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QPoint(1, 2) + +class QPointFDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QPointF(1.1, 2.2) + +class QDirDeepCopy(DeepCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QDir("./") + +class QUuiCopy(DeepCopyHelper, unittest.TestCase): + @unittest.skipUnless(HAVE_Q, "QUuid is currently not supported on this platform.") + def setUp(self): + self.original = QUuid("67C8770B-44F1-410A-AB9A-F9B5446F13EE") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/deletelater_test.py b/sources/pyside2/tests/QtCore/deletelater_test.py new file mode 100644 index 000000000..7a2ee03cc --- /dev/null +++ b/sources/pyside2/tests/QtCore/deletelater_test.py @@ -0,0 +1,50 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QTimer.singleShot''' + +import unittest + +from PySide2.QtCore import QObject, QTimer, QCoreApplication, SIGNAL +from helper import UsesQCoreApplication + +class TestDeleteLater(UsesQCoreApplication): + '''Test case for function DeleteLater''' + + def testCase(self): + o = QObject() + o.deleteLater() + del o + QTimer.singleShot(100, self.app.quit) + self.app.exec_() + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/destroysignal_test.py b/sources/pyside2/tests/QtCore/destroysignal_test.py new file mode 100644 index 000000000..0d48f283e --- /dev/null +++ b/sources/pyside2/tests/QtCore/destroysignal_test.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import QTimer, QObject +import sys +import unittest + +class TestDestroySignal(unittest.TestCase): + def onObjectDestroyed(self, timer): + self.assertTrue(isinstance(timer, QObject)) + self._destroyed = True + + def testSignal(self): + self._destroyed = False + t = QTimer() + t.destroyed[QObject].connect(self.onObjectDestroyed) + del t + self.assertTrue(self._destroyed) + + def testWithParent(self): + self._destroyed = False + p = QTimer() + t = QTimer(p) + t.destroyed[QObject].connect(self.onObjectDestroyed) + del p + self.assertTrue(self._destroyed) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/duck_punching_test.py b/sources/pyside2/tests/QtCore/duck_punching_test.py new file mode 100644 index 000000000..c0ee4403d --- /dev/null +++ b/sources/pyside2/tests/QtCore/duck_punching_test.py @@ -0,0 +1,102 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test case for duck punching new implementations of C++ virtual methods into object instances.''' + +import unittest +import types +import sys +from PySide2.QtCore import QObject +from helper import UsesQCoreApplication + +def MethodType(func, instance, instanceType): + if sys.version_info[0] == 3: + return types.MethodType(func, instance) + else: + return types.MethodType(func, instance, instanceType) + +class Duck(QObject): + def __init__(self): + QObject.__init__(self) + def childEvent(self, event): + QObject.childEvent(self, event) + +class TestDuckPunchingOnQObjectInstance(UsesQCoreApplication): + '''Test case for duck punching new implementations of C++ virtual methods into object instances.''' + + def setUp(self): + #Acquire resources + self.duck_childEvent_called = False + UsesQCoreApplication.setUp(self) + + def tearDown(self): + #Release resources + del self.duck_childEvent_called + UsesQCoreApplication.tearDown(self) + + + def testChildEventMonkeyPatch(self): + #Test if the new childEvent injected on QObject instance is called from C++ + parent = QObject() + def childEvent(obj, event): + self.duck_childEvent_called = True + parent.childEvent = MethodType(childEvent, parent, QObject) + child = QObject() + child.setParent(parent) + self.assertTrue(self.duck_childEvent_called) + # This is done to decrease the refcount of the vm object + # allowing the object wrapper to be deleted before the + # BindingManager. This is useful when compiling Shiboken + # for debug, since the BindingManager destructor has an + # assert that checks if the wrapper mapper is empty. + parent.childEvent = None + + def testChildEventMonkeyPatchWithInheritance(self): + #Test if the new childEvent injected on a QObject's extension class instance is called from C++ + parent = Duck() + def childEvent(obj, event): + QObject.childEvent(obj, event) + self.duck_childEvent_called = True + child = QObject() + child.setParent(parent) + parent.childEvent = MethodType(childEvent, parent, QObject) + child = QObject() + child.setParent(parent) + self.assertTrue(self.duck_childEvent_called) + # This is done to decrease the refcount of the vm object + # allowing the object wrapper to be deleted before the + # BindingManager. This is useful when compiling Shiboken + # for debug, since the BindingManager destructor has an + # assert that checks if the wrapper mapper is empty. + parent.childEvent = None + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/hash_test.py b/sources/pyside2/tests/QtCore/hash_test.py new file mode 100644 index 000000000..d1962bcf3 --- /dev/null +++ b/sources/pyside2/tests/QtCore/hash_test.py @@ -0,0 +1,86 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QDate, QDateTime, QTime, QUrl +from PySide2.QtCore import QLine, QPoint, QRect, QSize + +class HashTest(unittest.TestCase): + def testInsert(self): + myHash = {} + qdate = QDate.currentDate() + qdatetime = QDateTime.currentDateTime() + qtime = QTime.currentTime() + qurl = QUrl("http://www.pyside.org") + qpoint = QPoint(12, 42) + + myHash[qdate] = "QDate" + myHash[qdatetime] = "QDateTime" + myHash[qtime] = "QTime" + myHash[qurl] = "QUrl" + myHash[qpoint] = "QPoint" + + self.assertEqual(myHash[qdate], "QDate") + self.assertEqual(myHash[qdatetime], "QDateTime") + self.assertEqual(myHash[qtime], "QTime") + self.assertEqual(myHash[qurl], "QUrl") + self.assertEqual(myHash[qpoint], "QPoint") + + def testQPointHash(self): + p1 = QPoint(12, 34) + p2 = QPoint(12, 34) + self.assertFalse(p1 is p2) + self.assertEqual(p1, p2) + self.assertEqual(hash(p1), hash(p2)) + + def testQSizeHash(self): + s1 = QSize(12, 34) + s2 = QSize(12, 34) + self.assertFalse(s1 is s2) + self.assertEqual(s1, s2) + self.assertEqual(hash(s1), hash(s2)) + + def testQRectHash(self): + r1 = QRect(12, 34, 56, 78) + r2 = QRect(12, 34, 56, 78) + self.assertFalse(r1 is r2) + self.assertEqual(r1, r2) + self.assertEqual(hash(r1), hash(r2)) + + def testQLineHash(self): + l1 = QLine(12, 34, 56, 78) + l2 = QLine(12, 34, 56, 78) + self.assertFalse(l1 is l2) + self.assertEqual(l1, l2) + self.assertEqual(hash(l1), hash(l2)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/inherits_test.py b/sources/pyside2/tests/QtCore/inherits_test.py new file mode 100644 index 000000000..1fc620c9a --- /dev/null +++ b/sources/pyside2/tests/QtCore/inherits_test.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject + +class MyObject(QObject): + pass + +class MainTest(unittest.TestCase): + def testInherits(self): + o = MyObject() + mo = o.metaObject() + self.assertEqual(mo.className(), 'MyObject') + self.assertTrue(o.inherits('MyObject')) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/max_signals.py b/sources/pyside2/tests/QtCore/max_signals.py new file mode 100644 index 000000000..c3bb7b303 --- /dev/null +++ b/sources/pyside2/tests/QtCore/max_signals.py @@ -0,0 +1,62 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, SIGNAL + +class MyObject(QObject): + pass + + +class TestSignalLimitless(unittest.TestCase): + SIGNAL_MAX = 100 + def test100DynamicSignals(self): + + self.count = 0 + def onSignal(): + self.count += 1 + + #create 100 dynamic signals + o = MyObject() + for i in range(self.SIGNAL_MAX): + o.connect(SIGNAL('sig%d()'%i), onSignal) + + #chek if the signals are valid + m = o.metaObject() + for i in range(self.SIGNAL_MAX): + self.assertTrue(m.indexOfSignal('sig%d()'%i) > 0) + + #emit all 100 signals + for i in range(self.SIGNAL_MAX): + o.emit(SIGNAL('sig%d()'%i)) + + self.assertEqual(self.count, self.SIGNAL_MAX) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/missing_symbols_test.py b/sources/pyside2/tests/QtCore/missing_symbols_test.py new file mode 100644 index 000000000..cc7b7a2b5 --- /dev/null +++ b/sources/pyside2/tests/QtCore/missing_symbols_test.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''(Very) Simple test case for missing names from QtCore''' + +import unittest +from PySide2 import QtCore + +class MissingClasses(unittest.TestCase): + + def testQSettings(self): # Bug 232 + getattr(QtCore, 'QSettings') + + def testQtTrNoop(self): # Bug 220 + getattr(QtCore, 'QT_TR_NOOP') + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/mockclass_test.py b/sources/pyside2/tests/QtCore/mockclass_test.py new file mode 100644 index 000000000..ab794b0a2 --- /dev/null +++ b/sources/pyside2/tests/QtCore/mockclass_test.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# Test case for PySide bug 634 +# http://bugs.pyside.org/show_bug.cgi?id=634 +# Marcus Lindblom ; 2011-02-16 + +import unittest +from PySide2.QtCore import QCoreApplication + +class Mock(object): + def __init__(self): + self.called = False + self.return_value = None + + def __call__(self, *args, **kwargs): + self.called = True + return self.return_value + + +class MockClassTest(unittest.TestCase): + def testMockQCoreApplication(self): + mock = Mock() + setattr(QCoreApplication, 'instance', mock) + QCoreApplication.instance() + self.assertTrue(mock.called) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/python_conversion.py b/sources/pyside2/tests/QtCore/python_conversion.py new file mode 100644 index 000000000..4e04c1630 --- /dev/null +++ b/sources/pyside2/tests/QtCore/python_conversion.py @@ -0,0 +1,93 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QLineF''' + +import unittest +import datetime + +from PySide2.QtCore import QTime, QDateTime, QDate + +class TestDateTimeConversions (unittest.TestCase): + def testQDate(self): + date = datetime.date(2010, 4, 23) + other = QDate(date) + self.assertEqual(date.year, other.year()) + self.assertEqual(date.month, other.month()) + self.assertEqual(date.day, other.day()) + + self.assertEqual(date, other.toPython()) + + def testQTime(self): + time = datetime.time(11, 14, 0, 1000) + other = QTime(time) + self.assertEqual(time.hour, other.hour()) + self.assertEqual(time.minute, other.minute()) + self.assertEqual(time.second, other.second()) + self.assertEqual(time.microsecond/1000, other.msec()) + + self.assertEqual(time, other.toPython()) + + def testQDateTime(self): + dateTime = datetime.datetime(2010, 4, 23, 11, 14, 0, 1000) + other = QDateTime(dateTime) + + otherDate = other.date() + self.assertEqual(dateTime.year, otherDate.year()) + self.assertEqual(dateTime.month, otherDate.month()) + self.assertEqual(dateTime.day, otherDate.day()) + + otherTime = other.time() + self.assertEqual(dateTime.hour, otherTime.hour()) + self.assertEqual(dateTime.minute, otherTime.minute()) + self.assertEqual(dateTime.second, otherTime.second()) + self.assertEqual(dateTime.microsecond/1000, otherTime.msec()) + + self.assertEqual(dateTime, other.toPython()) + + def testQDateTime6arg(self): + dateTime = datetime.datetime(2010, 4, 23, 11, 14, 7) + other = QDateTime(dateTime) + + otherDate = other.date() + self.assertEqual(dateTime.year, otherDate.year()) + self.assertEqual(dateTime.month, otherDate.month()) + self.assertEqual(dateTime.day, otherDate.day()) + + otherTime = other.time() + self.assertEqual(dateTime.hour, otherTime.hour()) + self.assertEqual(dateTime.minute, otherTime.minute()) + self.assertEqual(dateTime.second, otherTime.second()) + self.assertEqual(dateTime.microsecond/1000, otherTime.msec()) + + self.assertEqual(dateTime, other.toPython()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qabs_test.py b/sources/pyside2/tests/QtCore/qabs_test.py new file mode 100644 index 000000000..8bfdf6452 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qabs_test.py @@ -0,0 +1,48 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2 import QtCore + + +class QAbsTest(unittest.TestCase): + '''Tests for QtCore.qAbs''' + + def testBasic(self): + def check(x): + self.assertEqual(QtCore.qAbs(x), abs(x)) + + check(0) + check(-10) + check(10) + check(10.5) + check(-10.5) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py b/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py new file mode 100644 index 000000000..0c9da65c5 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + +class MyModel (QAbstractListModel): + pass + +class Foo: + pass + +class TestQModelIndexInternalPointer(unittest.TestCase): + + def testInternalPointer(self): + m = MyModel() + foo = Foo() + idx = m.createIndex(0,0, foo) + + def testPassQPersistentModelIndexAsQModelIndex(self): + # Related to bug #716 + m = MyModel() + idx = QPersistentModelIndex() + m.span(idx) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qabstracttransition_test.py b/sources/pyside2/tests/QtCore/qabstracttransition_test.py new file mode 100644 index 000000000..84c6cff3c --- /dev/null +++ b/sources/pyside2/tests/QtCore/qabstracttransition_test.py @@ -0,0 +1,184 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from sys import getrefcount +from PySide2.QtCore import * + +def addStates(transition): + sx = QState() + sy = QState() + transition.setTargetStates([sx, sy]) + +def addAnimation(transition): + animation = QParallelAnimationGroup() + transition.addAnimation(animation) + +class QAbstractTransitionTest(unittest.TestCase): + + def testBasic(self): + app = QCoreApplication([]) + + o = QObject() + o.setProperty("text", "INdT") + + machine = QStateMachine() + s1 = QState() + s1.assignProperty(o, "text", "Rocks") + + s2 = QFinalState() + t = s1.addTransition(o, SIGNAL("change()"), s2) + + self.assertEqual(t.targetStates(), [s2]) + + addStates(t) + self.assertEqual(len(t.targetStates()), 2) + + animation = QParallelAnimationGroup() + t.addAnimation(animation) + + self.assertEqual(t.animations(), [animation]) + + addAnimation(t) + self.assertEqual(t.animations()[0].parent(), None) + + machine.addState(s1) + machine.addState(s2) + machine.setInitialState(s1) + machine.start() + + QTimer.singleShot(100, app.quit) + app.exec_() + + def testRefCountOfTargetState(self): + transition = QEventTransition() + state1 = QState() + refcount1 = getrefcount(state1) + + transition.setTargetState(state1) + + self.assertEqual(transition.targetState(), state1) + self.assertEqual(getrefcount(transition.targetState()), refcount1 + 1) + + state2 = QState() + refcount2 = getrefcount(state2) + + transition.setTargetState(state2) + + self.assertEqual(transition.targetState(), state2) + self.assertEqual(getrefcount(transition.targetState()), refcount2 + 1) + self.assertEqual(getrefcount(state1), refcount1) + + del transition + + self.assertEqual(getrefcount(state2), refcount2) + + def testRefCountOfTargetStates(self): + transition = QEventTransition() + state1 = QState() + state2 = QState() + states = [state1, state2] + refcount1 = getrefcount(state1) + refcount2 = getrefcount(state2) + + transition.setTargetStates(states) + + self.assertEqual(transition.targetStates(), states) + self.assertEqual(transition.targetState(), state1) + self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1) + self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1) + + del states + del transition + + self.assertEqual(getrefcount(state1), refcount1 - 1) + self.assertEqual(getrefcount(state2), refcount2 - 1) + + def testRefCountOfTargetStatesAfterSingleTargetState(self): + transition = QEventTransition() + state0 = QState() + refcount0 = getrefcount(state0) + + transition.setTargetState(state0) + + self.assertEqual(transition.targetState(), state0) + self.assertEqual(getrefcount(transition.targetState()), refcount0 + 1) + + state1 = QState() + state2 = QState() + states = [state1, state2] + refcount1 = getrefcount(state1) + refcount2 = getrefcount(state2) + + transition.setTargetStates(states) + + self.assertEqual(getrefcount(state0), refcount0) + self.assertEqual(transition.targetStates(), states) + self.assertEqual(transition.targetState(), state1) + self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1) + self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1) + + del states + del transition + + self.assertEqual(getrefcount(state1), refcount1 - 1) + self.assertEqual(getrefcount(state2), refcount2 - 1) + + def testRefCountOfTargetStatesBeforeSingleTargetState(self): + transition = QEventTransition() + state1 = QState() + state2 = QState() + states = [state1, state2] + refcount1 = getrefcount(state1) + refcount2 = getrefcount(state2) + + transition.setTargetStates(states) + + self.assertEqual(transition.targetStates(), states) + self.assertEqual(transition.targetState(), state1) + self.assertEqual(getrefcount(transition.targetStates()[0]), refcount1 + 1) + self.assertEqual(getrefcount(transition.targetStates()[1]), refcount2 + 1) + + state3 = QState() + refcount3 = getrefcount(state3) + + transition.setTargetState(state3) + + self.assertEqual(transition.targetState(), state3) + self.assertEqual(getrefcount(transition.targetState()), refcount3 + 1) + + del states + + self.assertEqual(getrefcount(state1), refcount1 - 1) + self.assertEqual(getrefcount(state2), refcount2 - 1) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qanimationgroup_test.py b/sources/pyside2/tests/QtCore/qanimationgroup_test.py new file mode 100644 index 000000000..85f4c27f8 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qanimationgroup_test.py @@ -0,0 +1,53 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + +class QAnimationGroupTest(unittest.TestCase): + + def testBasic(self): + app = QCoreApplication([]) + + panim = QParallelAnimationGroup() + sanim = QSequentialAnimationGroup() + panim.addAnimation(sanim) + + self.assertEqual(sanim.parent(), panim) + + panim.clear() + + self.assertRaises(RuntimeError, lambda :sanim.parent()) + + QTimer.singleShot(100, app.quit) + app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qbitarray_test.py b/sources/pyside2/tests/QtCore/qbitarray_test.py new file mode 100644 index 000000000..4c165166e --- /dev/null +++ b/sources/pyside2/tests/QtCore/qbitarray_test.py @@ -0,0 +1,148 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Tests if QBitArray class is iterable and also '~' (__invert__) and bitwise operators''' + +import unittest + +from PySide2.QtCore import QBitArray + +def bool_list_from_qbitarray(qbitarray): + '''This function is used instead of a list comprehension because + the QBitArray is being tested also to check if it is providing + the iterable protocol. + ''' + qbitarray_values = [] + for i in range(qbitarray.size()): + qbitarray_values.append(qbitarray.at(i)) + return qbitarray_values + +class QBitArrayIsIterableTest(unittest.TestCase): + '''Tests if QBitArray class is iterable and also '~' (__invert__) and bitwise operators''' + + def setUp(self): + #Acquire resources + self.qbitarray = QBitArray(3) + self.qbitarray_values = [True, False, False] + # WARNING: do not pythonify the following loop + for i in range(len(self.qbitarray_values)): + self.qbitarray.setBit(i, self.qbitarray_values[i]) + + self.inverted_qbitarray_values = [not bit for bit in self.qbitarray_values] + + self.other_qbitarray = QBitArray(3) + self.other_qbitarray_values = [True, True, False] + # WARNING: do not pythonify the following loop + for i in range(len(self.other_qbitarray_values)): + self.other_qbitarray.setBit(i, self.other_qbitarray_values[i]) + + def tearDown(self): + #Release resources + del self.qbitarray + del self.other_qbitarray + del self.qbitarray_values + del self.other_qbitarray_values + del self.inverted_qbitarray_values + + def testQBitArrayIsIterable(self): + #Tests if QBitArray class is iterable + qbitarray_is_iterable = True + try: + bitarray = [bit for bit in self.qbitarray] + except: + qbitarray_is_iterable = False + self.assertTrue(qbitarray_is_iterable) + + def testQBitArrayInvertOperator(self): + #Tests QBitArray '~' (__invert__) operator + inverted_qbitarray = ~self.qbitarray + # WARNING: do not pythonify the following loop, the + # iterability of QBitArray class is tested in another place + inverted_qbitarray_values = bool_list_from_qbitarray(inverted_qbitarray) + self.assertEqual(self.inverted_qbitarray_values, inverted_qbitarray_values) + + def testQBitArrayOrBitwiseOperator(self): + #Tests QBitArray '|' (or) operator + has_or_bitwise_operator = True + ored_qbitarray, ored_bool_list = None, None + try: + ored_qbitarray = self.qbitarray | self.other_qbitarray + ored_bool_list = [b1 | b2 for b1, b2 in zip(self.qbitarray_values, self.other_qbitarray_values)] + except: + has_or_bitwise_operator = False + self.assertTrue(has_or_bitwise_operator) + self.assertEqual(bool_list_from_qbitarray(ored_qbitarray), ored_bool_list) + + def testQBitArrayAndBitwiseOperator(self): + #Tests QBitArray '&' (and) operator + has_and_bitwise_operator = True + anded_qbitarray, anded_bool_list = None, None + try: + anded_qbitarray = self.qbitarray | self.other_qbitarray + anded_bool_list = [b1 | b2 for b1, b2 in zip(self.qbitarray_values, self.other_qbitarray_values)] + except: + has_and_bitwise_operator = False + self.assertTrue(has_and_bitwise_operator) + self.assertEqual(bool_list_from_qbitarray(anded_qbitarray), anded_bool_list) + + def testQBitArrayXorBitwiseOperator(self): + #Tests QBitArray '^' (xor) operator + has_xor_bitwise_operator = True + xored_qbitarray, xored_bool_list = None, None + try: + xored_qbitarray = self.qbitarray | self.other_qbitarray + xored_bool_list = [b1 | b2 for b1, b2 in zip(self.qbitarray_values, self.other_qbitarray_values)] + except: + has_xor_bitwise_operator = False + self.assertTrue(has_xor_bitwise_operator) + self.assertEqual(bool_list_from_qbitarray(xored_qbitarray), xored_bool_list) + + +class QBitArrayGetItemTest(unittest.TestCase): + '''Test case for []/__getitem__ operator''' + + def create_bitarray(self, values): + '''helper function to create a bit array''' + obj = QBitArray(len(values)) + for i, value in enumerate(values): + obj.setBit(i, value) + return obj + + def testSequenceProtocol(self): + '''QBitArray sequence protocol''' + data = [True, False, True] + obj = self.create_bitarray(data) + for reference, value in zip(data, obj): + self.assertEqual(reference, value) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py b/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py new file mode 100644 index 000000000..18e732f8c --- /dev/null +++ b/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py @@ -0,0 +1,53 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Tests QByteArray implementation of Python buffer protocol''' + +import unittest +import py3kcompat as py3k + +from os.path import isdir +from PySide2.QtCore import QByteArray + + +class QByteArrayBufferProtocolTest(unittest.TestCase): + '''Tests QByteArray implementation of Python buffer protocol''' + + def testQByteArrayBufferProtocol(self): + if py3k.IS_PY3K: + return + #Tests QByteArray implementation of Python buffer protocol using the os.path.isdir + #function which an unicode object or other object implementing the Python buffer protocol + isdir(QByteArray('/tmp')) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py b/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py new file mode 100644 index 000000000..641eeb066 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QByteArray concatenation with '+' operator''' + +import unittest + +from PySide2.QtCore import QByteArray + +class QByteArrayConcatenationOperatorTest(unittest.TestCase): + '''Test cases for QByteArray concatenation with '+' operator''' + + def testConcatQByteArrayAndPythonString(self): + #Test concatenation of a QByteArray with a Python string, in this order + qba = QByteArray('foo') + result = qba + '\x00bar' + self.assertEqual(type(result), QByteArray) + self.assertEqual(result, 'foo\x00bar') + + def testConcatPythonStringAndQByteArray(self): + #Test concatenation of a Python string with a QByteArray, in this order + concat_python_string_add_qbytearray_worked = True + qba = QByteArray('foo') + result = 'bar\x00' + qba + self.assertEqual(type(result), QByteArray) + self.assertEqual(result, 'bar\x00foo') + + # NOTICE: Does not makes sense concat a unicode string with a QByteArray, because the + # user does not know nothing about the internal representation of the unicode string. + #def testConcatPythonUnicodeAndQByteArray(self): + ##Test concatenation of a Python unicode object with a QByteArray, in this order + #concat_python_unicode_add_qbytearray_worked = True + #qba = QByteArray('foo') + #result = None + #try: + #result = u'ümlaut' + qba + #except: + #concat_python_unicode_add_qbytearray_worked = False + #self.assertTrue(concat_python_unicode_add_qbytearray_worked) + #self.assertEqual(result.__class__.__name__, 'unicode') + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py b/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py new file mode 100644 index 000000000..07b043df5 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py @@ -0,0 +1,92 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QByteArray +from helper.docmodifier import DocModifier + +class BaseQByteArrayOperatorIAdd(object): + '''Base class for QByteArray += operator tests. + + Implementing classes should inherit from unittest.TestCase and implement + setUp, setting self.obj and self.orig_obj to the target QByteArray and original + one, respectively''' + + __metaclass__ = DocModifier + + def testSingleString(self): + '''QByteArray += string of size 1''' + s = '0' + self.obj += s + self.assertEqual(self.obj, self.orig_obj + s) + self.assertEqual(self.obj.size(), self.orig_obj.size() + len(s)) + + def testString(self): + '''QByteArray += string of size > 1''' + s = 'dummy' + self.obj += s + self.assertEqual(self.obj, self.orig_obj + s) + self.assertEqual(self.obj.size(), self.orig_obj.size() + len(s)) + + def testQByteArray(self): + '''QByteArray += QByteArray''' + s = QByteArray('array') + self.obj += s + self.assertEqual(self.obj, self.orig_obj + s) + + def testChar(self): + '''QByteArray += char (number < 256)''' + s = ord('a') + self.obj += s + self.assertEqual(self.obj, self.orig_obj + s) + self.assertEqual(self.obj.size(), self.orig_obj.size() + 1) + +class NullQByteArrayOperatorIAdd(unittest.TestCase, BaseQByteArrayOperatorIAdd): + '''Test case for operator QByteArray += on null QByteArrays''' + + doc_prefix = 'Null object' + doc_filter = lambda x: x.startswith('test') + + def setUp(self): + self.obj = QByteArray() + self.orig_obj = QByteArray() + + +class ValidQByteArrayOperatorIAdd(unittest.TestCase, BaseQByteArrayOperatorIAdd): + '''Test case for operator QByteArray += on valid QByteArrays''' + + doc_prefix = 'Valid object' + doc_filter = lambda x: x.startswith('test') + + def setUp(self): + self.obj = QByteArray('some byte array') + self.orig_obj = QByteArray('some byte array') + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qbytearray_operator_test.py b/sources/pyside2/tests/QtCore/qbytearray_operator_test.py new file mode 100644 index 000000000..73ba0cdb9 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qbytearray_operator_test.py @@ -0,0 +1,116 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QByteArray operators''' + +import unittest +import py3kcompat as py3k + +from PySide2.QtCore import QByteArray + +class QByteArrayOperatorEqual(unittest.TestCase): + '''TestCase for operator QByteArray == QByteArray''' + + def testDefault(self): + #QByteArray() == QByteArray() + obj1 = QByteArray() + obj2 = QByteArray() + self.assertEqual(obj1, obj2) + + def testSimple(self): + #QByteArray(some_string) == QByteArray(some_string) + string = 'egg snakes' + self.assertEqual(QByteArray(string), QByteArray(string)) + + def testPyString(self): + #QByteArray(string) == string + string = 'my test string' + self.assertEqual(QByteArray(string), string) + + def testQString(self): + #QByteArray(string) == string + string = 'another test string' + self.assertEqual(QByteArray(string), string) + +class QByteArrayOperatorAt(unittest.TestCase): + '''TestCase for operator QByteArray[]''' + + def testInRange(self): + #QByteArray[x] where x is a valid index + string = 'abcdefgh' + obj = QByteArray(string) + + for i in range(len(string)): + self.assertEqual(obj[i], py3k.b(string[i])) + + def testInRangeReverse(self): + #QByteArray[x] where x is a valid index (reverse order) + string = 'abcdefgh' + obj = QByteArray(string) + + for i in range(len(string)-1, 0, -1): + self.assertEqual(obj[i], py3k.b(string[i])) + + + def testOutOfRange(self): + #QByteArray[x] where x is out of index + string = '1234567' + obj = QByteArray(string) + self.assertRaises(IndexError, lambda :obj[len(string)]) + + def testNullStrings(self): + ba = QByteArray('\x00') + self.assertEqual(ba.at(0), '\x00') + self.assertEqual(ba[0], py3k.b('\x00')) + +class QByteArrayOperatorLen(unittest.TestCase): + '''Test case for __len__ operator of QByteArray''' + + def testBasic(self): + '''QByteArray __len__''' + self.assertEqual(len(QByteArray()), 0) + self.assertEqual(len(QByteArray('')), 0) + self.assertEqual(len(QByteArray(' ')), 1) + self.assertEqual(len(QByteArray('yabadaba')), 8) + + +class QByteArrayOperatorStr(unittest.TestCase): + '''Test case for __str__ operator of QByteArray''' + + def testBasic(self): + '''QByteArray __str__''' + self.assertEqual(QByteArray().__str__(), '') + self.assertEqual(QByteArray('').__str__(), '') + self.assertEqual(QByteArray('aaa').__str__(), 'aaa') + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qbytearray_test.py b/sources/pyside2/tests/QtCore/qbytearray_test.py new file mode 100644 index 000000000..dce2b498c --- /dev/null +++ b/sources/pyside2/tests/QtCore/qbytearray_test.py @@ -0,0 +1,194 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QByteArray''' + +import unittest +import ctypes +import pickle +import py3kcompat as py3k + +from PySide2.QtCore import QByteArray, QSettings, QObject + +class QByteArrayTestToNumber(unittest.TestCase): + def testToNumberInt(self): + obj = QByteArray('37') + self.assertEqual((37, True), obj.toInt()) + + def testToNumberUShort(self): + obj = QByteArray('37') + self.assertEqual((37, True), obj.toUShort()) + + def testToNumberFloat(self): + obj = QByteArray('37.109') + self.assertEqual((ctypes.c_float(37.109).value, True), + obj.toFloat()) + + def testToNumberDouble(self): + obj = QByteArray('37.109') + self.assertEqual((ctypes.c_double(37.109).value, True), + obj.toDouble()) + + def testSetNum(self): + b = QByteArray() + b.setNum(py3k.long(-124124)) + self.assertEqual(b, "-124124") + b = QByteArray() + b.setNum(-124124) + self.assertEqual(b, "-124124") + b = QByteArray() + b.setNum(-0.5) + self.assertEqual(b, "-0.5") + + def testAppend(self): + b = QByteArray() + b.append("A") + self.assertEqual(b.size(), 1) + b.append("AB") + self.assertEqual(b.size(), 3) + + +class QByteArraySplit(unittest.TestCase): + '''Test case for QByteArray.split''' + + def testPathSeparator(self): + #QByteArray.split('/') + obj = QByteArray(unittest.__file__) + self.assertEqual(obj.split('/'), unittest.__file__.split('/')) + +class QByteArrayData(unittest.TestCase): + + '''Test case for QByteArray.data''' + + def testData(self): + url = QByteArray("http://web.openbossa.org/") + self.assertEqual(url.data(), py3k.b("http://web.openbossa.org/")) + + def testDataWithZeros(self): + s1 = "123\000321" + ba = QByteArray(s1) + s2 = ba.data() + self.assertEqual(py3k.b(s1), s2) + self.assertEqual(s1, ba) + +class QByteArrayOperatorAtSetter(unittest.TestCase): + '''Test case for operator QByteArray[] - __setitem__''' + + def testSetterString(self): + '''QByteArray[x] = pythonstring''' + obj = QByteArray('123456') + obj[1] = '0' + self.assertEqual(obj, QByteArray('103456')) + + def testSetterStringLarge(self): + '''QByteArray[x] = pythonstring (larget than 1 char)''' + obj = QByteArray('123456') + obj[3] = 'abba' + self.assertEqual(obj, QByteArray('123abba56')) + + def testSetterQByteArray(self): + '''QByteArray[x] = qbytearray''' + obj = QByteArray('123456') + obj[3] = QByteArray('array') + self.assertEqual(obj, QByteArray('123array56')) + + +class QByteArrayOperatorAtSetterNegativeIndex(unittest.TestCase): + '''Test case for QByteArray[] - __setitem__ - for negative index''' + + def testSetterNegativeIndex(self): + '''QByteArray[x] = string - negative index''' + obj = QByteArray('123456') + obj[-3] = 'array' + self.assertEqual(obj, QByteArray('123array56')) + + +class QByteArrayOperatorAtSetterLargeIndex(unittest.TestCase): + '''Test case for QByteArray[] - __setitem__ - for 'overflown' index''' + + def testSetterLargeIndexEmpty(self): + '''QByteArray[x] = somestring - Overflow index on empty string''' + # should pad with spaces if the index is larger + obj = QByteArray('') + obj[2] = 'a' + self.assertEqual(obj, QByteArray(' a')) + + def testSetterLargeIndexNormal(self): + '''QByteArray[x] = somestring - Overflow index on normal string''' + # should pad with spaces if the index is larger + obj = QByteArray('mystring') + obj[10] = 'normal' + self.assertEqual(obj, QByteArray('mystring normal')) + +class QByteArrayOnQVariant(unittest.TestCase): + def testQByteArrayOnQVariant(self): + a = QSettings().value("some_prop", QByteArray()) + self.assertEqual(type(a), QByteArray) + +class TestBug666(unittest.TestCase): + '''QByteArray does not support slices''' + def testIt(self): + if not py3k.IS_PY3K: + ba = QByteArray('1234567890') + self.assertEqual(ba[2:4], '34') + self.assertEqual(ba[:4], '1234') + self.assertEqual(ba[4:], '567890') + self.assertEqual(len(ba[4:1]), 0) + +class QByteArrayBug514(unittest.TestCase): + def testIt(self): + data = py3k.b("foobar") + a = QByteArray.fromRawData(data) + self.assertEqual(type(a), QByteArray) + self.assertEqual(a.data(), data) + +class TestPickler(unittest.TestCase): + def testIt(self): + ba = QByteArray("321\x00123") + output = pickle.dumps(str(ba)) + ba2 = pickle.loads(output) + self.assertEqual(ba, ba2) + +class QByteArrayBug720(unittest.TestCase): + def testIt(self): + ba = QByteArray(b"32\"1\x00123") + self.assertEqual(str(ba), "32\"1\x00123") + self.assertEqual(repr(ba), "PySide2.QtCore.QByteArray('32\"1\x00123')") + +class QByteArrayImplicitConvert(unittest.TestCase): + def testString(self): + # No implicit conversions from QByteArray to python string + ba = QByteArray("object name") + obj = QObject() + self.assertRaises(TypeError, obj.setObjectName, ba) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qcollator_test.py b/sources/pyside2/tests/QtCore/qcollator_test.py new file mode 100644 index 000000000..0afb1ca8b --- /dev/null +++ b/sources/pyside2/tests/QtCore/qcollator_test.py @@ -0,0 +1,61 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QCollator''' + +import unittest +import ctypes +import sys + +from PySide2.QtCore import * + +class QCollatorTest(unittest.TestCase): + def testState(self): + c = QCollator() + c.setCaseSensitivity(Qt.CaseInsensitive) + c.setLocale(QLocale.German) + + print("compare a and b:", c.compare("a", "b")) + + self.assertEqual(c.caseSensitivity(), Qt.CaseInsensitive) + self.assertEqual(c.locale(), QLocale(QLocale.German)) + + c.setLocale(QLocale.French) + c.setNumericMode(True) + c.setIgnorePunctuation(True) + c.setLocale(QLocale.Norwegian) + + self.assertEqual(c.caseSensitivity(), Qt.CaseInsensitive) + self.assertEqual(c.numericMode(), True) + self.assertEqual(c.ignorePunctuation(), True) + self.assertEqual(c.locale(), QLocale(QLocale.Norwegian)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qcommandlineparser_test.py b/sources/pyside2/tests/QtCore/qcommandlineparser_test.py new file mode 100644 index 000000000..d752dfafe --- /dev/null +++ b/sources/pyside2/tests/QtCore/qcommandlineparser_test.py @@ -0,0 +1,56 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QCommandLineParser and QCommandLineOption''' + +import unittest +import ctypes +import sys + +from PySide2.QtCore import * + +class QCommandLineParserTest(unittest.TestCase): + def testParser(self): + app = QCoreApplication([]) + + parser1 = QCommandLineParser() + self.assertEqual(parser1.parse(["QtCore_qcommandlineparser_test", "file.txt"]), True) + self.assertEqual(parser1.positionalArguments(), ["file.txt"]) + + parser2 = QCommandLineParser() + self.assertEqual(parser2.addOption(QCommandLineOption("b")), True) + self.assertEqual(parser2.parse(["QtCore_qcommandlineparser_test", "-b"]), True) + self.assertEqual(parser2.optionNames(), ["b"]) + self.assertEqual(parser2.isSet("b"), True) + self.assertEqual(parser2.values("b"), []) + self.assertEqual(parser2.positionalArguments(), []) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py b/sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py new file mode 100644 index 000000000..9be752cd8 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QCoreApplication.instance static method''' + +import unittest + +from PySide2.QtCore import QCoreApplication + +class QCoreApplicationInstanceTest(unittest.TestCase): + '''Test cases for QCoreApplication.instance static method''' + + def testQCoreApplicationInstance(self): + #Tests QCoreApplication.instance() + self.assertEqual(QCoreApplication.instance(), None) + app = QCoreApplication([]) + self.assertEqual(QCoreApplication.instance(), app) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qdatastream_test.py b/sources/pyside2/tests/QtCore/qdatastream_test.py new file mode 100644 index 000000000..309d55208 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qdatastream_test.py @@ -0,0 +1,355 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QDataStream''' + +import unittest +import py3kcompat as py3k + +from PySide2.QtCore import QBitArray, QByteArray, QIODevice, QDataStream, QDate, QTime, QDateTime + +def create_bitarray(string): + array = QBitArray(len(string)) + for i, char in enumerate(string): + array.setBit(i, char != '0') + return array + +class QDataStreamWrite(unittest.TestCase): + '''Test case for QDatastream write* functions''' + + def setUp(self): + self.ba = QByteArray() + self.read = QDataStream(self.ba, QIODevice.ReadOnly) + self.write = QDataStream(self.ba, QIODevice.WriteOnly) + + def testWriteUInt8(self): + '''QDataStream.writeUInt8 (accepting str of size 1)''' + x = 0xFF + self.write.writeUInt8(x) + y = self.read.readUInt8() + self.assertEqual(x, y) + + self.assertRaises(TypeError, self.write.writeUInt8, 'aaaaa') + + def testWriteInt8(self): + '''QDataStream.writeInt8 (accepting str of size 1)''' + x = 65 + self.write.writeInt8(chr(x)) + y = self.read.readInt8() + self.assertEqual(x, y) + + self.assertRaises(TypeError, self.write.writeInt8, 'aaaaa') + + def testWriteUInt8Int(self): + '''QDataStream.writeUInt8 (accepting integer)''' + x = 0xFF + self.write.writeUInt8(x) + y = self.read.readUInt8() + self.assertEqual(x, y) + + def testWriteInt8Int(self): + '''QDataStream.writeInt8 (accepting integer)''' + x = 65 + self.write.writeInt8(x) + y = self.read.readInt8() + self.assertEqual(x, y) + + def testWriteUInt16(self): + '''QDataStream.writeUInt16''' + x = 0x4423 + self.write.writeUInt16(x) + y = int(self.read.readUInt16()) + self.assertEqual(x, y) + + def testWriteUInt32(self): + '''QDataStream.writeUInt32''' + x = 0xdeadbeef + self.write.writeUInt32(x) + y = int(self.read.readUInt32()) + self.assertEqual(x, y) + +class QDataStreamShift(unittest.TestCase): + '''Test case for << and >> operators''' + + def setUp(self): + self.ba = QByteArray() + self.stream = QDataStream(self.ba, QIODevice.WriteOnly) + self.read_stream = QDataStream(self.ba, QIODevice.ReadOnly) + + def testQCharValid(self): + '''QDataStream <<>> QChar - valid''' + self.stream.writeQChar(42) + + res = self.read_stream.readQChar() + self.assertEqual(res, py3k.unichr(42)) + + def testQCharNull(self): + '''QDataStream <<>> QChar - null''' + self.stream.writeQChar(None) + + res = self.read_stream.readQChar() + self.assertEqual(res, py3k.unicode_('\x00')) + + def testQByteArrayValid(self): + '''QDataStream <<>> QByteArray - valid''' + self.stream << QByteArray("hello") + + res = QByteArray() + + self.read_stream >> res + self.assertEqual(res, QByteArray("hello")) + + def testQByteArrayEmpty(self): + '''QDataStream <<>> QByteArray - empty''' + self.stream << QByteArray("") + + res = QByteArray() + + self.read_stream >> res + self.assertEqual(res, QByteArray("")) + self.assertTrue(res.isEmpty()) + self.assertFalse(res.isNull()) + + def testQByteArrayNull(self): + '''QDataStream <<>> QByteArray - null''' + self.stream << QByteArray() + + res = QByteArray() + + self.read_stream >> res + self.assertEqual(res, QByteArray()) + self.assertTrue(res.isEmpty()) + self.assertTrue(res.isNull()) + + def testQStringValid(self): + '''QDataStream <<>> QString - valid''' + self.stream.writeQString('Ka-boom') + + res = self.read_stream.readQString() + self.assertEqual(res, py3k.unicode_('Ka-boom')) + + def testQStringEmpty(self): + '''QDataStream <<>> QString - empty''' + self.stream.writeQString('') + + res = self.read_stream.readQString() + self.assertEqual(res, py3k.unicode_('')) + + def testQStringNull(self): + '''QDataStream <<>> QString - null''' + self.stream.writeQString(None) + + res = self.read_stream.readQString() + self.assertEqual(res, py3k.unicode_('')) + + def testQBitArrayNull(self): + '''QDataStream <<>> QBitArray - null''' + self.stream << QBitArray() + + res = QBitArray() + + self.read_stream >> res + self.assertEqual(res, QBitArray()) + + def testQBitArrayValid(self): + '''QDataStream <<>> QBitArray - valid''' + self.stream << create_bitarray('01010101') + + res = QBitArray() + + self.read_stream >> res + self.assertEqual(res, create_bitarray('01010101')) + + def testQDateNull(self): + '''QDataStream <<>> QDate - null''' + self.stream << QDate() + + res = QDate() + + self.read_stream >> res + self.assertEqual(res, QDate()) + self.assertFalse(res.isValid()) + self.assertTrue(res.isNull()) + + def testQDateValid(self): + '''QDataStream <<>> QDate - valid''' + self.stream << QDate(2012, 12, 21) + + res = QDate() + + self.read_stream >> res + self.assertEqual(res, QDate(2012, 12, 21)) + self.assertTrue(res.isValid()) + self.assertFalse(res.isNull()) + + + def testQTimeNull(self): + '''QDataStream <<>> QTime - null''' + self.stream << QTime() + + res = QTime() + + self.read_stream >> res + self.assertEqual(res, QTime()) + self.assertFalse(res.isValid()) + self.assertTrue(res.isNull()) + + def testQTimeValid(self): + '''QDataStream <<>> QTime - valid''' + self.stream << QTime(12, 12, 21) + + res = QTime() + + self.read_stream >> res + self.assertEqual(res, QTime(12, 12, 21)) + self.assertTrue(res.isValid()) + self.assertFalse(res.isNull()) + + def testQDateTimeNull(self): + '''QDataStream <<>> QDateTime - null''' + + self.stream << QDateTime() + + res = QDateTime() + + self.read_stream >> res + self.assertEqual(res, QDateTime()) + self.assertFalse(res.isValid()) + self.assertTrue(res.isNull()) + + def testQDateTimeValid(self): + '''QDataStream <<>> QDateTime - valid''' + time = QTime(23, 23, 23) + date = QDate(2009, 1, 1) + + self.stream << QDateTime(date, time) + + res = QDateTime() + + self.read_stream >> res + self.assertEqual(res, QDateTime(date, time)) + self.assertTrue(res.isValid()) + self.assertFalse(res.isNull()) + + +class QDataStreamShiftBitArray(unittest.TestCase): + + def _check_bitarray(self, data_set): + '''Check the >> operator for the given data set''' + + for data, expectedStatus, expectedString in data_set: + stream = QDataStream(data, QIODevice.ReadOnly) + string = QBitArray() + stream >> string + + self.assertEqual(stream.status(), expectedStatus) + self.assertEqual(string.size(), expectedString.size()) + self.assertEqual(string, expectedString) + + def testOk(self): + '''QDataStream with valid QBitArray''' + data = [] + + data.append((QByteArray('\x00\x00\x00\x00'), QDataStream.Ok, + QBitArray())) + data.append((QByteArray('\x00\x00\x00\x01\x00'), QDataStream.Ok, + create_bitarray('0'))) + data.append((QByteArray('\x00\x00\x00\x01\x01'), QDataStream.Ok, + create_bitarray('1'))) + data.append((QByteArray('\x00\x00\x00\x02\x03'), QDataStream.Ok, + create_bitarray('11'))) + data.append((QByteArray('\x00\x00\x00\x03\x07'), QDataStream.Ok, + create_bitarray('111'))) + data.append((QByteArray('\x00\x00\x00\x04\x0f'), QDataStream.Ok, + create_bitarray('1111'))) + data.append((QByteArray('\x00\x00\x00\x05\x1f'), QDataStream.Ok, + create_bitarray('11111'))) + data.append((QByteArray('\x00\x00\x00\x06\x3f'), QDataStream.Ok, + create_bitarray('111111'))) + data.append((QByteArray('\x00\x00\x00\x07\x7f'), QDataStream.Ok, + create_bitarray('1111111'))) + data.append((QByteArray('\x00\x00\x00\x07\x7e'), QDataStream.Ok, + create_bitarray('0111111'))) + data.append((QByteArray('\x00\x00\x00\x07\x00'), QDataStream.Ok, + create_bitarray('0000000'))) + data.append((QByteArray('\x00\x00\x00\x07\x39'), QDataStream.Ok, + create_bitarray('1001110'))) + + self._check_bitarray(data) + + def testPastEnd(self): + '''QDataStream >> QBitArray reading past the end of the data''' + data = [] + + data.append((QByteArray(), QDataStream.ReadPastEnd, + QBitArray())) + data.append((QByteArray('\x00'), QDataStream.ReadPastEnd, + QBitArray())) + data.append((QByteArray('\x00\x00'), QDataStream.ReadPastEnd, + QBitArray())) + data.append((QByteArray('\x00\x00\x00'), QDataStream.ReadPastEnd, + QBitArray())) + data.append((QByteArray('\x00\x00\x00\x01'), QDataStream.ReadPastEnd, + QBitArray())) + data.append((QByteArray('\x00\x00\x00\x02'), QDataStream.ReadPastEnd, + QBitArray())) + data.append((QByteArray('\x00\x00\x00\x03'), QDataStream.ReadPastEnd, + QBitArray())) + data.append((QByteArray('\x00\x00\x00\x04'), QDataStream.ReadPastEnd, + QBitArray())) + + self._check_bitarray(data) + + def testCorruptData(self): + '''QDataStream reading corrupt data''' + data = [] + + data.append((QByteArray('\x00\x00\x00\x01\x02'), + QDataStream.ReadCorruptData, + QBitArray())) + + self._check_bitarray(data) + +class QDataStreamRawData(unittest.TestCase): + def testRawData(self): + data = QDataStream() + self.assertEqual(data.readRawData(4), None) + + ba = QByteArray() + data = QDataStream(ba, QIODevice.WriteOnly) + data.writeRawData('AB\x00C') + self.assertEqual(ba.data(), py3k.b('AB\x00C')) + + data = QDataStream(ba) + self.assertEqual(data.readRawData(4), py3k.b('AB\x00C')) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qdate_test.py b/sources/pyside2/tests/QtCore/qdate_test.py new file mode 100644 index 000000000..9554e41e0 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qdate_test.py @@ -0,0 +1,62 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QDate''' + +import unittest + +from PySide2.QtCore import * + +class TestQDate (unittest.TestCase): + def testGetDate(self): + date = QDate(2009, 22, 9) + tuple_ = date.getDate() + self.assertEqual(tuple, tuple_.__class__) + (y, m, d) = tuple_ + self.assertEqual(date.year(), y) + self.assertEqual(date.month(), m) + self.assertEqual(date.day(), d) + + def testGetWeekNumber(self): + date = QDate(2000, 1, 1) + tuple_ = date.weekNumber() + self.assertEqual(tuple, tuple_.__class__) + (week, yearNumber) = tuple_ + 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() diff --git a/sources/pyside2/tests/QtCore/qdatetime_test.py b/sources/pyside2/tests/QtCore/qdatetime_test.py new file mode 100644 index 000000000..6df6edf70 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qdatetime_test.py @@ -0,0 +1,51 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import datetime + +from PySide2.QtCore import QDateTime, QDate, QTime + +class TestQDate (unittest.TestCase): + def testDateConversion(self): + dateTime = QDateTime(QDate(2011, 5, 17), QTime(11, 1, 14, 15)) + dateTimePy = QDateTime(datetime.date(2011, 5, 17), datetime.time(11, 1, 14, 15000)) + self.assertEqual(dateTime, dateTimePy) + + def testDateTimeConversion(self): + dateTime = QDateTime(QDate(2011, 5, 17), QTime(11, 1, 14, 15)) + dateTimePy = QDateTime(datetime.datetime(2011, 5, 17, 11, 1, 14, 15000)) + self.assertEqual(dateTime, dateTimePy) + + def testDateTimeNow(self): + py = datetime.datetime.now() + qt = QDateTime(py) + self.assertEqual(qt, py) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qeasingcurve_test.py b/sources/pyside2/tests/QtCore/qeasingcurve_test.py new file mode 100644 index 000000000..e6d8683b3 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qeasingcurve_test.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QEasingCurve + +def myFunction(progress): + if progress == 1.0: + return 100.0 + else: + return -100.0 + +class TestQEasingCurve(unittest.TestCase): + def testCustomType(self): + ec = QEasingCurve() + ec.setCustomType(myFunction) + self.assertEqual(ec.valueForProgress(1.0), 100.0) + self.assertEqual(ec.valueForProgress(0.5), -100.0) + + def testObjectCleanup(self): + for i in range(100): + ec = QEasingCurve() + ec.setCustomType(myFunction) + self.assertEqual(ec.valueForProgress(1.0), 100.0) + self.assertEqual(ec.valueForProgress(0.5), -100.0) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qenum_test.py b/sources/pyside2/tests/QtCore/qenum_test.py new file mode 100644 index 000000000..c0c734278 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qenum_test.py @@ -0,0 +1,74 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QEnum and QFlags''' + +import unittest + +from PySide2.QtCore import * + +class TestEnum(unittest.TestCase): + + def testToInt(self): + self.assertEqual(QIODevice.NotOpen, 0) + self.assertEqual(QIODevice.ReadOnly, 1) + self.assertEqual(QIODevice.WriteOnly, 2) + self.assertEqual(QIODevice.ReadWrite, 1 | 2) + self.assertEqual(QIODevice.Append, 4) + self.assertEqual(QIODevice.Truncate, 8) + self.assertEqual(QIODevice.Text, 16) + self.assertEqual(QIODevice.Unbuffered, 32) + + def testToIntInFunction(self): + self.assertEqual(str(int(QIODevice.WriteOnly)), "2") + +class TestQFlags(unittest.TestCase): + def testToItn(self): + om = QIODevice.NotOpen + + self.assertEqual(om, QIODevice.NotOpen) + self.assertTrue(om == 0) + + self.assertTrue(om != QIODevice.ReadOnly) + self.assertTrue(om != 1) + + def testToIntInFunction(self): + om = QIODevice.WriteOnly + self.assertEqual(int(om), 2) + + def testNonExtensibleEnums(self): + try: + om = QIODevice.OpenMode(QIODevice.WriteOnly) + self.assertFail() + except: + pass + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qevent_test.py b/sources/pyside2/tests/QtCore/qevent_test.py new file mode 100644 index 000000000..f0c028f76 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qevent_test.py @@ -0,0 +1,53 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QtCore.QEvent''' + +import unittest + +from PySide2.QtCore import QEvent + +class QEventTypeFlag(unittest.TestCase): + '''Test case for usage of QEvent.Type flags''' + + def testFlagAccess(self): + #QEvent.Type flags usage + + event = QEvent(QEvent.Timer) + self.assertEqual(event.type(), QEvent.Timer) + + event = QEvent(QEvent.Close) + self.assertEqual(event.type(), QEvent.Close) + + event = QEvent(QEvent.IconTextChange) + self.assertEqual(event.type(), QEvent.IconTextChange) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qfile_test.py b/sources/pyside2/tests/QtCore/qfile_test.py new file mode 100644 index 000000000..b58e9b6ab --- /dev/null +++ b/sources/pyside2/tests/QtCore/qfile_test.py @@ -0,0 +1,88 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import os +import tempfile +import sys +import py3kcompat as py3k + +from PySide2.QtCore import QDir, QFile, QIODevice, QSaveFile, QTemporaryDir + +class GetCharTest(unittest.TestCase): + '''Test case for QIODevice.getChar in QFile''' + + def setUp(self): + '''Acquire resources''' + handle, self.filename = tempfile.mkstemp() + os.write(handle, py3k.b('a')) + os.close(handle) + + def tearDown(self): + '''release resources''' + os.remove(self.filename) + + def testBasic(self): + '''QFile.getChar''' + obj = QFile(self.filename) + obj.open(QIODevice.ReadOnly) + try: + self.assertEqual(obj.getChar(), (True, 'a')) + self.assertFalse(obj.getChar()[0]) + finally: + obj.close() + + def testBug721(self): + obj = QFile(self.filename) + obj.open(QIODevice.ReadOnly) + try: + memory = obj.map(0, 1) + self.assertEqual(len(memory), 1) + if sys.version_info[0] >= 3: + self.assertEqual(memory[0], ord('a')) + else: + self.assertEqual(memory[0], py3k.b('a')) + # now memory points to wild bytes... :-) + # uncommenting this must cause a segfault. + # self.assertEqual(memory[0], 'a') + finally: + obj.unmap(memory) + obj.close() + + def testQSaveFile(self): + dir = QTemporaryDir(QDir.tempPath() + "/XXXXXX.dir") + self.assertTrue(dir.isValid()) + saveFile = QSaveFile(dir.path() + "/test.dat") + self.assertTrue(saveFile.open(QIODevice.WriteOnly)) + saveFile.write("Test") + self.assertTrue(saveFile.commit()) + self.assertTrue(os.path.exists(QDir.toNativeSeparators(saveFile.fileName()))) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qfileinfo_test.py b/sources/pyside2/tests/QtCore/qfileinfo_test.py new file mode 100644 index 000000000..9d06aa955 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qfileinfo_test.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import os +import tempfile + +from PySide2.QtCore import QFile, QFileInfo + +class QFileConstructor(unittest.TestCase): + '''QFileInfo constructor with qfile''' + + def testBasic(self): + '''QFileInfo(QFile)''' + obj = QFileInfo(QFile()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qflags_test.py b/sources/pyside2/tests/QtCore/qflags_test.py new file mode 100644 index 000000000..571e85a7f --- /dev/null +++ b/sources/pyside2/tests/QtCore/qflags_test.py @@ -0,0 +1,121 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QFlags''' + +import unittest +from PySide2.QtCore import Qt, QTemporaryFile, QFile, QIODevice, QObject + +class QFlagTest(unittest.TestCase): + '''Test case for usage of flags''' + + def testCallFunction(self): + f = QTemporaryFile() + self.assertTrue(f.open()) + fileName = f.fileName() + f.close() + + f = QFile(fileName) + self.assertEqual(f.open(QIODevice.Truncate | QIODevice.Text | QIODevice.ReadWrite), True) + om = f.openMode() + self.assertEqual(om & QIODevice.Truncate, QIODevice.Truncate) + self.assertEqual(om & QIODevice.Text, QIODevice.Text) + self.assertEqual(om & QIODevice.ReadWrite, QIODevice.ReadWrite) + self.assertTrue(om == QIODevice.Truncate | QIODevice.Text | QIODevice.ReadWrite) + f.close() + + +class QFlagOperatorTest(unittest.TestCase): + '''Test case for operators in QFlags''' + + def testInvert(self): + '''QFlags ~ (invert) operator''' + self.assertEqual(type(~QIODevice.ReadOnly), QIODevice.OpenMode) + + def testOr(self): + '''QFlags | (or) operator''' + self.assertEqual(type(QIODevice.ReadOnly | QIODevice.WriteOnly), QIODevice.OpenMode) + + def testAnd(self): + '''QFlags & (and) operator''' + self.assertEqual(type(QIODevice.ReadOnly & QIODevice.WriteOnly), QIODevice.OpenMode) + + def testIOr(self): + '''QFlags |= (ior) operator''' + flag = Qt.WindowFlags() + self.assertTrue(Qt.Widget == 0) + self.assertFalse(flag & Qt.Widget) + result = flag & Qt.Widget + self.assertTrue(result == 0) + flag |= Qt.WindowMinimizeButtonHint + self.assertTrue(flag & Qt.WindowMinimizeButtonHint) + + def testInvertOr(self): + '''QFlags ~ (invert) operator over the result of an | (or) operator''' + self.assertEqual(type(~(Qt.ItemIsSelectable | Qt.ItemIsEditable)), Qt.ItemFlags) + + def testEqual(self): + '''QFlags == operator''' + flags = Qt.Window + flags |= Qt.WindowMinimizeButtonHint + flag_type = (flags & Qt.WindowType_Mask) + self.assertEqual(flag_type, Qt.Window) + + self.assertEqual(Qt.KeyboardModifiers(Qt.ControlModifier), Qt.ControlModifier) + + def testOperatorBetweenFlags(self): + '''QFlags & QFlags''' + flags = Qt.NoItemFlags | Qt.ItemIsUserCheckable + newflags = Qt.NoItemFlags | Qt.ItemIsUserCheckable + self.assertTrue(flags & newflags) + + def testOperatorDifferentOrder(self): + '''Different ordering of arguments''' + flags = Qt.NoItemFlags | Qt.ItemIsUserCheckable + self.assertEqual(flags | Qt.ItemIsEnabled, Qt.ItemIsEnabled | flags) + +class QFlagsOnQVariant(unittest.TestCase): + def testQFlagsOnQVariant(self): + o = QObject() + o.setProperty("foo", QIODevice.ReadOnly | QIODevice.WriteOnly) + self.assertEqual(type(o.property("foo")), QIODevice.OpenMode) + +class QFlagsWrongType(unittest.TestCase): + def testWrongType(self): + '''Wrong type passed to QFlags binary operators''' + + self.assertRaises(TypeError, Qt.NoItemFlags | '43') + self.assertRaises(TypeError, Qt.NoItemFlags & '43') + self.assertRaises(TypeError, 'jabba' & Qt.NoItemFlags) + self.assertRaises(TypeError, 'hut' & Qt.NoItemFlags) + self.assertRaises(TypeError, Qt.NoItemFlags & QObject()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qhandle_test.py b/sources/pyside2/tests/QtCore/qhandle_test.py new file mode 100644 index 000000000..8ceee3684 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qhandle_test.py @@ -0,0 +1,45 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QEnum and QFlags''' + +import unittest + +from PySide2.QtCore import QThread, Qt + +class TestHANDLE(unittest.TestCase): + def testIntConversion(self): + i = 0 + h = QThread.currentThreadId() + i = 0 + int(h) + self.assertEqual(i, int(h)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py b/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py new file mode 100644 index 000000000..d8f7bb3a5 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py @@ -0,0 +1,80 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for qInstallMsgHandler''' + +import unittest +import sys + +from PySide2.QtCore import * + +param = [] + +def handler(msgt, ctx, msg): + global param + param = [msgt, ctx, msg.strip()] + +def handleruseless(msgt, ctx, msg): + pass + +class QInstallMsgHandlerTest(unittest.TestCase): + + def tearDown(self): + # Ensure that next test will have a clear environment + qInstallMessageHandler(None) + + def testNone(self): + ret = qInstallMessageHandler(None) + self.assertEqual(ret, None) + + def testRet(self): + ret = qInstallMessageHandler(None) + self.assertEqual(ret, None) + refcount = sys.getrefcount(handleruseless) + retNone = qInstallMessageHandler(handleruseless) + self.assertEqual(sys.getrefcount(handleruseless), refcount + 1) + rethandler = qInstallMessageHandler(None) + self.assertEqual(rethandler, handleruseless) + del rethandler + self.assertEqual(sys.getrefcount(handleruseless), refcount) + + def testHandler(self): + rethandler = qInstallMessageHandler(handler) + qDebug("Test Debug") + self.assertEqual(param[0], QtDebugMsg) + self.assertEqual(param[2], "Test Debug") + qWarning("Test Warning") + self.assertEqual(param[0], QtWarningMsg) + self.assertEqual(param[2], "Test Warning") + qCritical("Test Critical") + self.assertEqual(param[0], QtCriticalMsg) + self.assertEqual(param[2], "Test Critical") + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qlinef_test.py b/sources/pyside2/tests/QtCore/qlinef_test.py new file mode 100644 index 000000000..1388e5aac --- /dev/null +++ b/sources/pyside2/tests/QtCore/qlinef_test.py @@ -0,0 +1,49 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QLineF''' + +import unittest +import os + +from PySide2.QtCore import * + +class TestQLineF (unittest.TestCase): + def testIntersect(self): + l1 = QLineF(0, 0, 1, 0) + l2 = QLineF(1, -1, 1, 1) + tuple_ = l1.intersect(l2) + self.assertEqual(tuple, tuple_.__class__) + (value, p) = tuple_ + self.assertEqual(QLineF.BoundedIntersection, value) + self.assertEqual(QPointF(1, 0), p) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qlocale_test.py b/sources/pyside2/tests/QtCore/qlocale_test.py new file mode 100644 index 000000000..63aa3293d --- /dev/null +++ b/sources/pyside2/tests/QtCore/qlocale_test.py @@ -0,0 +1,69 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QLocale''' + +import unittest +import ctypes +import sys + +from PySide2.QtCore import QLocale + +class QLocaleTestToNumber(unittest.TestCase): + def testToNumberInt(self): + obj = QLocale(QLocale.C) + self.assertEqual((37, True), obj.toInt('37')) + + def testToNumberFloat(self): + obj = QLocale(QLocale.C) + self.assertEqual((ctypes.c_float(37.109).value, True), + obj.toFloat('37.109')) + + def testToNumberDouble(self): + obj = QLocale(QLocale.C) + self.assertEqual((ctypes.c_double(37.109).value, True), + obj.toDouble('37.109')) + + def testToNumberShort(self): + obj = QLocale(QLocale.C) + self.assertEqual((ctypes.c_short(37).value, True), + obj.toShort('37')) + + def testToNumberULongLong(self): + obj = QLocale(QLocale.C) + self.assertEqual((ctypes.c_ulonglong(37).value, True), + obj.toULongLong('37')) + + def testToNumberULongLongNegative(self): + obj = QLocale(QLocale.C) + self.assertTrue(not obj.toULongLong('-37')[1]) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qmetaobject_test.py b/sources/pyside2/tests/QtCore/qmetaobject_test.py new file mode 100644 index 000000000..536fbe368 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qmetaobject_test.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Tests for static methos conflicts with class methods''' + +import unittest + +from PySide2.QtCore import * + +class Foo(QFile): + pass + +class DynObject(QObject): + def slot(self): + pass + +class qmetaobject_test(unittest.TestCase): + """ + def test_QMetaObject(self): + qobj = QObject() + qobj_metaobj = qobj.metaObject() + self.assertEqual(qobj_metaobj.className(), "QObject") + + obj = QFile() + m = obj.metaObject() + self.assertEqual(m.className(), "QFile") + self.assertNotEqual(m.methodCount(), qobj_metaobj.methodCount()) + + obj = Foo() + m = obj.metaObject() + self.assertEqual(m.className(), "Foo") + f = QFile() + fm = f.metaObject() + self.assertEqual(m.methodCount(), fm.methodCount()) + """ + + def test_DynamicSlotSignal(self): + o = DynObject() + o2 = QObject() + + o.connect(o2, SIGNAL("bars()"), o.slot) + self.assertTrue(o2.metaObject().indexOfMethod("bars()") > -1) + #self.assertTrue(o.metaObject().indexOfMethod("bar()") == -1) + #self.assertTrue(o.metaObject().indexOfMethod("slot()") > -1) + + #slot_index = o.metaObject().indexOfMethod("slot()") + + #o.connect(o, SIGNAL("foo()"), o2, SIGNAL("bar()")) + #signal_index = o.metaObject().indexOfMethod("foo()"); + + #self.assertTrue(slot_index != signal_index) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qmimedatabase_test.py b/sources/pyside2/tests/QtCore/qmimedatabase_test.py new file mode 100644 index 000000000..7bd9a4586 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qmimedatabase_test.py @@ -0,0 +1,78 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QMimeDatabase''' + +import unittest +import ctypes +import sys + +from PySide2.QtCore import QMimeDatabase + +class QMimeDatabaseTest(unittest.TestCase): + def testMimeTypeForName(self): + db = QMimeDatabase() + + s0 = db.mimeTypeForName("application/x-zerosize") + self.assertTrue(s0.isValid()) + self.assertEqual(s0.name(), "application/x-zerosize") + self.assertEqual(s0.comment(), "empty document") + + s0Again = db.mimeTypeForName("application/x-zerosize") + self.assertEqual(s0Again.name(), s0.name()) + + s1 = db.mimeTypeForName("text/plain") + self.assertTrue(s1.isValid()) + self.assertEqual(s1.name(), "text/plain") + # print("Comment is %s" % s1.comment()) + + krita = db.mimeTypeForName("application/x-krita") + self.assertTrue(krita.isValid()) + + # Test parsing with application/rdf+xml which has the english comment after the other ones + rdf = db.mimeTypeForName("application/rdf+xml") + self.assertTrue(rdf.isValid()) + self.assertEqual(rdf.name(), "application/rdf+xml") + self.assertEqual(rdf.comment(), "RDF file") + + bzip2 = db.mimeTypeForName("application/x-bzip2") + self.assertTrue(bzip2.isValid()) + self.assertEqual(bzip2.comment(), "Bzip archive") + + defaultMime = db.mimeTypeForName("application/octet-stream") + self.assertTrue(defaultMime.isValid()) + self.assertEqual(defaultMime.name(), "application/octet-stream") + self.assertTrue(defaultMime.isDefault()) + + doesNotExist = db.mimeTypeForName("foobar/x-doesnot-exist") + self.assertTrue(not doesNotExist.isValid()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py b/sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py new file mode 100644 index 000000000..e9732e3f7 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test case for QAbstractListModel.createIndex and QModelIndex.internalPointer''' + +import sys +import unittest +from PySide2.QtCore import * + +class MyModel (QAbstractListModel): + pass + +class TestQModelIndexInternalPointer(unittest.TestCase): + ''' Test case for QAbstractListModel.createIndex and QModelIndex.internalPointer''' + + def setUp(self): + #Acquire resources + self.model = MyModel() + + def tearDown(self): + #Release resources + del self.model + + def testInternalPointer(self): + #Test QAbstractListModel.createIndex and + #QModelIndex.internalPointer with regular + #Python objects + idx = self.model.createIndex(0, 0, "Hello") + self.assertEqual("Hello", idx.internalPointer()) + a = [1, 2, 3] + idx = self.model.createIndex(0, 0, a) + self.assertEqual(a, idx.internalPointer()) + + def testReferenceCounting(self): + #Test reference counting when retrieving data with + #QModelIndex.internalPointer + a = [1, 2, 3] + a_refcnt = sys.getrefcount(a) + idx = self.model.createIndex(0, 0, a) + ptr = idx.internalPointer() + self.assertEqual(sys.getrefcount(a), a_refcnt + 1) + + def testIndexForDefaultDataArg(self): + #Test QAbstractListModel.createIndex with a default + #value for data argument + idx = self.model.createIndex(0, 0) + self.assertEqual(None, idx.internalPointer()) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qobject_children_segfault_test.py b/sources/pyside2/tests/QtCore/qobject_children_segfault_test.py new file mode 100644 index 000000000..651233d86 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_children_segfault_test.py @@ -0,0 +1,56 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for parent-child relationship''' + +import unittest + +from PySide2.QtCore import QObject, QCoreApplication + +class ChildrenCoreApplication(unittest.TestCase): + '''Test case for calling QObject.children after creating a QCoreApp''' + + def testQCoreAppChildren(self): + #QObject.children() after creating a QCoreApplication + # Minimal test: + # 1- Create QCoreApp + # 2- Create parent and childrens + # 3- While keeping the children alive, call parent.children() + # 4- Delete parent + app = QCoreApplication([]) + parent = QObject() + children = [QObject(parent) for x in range(25)] + # Uncomment the lines below to make the test pass + # del children + # del child2 + del parent # XXX Segfaults here + self.assertTrue(True) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py b/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py new file mode 100644 index 000000000..50b748ca5 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test case for QObject::connectNotify()''' + +import unittest +from PySide2.QtCore import * +from helper import UsesQCoreApplication + +def cute_slot(): + pass + +class Obj(QObject): + def __init__(self): + QObject.__init__(self) + self.con_notified = False + self.dis_notified = False + self.signal = "" + + def connectNotify(self, signal): + self.con_notified = True + self.signal = signal + + def disconnectNotify(self, signal): + self.dis_notified = True + + def reset(self): + self.con_notified = False + self.dis_notified = False + +class TestQObjectConnectNotify(UsesQCoreApplication): + '''Test case for QObject::connectNotify''' + def setUp(self): + UsesQCoreApplication.setUp(self) + self.called = False + + def tearDown(self): + UsesQCoreApplication.tearDown(self) + + def testBasic(self): + sender = Obj() + receiver = QObject() + sender.connect(SIGNAL("destroyed()"), receiver, SLOT("deleteLater()")) + self.assertTrue(sender.con_notified) + # When connecting to a regular slot, and not a python callback function, QObject::connect + # will use the non-cloned method signature, so connecting to destroyed() will actually + # connect to destroyed(QObject*). + self.assertEqual(sender.signal.methodSignature(), "destroyed(QObject*)") + sender.disconnect(SIGNAL("destroyed()"), receiver, SLOT("deleteLater()")) + self.assertTrue(sender.dis_notified) + + def testPySignal(self): + sender = Obj() + receiver = QObject() + sender.connect(SIGNAL("foo()"), receiver, SLOT("deleteLater()")) + self.assertTrue(sender.con_notified) + sender.disconnect(SIGNAL("foo()"), receiver, SLOT("deleteLater()")) + self.assertTrue(sender.dis_notified) + + def testPySlots(self): + sender = Obj() + receiver = QObject() + sender.connect(SIGNAL("destroyed()"), cute_slot) + self.assertTrue(sender.con_notified) + sender.disconnect(SIGNAL("destroyed()"), cute_slot) + self.assertTrue(sender.dis_notified) + + def testpyAll(self): + sender = Obj() + receiver = QObject() + sender.connect(SIGNAL("foo()"), cute_slot) + self.assertTrue(sender.con_notified) + sender.disconnect(SIGNAL("foo()"), cute_slot) + self.assertTrue(sender.dis_notified) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_destructor.py b/sources/pyside2/tests/QtCore/qobject_destructor.py new file mode 100644 index 000000000..f1ffcaea7 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_destructor.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest +from PySide2 import QtCore + +class MyObject(QtCore.QObject): + def __init__(self, other=None): + QtCore.QObject.__init__(self, None) + self._o = other + +class TestDestructor(unittest.TestCase): + def testReference(self): + o = QtCore.QObject() + m = MyObject(o) + self.assertEqual(sys.getrefcount(o), 3) + del m + self.assertEqual(sys.getrefcount(o), 2) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_event_filter_test.py b/sources/pyside2/tests/QtCore/qobject_event_filter_test.py new file mode 100644 index 000000000..f90c377e4 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_event_filter_test.py @@ -0,0 +1,143 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QObject.eventFilter''' + +import unittest +import weakref +import sys + +from PySide2.QtCore import QObject, QTimerEvent + +from helper import UsesQCoreApplication + +class FilterObject(QObject): + '''Filter object for the basic test''' + def __init__(self, obj=None, event_type=None, *args): + #Creates a new filter object + QObject.__init__(self, *args) + self.obj = obj + self.event_type = event_type + self.events_handled = 0 + self.events_bypassed = 0 + + def setTargetObject(self, obj): + #Sets the object that will be filtered + self.obj = obj + + def eventFilter(self, obj, event): + '''Just checks if is the correct object and event type + incrementing counter until reaching the limit. After that it + stops filtering the events for the object.''' + if (self.obj == obj): + if isinstance(event, self.event_type) and self.events_handled < 5: + self.events_handled += 1 + return True + else: + self.events_bypassed += 1 + return False + else: + return QObject.eventFilter(self, obj, event) + +class FilteredObject(QObject): + '''Class that will be filtered. Quits the app after 5 timer events''' + def __init__(self, app, *args): + QObject.__init__(self, *args) + self.app = app + self.times_called = 0 + + def timerEvent(self, evt): + #Overriden method + self.times_called += 1 + + if self.times_called == 5: + self.app.quit() + +class TestQObjectEventFilterPython(UsesQCoreApplication): + '''QObject.eventFilter - Reimplemented in python + Filters 5 TimerEvents and then bypasses the other events to the + timerEvent method. After 5 runs, the timerEvent method will ask + the core application to exit''' + def setUp(self): + #Acquire resources + UsesQCoreApplication.setUp(self) + self.obj_filter = FilterObject(event_type=QTimerEvent) + def tearDown(self): + #Release resources + del self.obj_filter + UsesQCoreApplication.tearDown(self) + + def testEventFilter(self): + #QObject.eventFilter reimplemented in python + filtered = FilteredObject(self.app) + filtered.installEventFilter(self.obj_filter) + self.obj_filter.setTargetObject(filtered) + + filtered.startTimer(0) + + self.app.exec_() + + self.assertEqual(filtered.times_called, 5) + self.assertEqual(self.obj_filter.events_handled, 5) + + def testInstallEventFilterRefCountAfterDelete(self): + '''Bug 910 - installEventFilter() increments reference count on target object + http://bugs.pyside.org/show_bug.cgi?id=910''' + obj = QObject() + filt = QObject() + + self.assertEqual(sys.getrefcount(obj), 2) + self.assertEqual(sys.getrefcount(filt), 2) + obj.installEventFilter(filt) + self.assertEqual(sys.getrefcount(obj), 2) + self.assertEqual(sys.getrefcount(filt), 2) + + wref = weakref.ref(obj) + del obj + self.assertEqual(wref(), None) + + def testInstallEventFilterRefCountAfterRemove(self): + # Bug 910 + obj = QObject() + filt = QObject() + + self.assertEqual(sys.getrefcount(obj), 2) + self.assertEqual(sys.getrefcount(filt), 2) + obj.installEventFilter(filt) + self.assertEqual(sys.getrefcount(obj), 2) + self.assertEqual(sys.getrefcount(filt), 2) + obj.removeEventFilter(filt) + self.assertEqual(sys.getrefcount(obj), 2) + self.assertEqual(sys.getrefcount(filt), 2) + + wref = weakref.ref(obj) + del obj + self.assertEqual(wref(), None) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_inherits_test.py b/sources/pyside2/tests/QtCore/qobject_inherits_test.py new file mode 100644 index 000000000..8c4c797a4 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_inherits_test.py @@ -0,0 +1,91 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QObject methods''' + +import unittest + +from PySide2.QtCore import QObject + +class InheritsCase(unittest.TestCase): + '''Test case for QObject.inherits''' + + def testCppInheritance(self): + #QObject.inherits() for c++ classes + #An class inherits itself + self.assertTrue(QObject().inherits('QObject')) + + def testPythonInheritance(self): + #QObject.inherits() for python classes + + class Dummy(QObject): + #Dummy class + pass + + self.assertTrue(Dummy().inherits('QObject')) + self.assertTrue(Dummy().inherits('Dummy')) + self.assertTrue(not Dummy().inherits('FooBar')) + + def testPythonMultiInheritance(self): + #QObject.inherits() for multiple inheritance + # QObject.inherits(classname) should fail if classname isn't a + # QObject subclass + + class Parent(object): + #Dummy parent + pass + class Dummy(QObject, Parent): + #Dummy class + pass + + self.assertTrue(Dummy().inherits('QObject')) + self.assertTrue(not Dummy().inherits('Parent')) + + def testSetAttributeBeforeCallingInitOnQObjectDerived(self): + '''Test for bug #428.''' + class DerivedObject(QObject): + def __init__(self): + self.member = 'member' + QObject.__init__(self) + obj0 = DerivedObject() + # The second instantiation of DerivedObject will generate an exception + # that will not come to surface immediately. + obj1 = DerivedObject() + # The mere calling of the object method causes + # the exception to "reach the surface". + obj1.objectName() + + def testMultipleInheritance(self): + def declareClass(): + class Foo(object, QObject): + pass + + self.assertRaises(TypeError, declareClass) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_objectproperty_test.py b/sources/pyside2/tests/QtCore/qobject_objectproperty_test.py new file mode 100644 index 000000000..e1782e18c --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_objectproperty_test.py @@ -0,0 +1,58 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test case for the bug #378 +http://bugs.openbossa.org/show_bug.cgi?id=378 +''' + +import unittest +from PySide2.QtCore import QObject + +class ExtQObject(QObject): + def __init__(self): + # "foobar" will become a object attribute that will not be + # listed on the among the type attributes. Thus for bug + # condition be correctly triggered the "foobar" attribute + # must not previously exist in the parent class. + self.foobar = None + # The parent __init__ method must be called after the + # definition of "self.foobar". + QObject.__init__(self) + +class TestBug378(unittest.TestCase): + '''Test case for the bug #378''' + + def testBug378(self): + obj = ExtQObject() + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qobject_parent_test.py b/sources/pyside2/tests/QtCore/qobject_parent_test.py new file mode 100644 index 000000000..5a8c438d2 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_parent_test.py @@ -0,0 +1,287 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for parent-child relationship''' + +import unittest +from sys import getrefcount + +from PySide2.QtCore import * + +class ParentRefCountCase(unittest.TestCase): + '''Test case for the refcount changes of setParent''' + + def setUp(self): + #Acquire resources + self.parent = QObject() + self.child = QObject() + + def tearDown(self): + #Release resources + del self.child + del self.parent + + def testSetParent(self): + #QObject.setParent() refcount changes + self.assertEqual(getrefcount(self.child), 2) + self.child.setParent(self.parent) + self.assertEqual(getrefcount(self.child), 3) + + def testSetParentTwice(self): + self.assertEqual(getrefcount(self.child), 2) + self.child.setParent(self.parent) + self.assertEqual(getrefcount(self.child), 3) + self.child.setParent(self.parent) + self.assertEqual(getrefcount(self.child), 3) + + def testConstructor(self): + #QObject(QObject) refcount changes + child = QObject(self.parent) + self.assertEqual(getrefcount(child), 3) + +class ParentCase(unittest.TestCase): + '''Small collection of tests related to parent-child relationship''' + + def testSetParent(self): + #QObject.setParent() + parent = QObject() + child = QObject() + child.setParent(parent) + + self.assertEqual(parent, child.parent()) + + def testParentConstructor(self): + #QObject(parent) + parent = QObject() + child = QObject(parent) + + self.assertEqual(parent, child.parent()) + + orig_repr = repr(child) + del child + self.assertEqual(orig_repr, repr(parent.children()[0])) + + def testChildren(self): + #QObject.children() + parent = QObject() + children = [QObject(parent) for x in range(25)] + + self.assertEqual(parent.children(), children) + + def testFindChild(self): + #QObject.findChild() with all QObject + parent = QObject() + name = 'object%d' + children = [QObject(parent) for i in range(20)] + + for i, child in enumerate(children): + child.setObjectName(name % i) + + for i, child in enumerate(children): + self.assertEqual(child, parent.findChild(QObject, name % i)) + + def testFindChildWithoutName(self): + parent = QObject() + name = 'object%d' + children = [QObject(parent) for i in range(20)] + + for i, child in enumerate(children): + child.setObjectName(name % i) + + child = parent.findChild(QObject) + self.assertTrue(isinstance(child, QObject)) + + def testFindChildren(self): + #QObject.findChildren() with all QObject + parent = QObject() + target_name = 'foo' + children = [QTimer(parent) for i in range(20)] + children.extend([QObject(parent) for i in range(20)]) + + for i, child in enumerate(children): + if i % 5 == 0: + child.setObjectName(target_name) + else: + child.setObjectName(str(i)) + + # Emulates findChildren with the intended outcome + target_children = [x for x in children if x.objectName() == target_name] + test_children = parent.findChildren(QObject, target_name) + self.assertEqual(target_children, test_children) + + # test findChildren default value + res = parent.findChildren(QTimer) + self.assertEqual(len(res), 20) + + # test findChildre with a regex + res = parent.findChildren(QObject, QRegExp("^fo+")) + self.assertEqual(res, test_children) + + + def testParentEquality(self): + #QObject.parent() == parent + parent = QObject() + child = QObject(parent) + self.assertEqual(parent, child.parent()) + + +class TestParentOwnership(unittest.TestCase): + '''Test case for Parent/Child object ownership''' + + def testParentDestructor(self): + parent = QObject() + self.assertEqual(getrefcount(parent), 2) + + child = QObject(parent) + self.assertEqual(getrefcount(child), 3) + self.assertEqual(getrefcount(parent), 2) + + del parent + self.assertEqual(getrefcount(child), 2) + + # this will fail because parent deleted child cpp object + self.assertRaises(RuntimeError, lambda :child.objectName()) + + # test parent with multiples children + def testMultipleChildren(self): + o = QObject() + self.assertEqual(getrefcount(o), 2) + + c = QObject(o) + self.assertEqual(getrefcount(c), 3) + self.assertEqual(getrefcount(o), 2) + + c2 = QObject(o) + self.assertEqual(getrefcount(o), 2) + self.assertEqual(getrefcount(c), 3) + self.assertEqual(getrefcount(c2), 3) + + del o + self.assertEqual(getrefcount(c), 2) + self.assertEqual(getrefcount(c2), 2) + + # this will fail because parent deleted child cpp object + self.assertRaises(RuntimeError, lambda :c.objectName()) + self.assertRaises(RuntimeError, lambda :c2.objectName()) + + # test recursive parent + def testRecursiveParent(self): + o = QObject() + self.assertEqual(getrefcount(o), 2) + + c = QObject(o) + self.assertEqual(getrefcount(c), 3) + self.assertEqual(getrefcount(o), 2) + + c2 = QObject(c) + self.assertEqual(getrefcount(o), 2) + self.assertEqual(getrefcount(c), 3) + self.assertEqual(getrefcount(c2), 3) + + del o + self.assertEqual(getrefcount(c), 2) + self.assertEqual(getrefcount(c2), 2) + + # this will fail because parent deleted child cpp object + self.assertRaises(RuntimeError, lambda :c.objectName()) + self.assertRaises(RuntimeError, lambda :c2.objectName()) + + # test parent transfer + def testParentTransfer(self): + o = QObject() + self.assertEqual(getrefcount(o), 2) + + c = QObject() + self.assertEqual(getrefcount(c), 2) + + c.setParent(o) + self.assertEqual(getrefcount(c), 3) + + c.setParent(None) + self.assertEqual(getrefcount(c), 2) + + del c + del o + + +class ExtQObject(QObject): + def __init__(self): + QObject.__init__(self) + +class ReparentingTest(unittest.TestCase): + '''Test cases for reparenting''' + + def testParentedQObjectIdentity(self): + object_list = [] + parent = QObject() + for i in range(3): + obj = QObject() + object_list.append(obj) + obj.setParent(parent) + for child in parent.children(): + self.assertTrue(child in object_list) + + def testParentedExtQObjectType(self): + object_list = [] + parent = QObject() + for i in range(3): + obj = ExtQObject() + object_list.append(obj) + obj.setParent(parent) + for orig, child in zip(object_list, parent.children()): + self.assertEqual(type(orig), type(child)) + + def testReparentedQObjectIdentity(self): + object_list = [] + old_parent = QObject() + new_parent = QObject() + for i in range(3): + obj = QObject() + object_list.append(obj) + obj.setParent(old_parent) + for obj in object_list: + obj.setParent(new_parent) + for child in new_parent.children(): + self.assertTrue(child in object_list) + + def testReparentedExtQObjectType(self): + object_list = [] + old_parent = QObject() + new_parent = QObject() + for i in range(3): + obj = ExtQObject() + object_list.append(obj) + obj.setParent(old_parent) + for obj in object_list: + obj.setParent(new_parent) + for orig, child in zip(object_list, new_parent.children()): + self.assertEqual(type(orig), type(child)) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_property_test.py b/sources/pyside2/tests/QtCore/qobject_property_test.py new file mode 100644 index 000000000..537a62471 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_property_test.py @@ -0,0 +1,69 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QObject property and setProperty''' + +import unittest + +from PySide2.QtCore import QObject, Property, Signal + +class MyObjectWithNotifyProperty(QObject): + def __init__(self, parent=None): + QObject.__init__(self, parent) + self.p = 0 + + def readP(self): + return self.p + + def writeP(self, v): + self.p = v + self.notifyP.emit() + + notifyP = Signal() + myProperty = Property(int, readP, fset=writeP, notify=notifyP) + +class PropertyWithNotify(unittest.TestCase): + def called(self): + self.called_ = True + + def testNotify(self): + self.called_ = False + obj = MyObjectWithNotifyProperty() + obj.notifyP.connect(self.called) + obj.myProperty = 10 + self.assertTrue(self.called_) + + def testHasProperty(self): + o = MyObjectWithNotifyProperty() + o.setProperty("myProperty", 10) + self.assertEqual(o.myProperty, 10) + self.assertEqual(o.property("myProperty"), 10) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_protected_methods_test.py b/sources/pyside2/tests/QtCore/qobject_protected_methods_test.py new file mode 100644 index 000000000..6aa68749b --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_protected_methods_test.py @@ -0,0 +1,67 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QObject protected methods''' + +import unittest + +from PySide2.QtCore import QObject, QThread, SIGNAL + +class Dummy(QObject): + '''Dummy class''' + pass + +class QObjectReceivers(unittest.TestCase): + '''Test case for QObject.receivers()''' + + def cb(self, *args): + #Dummy callback + pass + + def testQObjectReceiversExtern(self): + #QObject.receivers() - Protected method external access + + obj = Dummy() + self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 0) + + QObject.connect(obj, SIGNAL("destroyed()"), self.cb) + self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 1) + + def testQThreadReceiversExtern(self): + #QThread.receivers() - Inherited protected method + + obj = QThread() + self.assertEqual(obj.receivers(SIGNAL('destroyed()')), 0) + QObject.connect(obj, SIGNAL("destroyed()"), self.cb) + self.assertEqual(obj.receivers(SIGNAL("destroyed()")), 1) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_test.py b/sources/pyside2/tests/QtCore/qobject_test.py new file mode 100644 index 000000000..482ae78be --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_test.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QObject methods''' + +import unittest +import py3kcompat as py3k + +from PySide2.QtCore import QObject + +class ObjectNameCase(unittest.TestCase): + '''Tests related to QObject object name''' + + def testSimple(self): + #QObject.objectName(string) + name = 'object1' + obj = QObject() + obj.setObjectName(name) + + self.assertEqual(name, obj.objectName()) + + def testEmpty(self): + #QObject.objectName('') + name = '' + obj = QObject() + obj.setObjectName(name) + + self.assertEqual(name, obj.objectName()) + + def testDefault(self): + #QObject.objectName() default + obj = QObject() + self.assertEqual('', obj.objectName()) + + def testUnicode(self): + name = py3k.unicode_('não') + #FIXME Strange error on upstream when using equal(name, obj) + obj = QObject() + obj.setObjectName(name) + self.assertEqual(obj.objectName(), name) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_timer_event_test.py b/sources/pyside2/tests/QtCore/qobject_timer_event_test.py new file mode 100644 index 000000000..75fb0902f --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_timer_event_test.py @@ -0,0 +1,73 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test case for QObject.timerEvent overloading''' + +import unittest +from time import sleep +from PySide2.QtCore import QObject, QCoreApplication + +from helper import UsesQCoreApplication + +class Dummy(QObject): + + def __init__(self, app): + super(Dummy, self).__init__() + self.times_called = 0 + self.app = app + + def timerEvent(self, event): + QObject.timerEvent(self, event) + event.accept() + self.times_called += 1 + + if self.times_called == 5: + self.app.exit(0) + +class QObjectTimerEvent(UsesQCoreApplication): + + def setUp(self): + #Acquire resources + super(QObjectTimerEvent, self).setUp() + + def tearDown(self): + #Release resources + super(QObjectTimerEvent, self).tearDown() + + def testTimerEvent(self): + #QObject.timerEvent overloading + obj = Dummy(self.app) + timer_id = obj.startTimer(200) + self.app.exec_() + obj.killTimer(timer_id) + self.assertEqual(obj.times_called, 5) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py b/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py new file mode 100644 index 000000000..db52c1a49 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py @@ -0,0 +1,67 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QObject's tr static methods.''' + +import os +import unittest +from PySide2.QtCore import QObject + +#from helper import UsesQCoreApplication + +class QObjectTrTest(unittest.TestCase): + '''Test case to check if QObject tr static methods could be treated as instance methods.''' + + def setUp(self): + self.obj = QObject() + + def tearDown(self): + del self.obj + + def testTrCommonCase(self): + #Test common case for QObject.tr + invar1 = 'test1' + outvar1 = self.obj.tr(invar1) + invar2 = 'test2' + outvar2 = self.obj.tr(invar2, 'test comment') + self.assertEqual((invar1, invar2), (outvar1, outvar2)) + + def testTrAsInstanceMethod(self): + #Test QObject.tr as instance + invar1 = 'test1' + outvar1 = QObject.tr(self.obj, invar1) + invar2 = 'test2' + outvar2 = QObject.tr(self.obj, invar2, 'test comment') + self.assertEqual((invar1, invar2), (outvar1, outvar2)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qpoint_test.py b/sources/pyside2/tests/QtCore/qpoint_test.py new file mode 100644 index 000000000..055a99659 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qpoint_test.py @@ -0,0 +1,48 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QPoint and QPointF''' + +import unittest + +from PySide2.QtCore import QPoint, QPointF + + +class QPointTest(unittest.TestCase): + + def testQPointCtor(self): + point = QPoint(QPoint(10,20)) + +class QPointFTest(unittest.TestCase): + + def testQPointFCtor(self): + pointf = QPointF(QPoint(10,20)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qprocess_test.py b/sources/pyside2/tests/QtCore/qprocess_test.py new file mode 100644 index 000000000..db006cae5 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qprocess_test.py @@ -0,0 +1,58 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QProcess''' + +import unittest +import os +import py3kcompat as py3k + +from PySide2.QtCore import * + +class TestQProcess (unittest.TestCase): + def testStartDetached(self): + value, pid = QProcess.startDetached("dir", [], os.getcwd()) + self.assertTrue(isinstance(value, bool)) + self.assertTrue(isinstance(pid, py3k.long)) + + def testPid(self): + p = QProcess() + p.start("dir") + p.waitForStarted() + pid = p.pid() + # We can't test the pid method result because it returns 0 when the + # process isn't running + if p.state() == QProcess.Running: + self.assertNotEqual(pid, 0) + else: + print("PROCESS ALREADY DEAD :-/") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qproperty_decorator.py b/sources/pyside2/tests/QtCore/qproperty_decorator.py new file mode 100644 index 000000000..eacdecd37 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qproperty_decorator.py @@ -0,0 +1,63 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import weakref +import unittest + +from PySide2.QtCore import QObject, Property + +class MyObject(QObject): + def __init__(self): + QObject.__init__(self) + self._value = None + + @Property(int) + def value(self): + return self._value + + @value.setter + def valueSet(self, value): + self._value = value + + +class PropertyTest(unittest.TestCase): + def destroyCB(self, obj): + self._obDestroyed = True + + def testDecorator(self): + self._obDestroyed = False + o = MyObject() + weak = weakref.ref(o, self.destroyCB) + o.value = 10 + self.assertEqual(o._value, 10) + self.assertEqual(o.value, 10) + del o + self.assertTrue(self._obDestroyed) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qrect_test.py b/sources/pyside2/tests/QtCore/qrect_test.py new file mode 100644 index 000000000..e9bc4d60d --- /dev/null +++ b/sources/pyside2/tests/QtCore/qrect_test.py @@ -0,0 +1,141 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QRect''' + +import unittest + +from PySide2.QtCore import QPoint, QRect, QRectF + +class RectConstructor(unittest.TestCase): + + def testDefault(self): + #QRect() + obj = QRect() + + self.assertTrue(obj.isNull()) + + def testConstructorQPoint(self): + topLeft = QPoint(3, 0) + bottomRight = QPoint(0, 3) + + rect1 = QRect(topLeft, bottomRight) + rect2 = QRect(topLeft, bottomRight) + + self.assertEqual(rect1, rect2) + +class RectOperator(unittest.TestCase): + '''Test case for QRect operators''' + + def testEqual(self): + '''QRect == QRect + Note: operator == must be working as it's the main check + for correctness''' + rect1 = QRect() + rect2 = QRect() + self.assertEqual(rect1, rect2) + + rect1 = QRect(0, 4, 100, 300) + rect2 = QRect(0, 4, 100, 300) + self.assertEqual(rect1, rect2) + + def testNullRectIntersection(self): + #QRect & QRect for null rects + rect1 = QRect() + rect2 = QRect() + rect3 = rect1 & rect2 + self.assertEqual(rect3, rect1) + self.assertEqual(rect3, rect2) + + def testNoIntersect(self): + '''QRect & QRect for non-intersecting QRects + Non-intersecting QRects return a 'null' QRect for operator &''' + rect1 = QRect(10, 10, 5, 5) + rect2 = QRect(20, 20, 5, 5) + rect3 = rect1 & rect2 + self.assertEqual(rect3, QRect()) + + def testIntersectPartial(self): + #QRect & QRect for partial intersections + rect1 = QRect(10, 10, 10, 10) + rect2 = QRect(15, 15, 10, 10) + rect3 = rect1 & rect2 + self.assertEqual(rect3, QRect(15, 15, 5, 5)) + + def testIntersetEnclosed(self): + #QRect & QRect for a qrect inside another + rect1 = QRect(10, 10, 20, 20) + rect2 = QRect(15, 15, 5, 5) + rect3 = rect1 & rect2 + self.assertEqual(rect3, rect2) + + def testNullRectIntersectBounding(self): + #QRect | QRect for null rects + rect1 = QRect() + rect2 = QRect() + rect3 = rect1 & rect2 + self.assertEqual(rect3, rect1) + self.assertEqual(rect3, rect2) + + def testNoIntersectBounding(self): + '''QRect | QRect for non-intersecting QRects + Non-intersecting QRects return a greater QRect for operator |''' + rect1 = QRect(10, 10, 5, 5) + rect2 = QRect(20, 20, 5, 5) + rect3 = rect1 | rect2 + self.assertEqual(rect3, QRect(10, 10, 15, 15)) + + def testBoundingPartialIntersection(self): + #QRect | QRect for partial intersections + rect1 = QRect(10, 10, 10, 10) + rect2 = QRect(15, 15, 10, 10) + rect3 = rect1 | rect2 + self.assertEqual(rect3, QRect(10, 10, 15, 15)) + + def testBoundingEnclosed(self): + #QRect | QRect for a qrect inside another + rect1 = QRect(10, 10, 20, 20) + rect2 = QRect(15, 15, 5, 5) + rect3 = rect1 | rect2 + self.assertEqual(rect3, rect1) + + def testGetCoordsAndRect(self): + rect1 = QRect(1, 2, 3, 4) + self.assertEqual(rect1.getRect(), (1, 2, 3, 4)) + self.assertEqual(rect1.getCoords(), (1, 2, 3, 5)) + + rect1 = QRectF(1, 2, 3, 4) + self.assertEqual(rect1.getRect(), (1, 2, 3, 4)) + self.assertEqual(rect1.getCoords(), (1, 2, 4, 6)) + + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qregexp_test.py b/sources/pyside2/tests/QtCore/qregexp_test.py new file mode 100644 index 000000000..5a5db0c59 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qregexp_test.py @@ -0,0 +1,48 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QRegExp + +class QRegExpTest(unittest.TestCase): + + def testReplace1(self): + re = QRegExp('a[mn]') + string = re.replace('Banana', 'ox') + self.assertEqual(string, 'Boxoxa') + + def testReplace2(self): + re = QRegExp('([^<]*)') + string = re.replace('A bon mot.', '\\emph{\\1}') + self.assertEqual(string, 'A \\emph{bon mot}.') + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qresource_test.py b/sources/pyside2/tests/QtCore/qresource_test.py new file mode 100644 index 000000000..c7b28bfae --- /dev/null +++ b/sources/pyside2/tests/QtCore/qresource_test.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QResource usage''' + +import unittest +from helper import adjust_filename +from PySide2.QtCore import QFile, QIODevice +import resources_mc + +class ResourcesUsage(unittest.TestCase): + '''Test case for resources usage''' + + def testPhrase(self): + #Test loading of quote.txt resource + f = open(adjust_filename('quoteEnUS.txt', __file__), "r") + orig = f.read() + f.close() + + f = QFile(':/quote.txt') + f.open(QIODevice.ReadOnly) #|QIODevice.Text) + print("Error:", f.errorString()) + copy = f.readAll() + f.close() + self.assertEqual(orig, copy) + + def testImage(self): + #Test loading of sample.png resource + f = open(adjust_filename('sample.png', __file__), "rb") + orig = f.read() + f.close() + + f = QFile(':/sample.png') + f.open(QIODevice.ReadOnly) + copy = f.readAll() + f.close() + self.assertEqual(len(orig), len(copy)) + self.assertEqual(orig, copy) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qsize_test.py b/sources/pyside2/tests/QtCore/qsize_test.py new file mode 100644 index 000000000..062232a54 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qsize_test.py @@ -0,0 +1,55 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QSize''' + +import unittest + +from PySide2.QtCore import QSize + +class QSizeOperator(unittest.TestCase): + def testOperatorMultiply(self): + #QSize operator * float + # bug 131 + a = QSize(1, 1) + x = a * 3.4 + self.assertEqual(QSize(3, 3), x) + + def testOperatorRevertedMultiply(self): + #QSize operator * float, reverted + # bug 132 + a = QSize(1, 1) + x = 3.4 * a + self.assertEqual(QSize(3, 3), x) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qslot_object_test.py b/sources/pyside2/tests/QtCore/qslot_object_test.py new file mode 100644 index 000000000..3fc1d9013 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qslot_object_test.py @@ -0,0 +1,76 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import QtCore + +global qApp + +class objTest(QtCore.QObject): + + def __init__(self, parent=None): + QtCore.QObject.__init__(self, parent) + + self.ok = False + + def slot(self): + global qApp + + self.ok = True + qApp.quit() + + + +class slotTest(unittest.TestCase): + def quit_app(self): + global qApp + + qApp.quit() + + def testBasic(self): + global qApp + timer = QtCore.QTimer() + timer.setInterval(100) + + my_obj = objTest() + my_slot = QtCore.SLOT("slot()") + QtCore.QObject.connect(timer, QtCore.SIGNAL("timeout()"), my_obj, my_slot) + timer.start(100) + + QtCore.QTimer.singleShot(1000, self.quit_app) + qApp.exec_() + + self.assertTrue(my_obj.ok) + + +if __name__ == '__main__': + global qApp + qApp = QtCore.QCoreApplication([]) + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qsrand_test.py b/sources/pyside2/tests/QtCore/qsrand_test.py new file mode 100644 index 000000000..d7c6200bf --- /dev/null +++ b/sources/pyside2/tests/QtCore/qsrand_test.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import gc +import unittest + +from PySide2.QtCore import qsrand + +class OverflowExceptionCollect(unittest.TestCase): + '''Test case for OverflowError exception during garbage collection. See bug #147''' + + def testOverflow(self): + # NOTE: PyQt4 raises TypeError, but boost.python raises OverflowError + self.assertRaises(OverflowError, qsrand, 42415335332353253) + # should not abort if bug #147 is fixed + gc.collect() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qstandardpaths_test.py b/sources/pyside2/tests/QtCore/qstandardpaths_test.py new file mode 100644 index 000000000..35e25e1f6 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qstandardpaths_test.py @@ -0,0 +1,50 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QStandardPaths''' + +import unittest +import ctypes +import sys + +from PySide2.QtCore import QStandardPaths + +class QStandardPathsTest(unittest.TestCase): + def testTestModeEnabled(self): + print("QStandardPaths.isTestModeEnabled:", QStandardPaths.isTestModeEnabled()) + sp = True + QStandardPaths.setTestModeEnabled(sp) + self.assertEqual(QStandardPaths.isTestModeEnabled(), sp) + sp = False + QStandardPaths.setTestModeEnabled(sp) + self.assertEqual(QStandardPaths.isTestModeEnabled(), sp) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qstate_test.py b/sources/pyside2/tests/QtCore/qstate_test.py new file mode 100644 index 000000000..f877d1ebb --- /dev/null +++ b/sources/pyside2/tests/QtCore/qstate_test.py @@ -0,0 +1,64 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + + +class QStateTest(unittest.TestCase): + def testBasic(self): + app = QCoreApplication([]) + + o = QObject() + o.setProperty("text", "INdT") + + machine = QStateMachine() + s1 = QState() + s1.assignProperty(o, "text", "Rocks"); + + s2 = QFinalState() + t = s1.addTransition(o, SIGNAL("change()"), s2); + self.assertTrue(isinstance(t, QSignalTransition)) + + machine.addState(s1) + machine.addState(s2) + machine.setInitialState(s1) + machine.start() + + o.emit(SIGNAL("change()")) + + QTimer.singleShot(100, app.quit) + app.exec_() + + txt = o.property("text") + self.assertTrue(txt, "Rocks") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qstatemachine_test.py b/sources/pyside2/tests/QtCore/qstatemachine_test.py new file mode 100644 index 000000000..6cfa59e1d --- /dev/null +++ b/sources/pyside2/tests/QtCore/qstatemachine_test.py @@ -0,0 +1,97 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject, QState, QFinalState, SIGNAL +from PySide2.QtCore import QTimer, QStateMachine +from PySide2.QtCore import QParallelAnimationGroup + +from helper import UsesQCoreApplication + + +class StateMachineTest(unittest.TestCase): + '''Check presence of State Machine classes''' + + def testBasic(self): + '''State machine classes''' + import PySide2.QtCore + PySide2.QtCore.QSignalTransition + PySide2.QtCore.QPropertyAnimation + + + +class QStateMachineTest(UsesQCoreApplication): + + def cb(self, *args): + self.assertEqual(self.machine.defaultAnimations(), [self.anim]) + + def testBasic(self): + self.machine = QStateMachine() + s1 = QState() + s2 = QState() + s3 = QFinalState() + + QObject.connect(self.machine, SIGNAL("started()"), self.cb) + + self.anim = QParallelAnimationGroup() + + self.machine.addState(s1) + self.machine.addState(s2) + self.machine.addState(s3) + self.machine.setInitialState(s1) + self.machine.addDefaultAnimation(self.anim) + self.machine.start() + + QTimer.singleShot(100, self.app.quit) + self.app.exec_() + + +class QSetConverterTest(UsesQCoreApplication): + '''Test converter of QSet toPython using QStateAnimation.configuration''' + + def testBasic(self): + '''QStateMachine.configuration converting QSet to python set''' + machine = QStateMachine() + s1 = QState() + machine.addState(s1) + machine.setInitialState(s1) + machine.start() + + QTimer.singleShot(100, self.app.quit) + self.app.exec_() + + configuration = machine.configuration() + + self.assertTrue(isinstance(configuration, set)) + self.assertTrue(s1 in configuration) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qstorageinfo_test.py b/sources/pyside2/tests/QtCore/qstorageinfo_test.py new file mode 100644 index 000000000..f1b90bb69 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qstorageinfo_test.py @@ -0,0 +1,43 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QStorageInfo''' + +import unittest + +from PySide2.QtCore import QStorageInfo + +class QandardPathsTest(unittest.TestCase): + def testQStorageInfo(self): + for v in QStorageInfo.mountedVolumes(): + print(v.name(), v.rootPath(), v.device()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qstring_test.py b/sources/pyside2/tests/QtCore/qstring_test.py new file mode 100644 index 000000000..7617d8bfc --- /dev/null +++ b/sources/pyside2/tests/QtCore/qstring_test.py @@ -0,0 +1,51 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QString''' + +import unittest +import py3kcompat as py3k +from PySide2.QtCore import QObject + +class QStringConstructor(unittest.TestCase): + '''Test case for QString constructors''' + + def testQStringDefault(self): + obj = QObject() + obj.setObjectName('foo') + self.assertEqual(obj.objectName(), py3k.unicode_('foo')) + obj.setObjectName(py3k.unicode_('áâãà')) + self.assertEqual(obj.objectName(), py3k.unicode_('áâãà')) + obj.setObjectName(None) + self.assertEqual(obj.objectName(), py3k.unicode_('')) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qsysinfo_test.py b/sources/pyside2/tests/QtCore/qsysinfo_test.py new file mode 100644 index 000000000..524728ef8 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qsysinfo_test.py @@ -0,0 +1,42 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QSysInfo + +class TestQSysInfo(unittest.TestCase): + def testEnumEndian(self): + self.assertEqual(QSysInfo.BigEndian, 0) + self.assertEqual(QSysInfo.LittleEndian, 1) + self.assertTrue(QSysInfo.ByteOrder > -1) + + def testEnumSizes(self): + self.assertTrue(QSysInfo.WordSize > 0) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qtext_codec_test.py b/sources/pyside2/tests/QtCore/qtext_codec_test.py new file mode 100644 index 000000000..dbd812f91 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qtext_codec_test.py @@ -0,0 +1,48 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import gc +import unittest + +from PySide2.QtCore import QTextCodec + +class TestCodecGetters(unittest.TestCase): + + def testCodecsNames(self): + for codec_name in QTextCodec.availableCodecs(): + codec = QTextCodec.codecForName(codec_name) + self.assertTrue(type(codec), QTextCodec) + + def testCodecsMibs(self): + for codec_num in QTextCodec.availableMibs(): + codec = QTextCodec.codecForMib(codec_num) + self.assertTrue(type(codec), QTextCodec) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qtextstream_test.py b/sources/pyside2/tests/QtCore/qtextstream_test.py new file mode 100644 index 000000000..b1c9a8f3e --- /dev/null +++ b/sources/pyside2/tests/QtCore/qtextstream_test.py @@ -0,0 +1,115 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QTextStream''' + +import unittest +import py3kcompat as py3k + +from PySide2.QtCore import QByteArray, QTextStream, QIODevice, QTextCodec, QFile + +class QTextStreamShiftTest(unittest.TestCase): + + def setUp(self): + self.ba = QByteArray() + self.read = QTextStream(self.ba, QIODevice.ReadOnly) + self.write = QTextStream(self.ba, QIODevice.WriteOnly) + + def testNumber(self): + '''QTextStream << number''' + + self.write << '4' + self.write.flush() + res = self.read.readLine() + self.assertTrue(isinstance(res, py3k.unicode)) + self.assertEqual(res, '4') + +class QTextStreamGetSet(unittest.TestCase): + + def setUp(self): + self.obj = QTextStream() + + + def testCodec(self): + '''QTextStream set/get Codec''' + + codec = QTextCodec.codecForName('ISO8859-1') + self.obj.setCodec(codec) + self.assertEqual(codec, self.obj.codec()) + + def testDevice(self): + '''QTextStream get/set Device''' + device = QFile() + self.obj.setDevice(device) + self.assertEqual(device, self.obj.device()) + self.obj.setDevice(None) + self.assertEqual(None, self.obj.device()) + +class QTextStreamInitialization(unittest.TestCase): + + def testConstruction(self): + '''QTextStream construction''' + obj = QTextStream() + + self.assertEqual(obj.codec(), QTextCodec.codecForLocale()) + self.assertEqual(obj.device(), None) + self.assertEqual(obj.string(), None) + + self.assertTrue(obj.atEnd()) + self.assertEqual(obj.readAll(), '') + +class QTextStreamReadLinesFromDevice(unittest.TestCase): + + def _check_data(self, data_set): + + for data, lines in data_set: + stream = QTextStream(data) + + res = [] + while not stream.atEnd(): + res.append(stream.readLine()) + + self.assertEqual(res, lines) + + def testLatin1(self): + '''QTextStream readLine for simple Latin1 strings''' + + data = [] + + data.append((QByteArray(), [])) + data.append((QByteArray('\n'), [''])) + data.append((QByteArray('\r\n'), [''])) + data.append((QByteArray('ole'), ['ole'])) + data.append((QByteArray('ole\n'), ['ole'])) + data.append((QByteArray('ole\r\n'), ['ole'])) + data.append((QByteArray('ole\r\ndole\r\ndoffen'), ['ole', 'dole', 'doffen'])) + + self._check_data(data) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qthread_prod_cons_test.py b/sources/pyside2/tests/QtCore/qthread_prod_cons_test.py new file mode 100644 index 000000000..fc6f06416 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qthread_prod_cons_test.py @@ -0,0 +1,136 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Producer-Consumer test/example with QThread''' + +import unittest +from random import random +import logging + +logging.basicConfig(level=logging.WARNING) + +from PySide2.QtCore import QThread, QCoreApplication, QObject, SIGNAL + +class Bucket(QObject): + '''Dummy class to hold the produced values''' + def __init__(self, max_size=10, *args): + #Constructor which receives the max number of produced items + super(Bucket, self).__init__(*args) + self.data = [] + self.max_size = 10 + + def pop(self): + #Retrieves an item + return self.data.pop(0) + + def push(self, data): + #Pushes an item + self.data.append(data) + +class Producer(QThread): + '''Producer thread''' + + def __init__(self, bucket, *args): + #Constructor. Receives the bucket + super(Producer, self).__init__(*args) + self.runs = 0 + self.bucket = bucket + self.production_list = [] + + def run(self): + #Produces at most bucket.max_size items + while self.runs < self.bucket.max_size: + value = int(random()*10) % 10 + self.bucket.push(value) + self.production_list.append(value) + logging.debug('PRODUCER - pushed %d' % value) + self.runs += 1 + self.msleep(5) + + + +class Consumer(QThread): + '''Consumer thread''' + def __init__(self, bucket, *args): + #Constructor. Receives the bucket + super(Consumer, self).__init__(*args) + self.runs = 0 + self.bucket = bucket + self.consumption_list = [] + + def run(self): + #Consumes at most bucket.max_size items + while self.runs < self.bucket.max_size: + try: + value = self.bucket.pop() + self.consumption_list.append(value) + logging.debug('CONSUMER - got %d' % value) + self.runs += 1 + except IndexError: + logging.debug('CONSUMER - empty bucket') + self.msleep(5) + +class ProducerConsumer(unittest.TestCase): + '''Basic test case for producer-consumer QThread''' + + def setUp(self): + #Create fixtures + self.app = QCoreApplication([]) + + def tearDown(self): + #Destroy fixtures + del self.app + + def finishCb(self): + #Quits the application + self.app.exit(0) + + def testProdCon(self): + #QThread producer-consumer example + bucket = Bucket() + prod = Producer(bucket) + cons = Consumer(bucket) + + prod.start() + cons.start() + + QObject.connect(prod, SIGNAL('finished()'), self.finishCb) + QObject.connect(cons, SIGNAL('finished()'), self.finishCb) + + self.app.exec_() + + prod.wait(50) + cons.wait(50) + + self.assertEqual(prod.production_list, cons.consumption_list) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qthread_signal_test.py b/sources/pyside2/tests/QtCore/qthread_signal_test.py new file mode 100644 index 000000000..744797de9 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qthread_signal_test.py @@ -0,0 +1,91 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for connecting signals between threads''' + +import unittest + +from PySide2.QtCore import QThread, QObject, SIGNAL, QCoreApplication + +thread_run = False + +class Source(QObject): + def __init__(self, *args): + QObject.__init__(self, *args) + + def emit_sig(self): + self.emit(SIGNAL('source()')) + +class Target(QObject): + def __init__(self, *args): + QObject.__init__(self, *args) + self.called = False + + def myslot(self): + self.called = True + +class ThreadJustConnects(QThread): + def __init__(self, source, *args): + QThread.__init__(self, *args) + self.source = source + self.target = Target() + + def run(self): + global thread_run + thread_run = True + QObject.connect(self.source, SIGNAL('source()'), self.target.myslot) + + while not self.target.called: + pass + + + +class BasicConnection(unittest.TestCase): + + def testEmitOutsideThread(self): + global thread_run + + app = QCoreApplication([]) + source = Source() + thread = ThreadJustConnects(source) + + QObject.connect(thread, SIGNAL('finished()'), lambda: app.exit(0)) + thread.start() + + while not thread_run: + pass + + source.emit_sig() + + app.exec_() + thread.wait() + + self.assertTrue(thread.target.called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qthread_test.py b/sources/pyside2/tests/QtCore/qthread_test.py new file mode 100644 index 000000000..cee32d65b --- /dev/null +++ b/sources/pyside2/tests/QtCore/qthread_test.py @@ -0,0 +1,108 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QThread''' + +import unittest +from PySide2.QtCore import QThread, QCoreApplication, QObject, SIGNAL, QMutex, QTimer +from PySide2.QtCore import QEventLoop + +from helper import UsesQCoreApplication + +mutex = QMutex() + +class Dummy(QThread): + '''Dummy thread''' + def __init__(self, *args): + super(Dummy, self).__init__(*args) + self.called = False + + def run(self): + #Start-quit sequence + self.qobj = QObject() + mutex.lock() + self.called = True + mutex.unlock() + +class QThreadSimpleCase(UsesQCoreApplication): + + def setUp(self): + UsesQCoreApplication.setUp(self) + self.called = False + + def tearDown(self): + UsesQCoreApplication.tearDown(self) + + def testThread(self): + #Basic QThread test + obj = Dummy() + obj.start() + self.assertTrue(obj.wait(100)) + + self.assertTrue(obj.called) + + def cb(self, *args): + self.called = True + #self.exit_app_cb() + + def abort_application(self): + if self._thread.isRunning(): + self._thread.terminate() + self.app.quit() + + def testSignalFinished(self): + #QThread.finished() (signal) + obj = Dummy() + QObject.connect(obj, SIGNAL('finished()'), self.cb) + mutex.lock() + obj.start() + mutex.unlock() + + self._thread = obj + QTimer.singleShot(1000, self.abort_application) + self.app.exec_() + + self.assertTrue(self.called) + + def testSignalStarted(self): + #QThread.started() (signal) + obj = Dummy() + QObject.connect(obj, SIGNAL('started()'), self.cb) + obj.start() + + self._thread = obj + QTimer.singleShot(1000, self.abort_application) + self.app.exec_() + + self.assertEqual(obj.qobj.thread(), obj) # test QObject.thread() method + self.assertTrue(self.called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py b/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py new file mode 100644 index 000000000..d5e945385 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py @@ -0,0 +1,106 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QTimer.singleShot''' + +import unittest + +from PySide2.QtCore import QObject, QTimer, QCoreApplication, Signal +from helper import UsesQCoreApplication + +class WatchDog(QObject): + '''Exits the QCoreApplication main loop after sometime.''' + + def __init__(self, watched): + QObject.__init__(self) + self.times_called = 0 + self.watched = watched + + def timerEvent(self, evt): + self.times_called += 1 + if self.times_called == 20: + self.watched.exit_app_cb() + +class TestSingleShot(UsesQCoreApplication): + '''Test case for QTimer.singleShot''' + + def setUp(self): + #Acquire resources + UsesQCoreApplication.setUp(self) + self.watchdog = WatchDog(self) + self.called = False + + def tearDown(self): + #Release resources + del self.watchdog + del self.called + UsesQCoreApplication.tearDown(self) + + def callback(self): + self.called = True + self.app.quit() + + def testSingleShot(self): + QTimer.singleShot(100, self.callback) + self.app.exec_() + self.assertTrue(self.called) + +class SigEmitter(QObject): + + sig1 = Signal() + + +class TestSingleShotSignal(UsesQCoreApplication): + '''Test case for QTimer.singleShot connecting to signals''' + + def setUp(self): + UsesQCoreApplication.setUp(self) + self.watchdog = WatchDog(self) + self.called = False + + def tearDown(self): + del self.watchdog + del self.called + UsesQCoreApplication.tearDown(self) + + def callback(self): + self.called = True + self.app.quit() + + def testSingleShotSignal(self): + emitter = SigEmitter() + emitter.sig1.connect(self.callback) + QTimer.singleShot(100, emitter.sig1) + self.app.exec_() + self.assertTrue(self.called) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qtimer_timeout_test.py b/sources/pyside2/tests/QtCore/qtimer_timeout_test.py new file mode 100644 index 000000000..a185a65f4 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qtimer_timeout_test.py @@ -0,0 +1,87 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test case for timeout() signals from QTimer object.''' + +import unittest +import os +import sys +from tempfile import mkstemp +from PySide2.QtCore import QObject, QTimer, SIGNAL +from helper import UsesQCoreApplication + +class WatchDog(QObject): + '''Exits the QCoreApplication main loop after sometime.''' + + def __init__(self, watched): + QObject.__init__(self) + self.times_called = 0 + self.watched = watched + + def timerEvent(self, evt): + self.times_called += 1 + if self.times_called == 20: + self.watched.exit_app_cb() + + +class TestTimeoutSignal(UsesQCoreApplication): + '''Test case to check if the signals are really being caught''' + + def setUp(self): + #Acquire resources + UsesQCoreApplication.setUp(self) + self.watchdog = WatchDog(self) + self.timer = QTimer() + self.called = False + + def tearDown(self): + #Release resources + del self.watchdog + del self.timer + del self.called + UsesQCoreApplication.tearDown(self) + + def callback(self, *args): + #Default callback + self.called = True + + def testTimeoutSignal(self): + #Test the QTimer timeout() signal + refCount = sys.getrefcount(self.timer) + QObject.connect(self.timer, SIGNAL('timeout()'), self.callback) + self.timer.start(4) + self.watchdog.startTimer(10) + + self.app.exec_() + + self.assertTrue(self.called) + self.assertEqual(sys.getrefcount(self.timer), refCount) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/qtnamespace_test.py b/sources/pyside2/tests/QtCore/qtnamespace_test.py new file mode 100644 index 000000000..f00e7bd91 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qtnamespace_test.py @@ -0,0 +1,48 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test suite for QtCore.Qt namespace''' + +import unittest + +from PySide2.QtCore import Qt + +class QtNamespace(unittest.TestCase): + '''Test case for accessing attributes from Qt namespace''' + + def testBasic(self): + #Access to Qt namespace + getattr(Qt, 'Horizontal') + getattr(Qt, 'WindowMaximizeButtonHint') + self.assertTrue(True) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/quoteEnUS.txt b/sources/pyside2/tests/QtCore/quoteEnUS.txt new file mode 100644 index 000000000..909b4fa17 --- /dev/null +++ b/sources/pyside2/tests/QtCore/quoteEnUS.txt @@ -0,0 +1 @@ +Fine! Dishonor! Dishonor on you, dishonor on ya cow! diff --git a/sources/pyside2/tests/QtCore/qurl_test.py b/sources/pyside2/tests/QtCore/qurl_test.py new file mode 100644 index 000000000..595e5931f --- /dev/null +++ b/sources/pyside2/tests/QtCore/qurl_test.py @@ -0,0 +1,125 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test suite for QtCore.QUrl''' + +import unittest + +from PySide2.QtCore import QUrl + +class QUrlBasicConstructor(unittest.TestCase): + '''Tests the basic constructors''' + + def testBasic(self): + #Default constructor for QUrl + url = QUrl() + self.assertEqual(url.toString(), "") + + def testSetAttributes(self): + #Construct QUrl by set* methods + url = QUrl() + + url.setScheme('ftp') + self.assertEqual(url.toString(), 'ftp:') + + url.setHost('www.google.com') + self.assertEqual(url.toString(), 'ftp://www.google.com') + + url.setPort(8080) + self.assertEqual(url.toString(), 'ftp://www.google.com:8080') + + url.setPath('/mail/view') + self.assertEqual(url.toString(), + 'ftp://www.google.com:8080/mail/view') + + url.setUserName('john') + self.assertEqual(url.toString(), + 'ftp://john@www.google.com:8080/mail/view') + + url.setPassword('abc123') + self.assertEqual(url.toString(), + 'ftp://john:abc123@www.google.com:8080/mail/view') + + def testPath(self): + url = QUrl("http://qt-project.org/images/ban/pgs_front.jpg") + self.assertEqual(url.path(), "/images/ban/pgs_front.jpg") + +# PYSIDE-345: No bindings for QUrlQuery +# class QueryItemsTest(unittest.TestCase): +# '''Test query item management''' +# +# def testQueryItems(self): +# #QUrl.queryItems +# url = QUrl('http://www.google.com/search?q=python&hl=en') +# valid_data = [(('q'), ('python')), (('hl'), ('en'))] +# +# self.assertEqual(sorted(url.queryItems()), sorted(valid_data)) +# +# def testEncodedQueryItems(self): +# #QUrl.encodedQueryItems +# url = QUrl('http://www.google.com/search?q=python&hl=en') +# valid_data = [(('q'), ('python')), (('hl'), ('en'))] +# +# self.assertEqual(sorted(url.encodedQueryItems()), sorted(valid_data)) +# +# def testSetQueryItems(self): +# #QUrl.setQueryItems +# urla = QUrl('http://www.google.com/search?q=python&hl=en') +# urlb = QUrl('http://www.google.com/search') +# +# urlb.setQueryItems(urla.queryItems()) +# +# self.assertEqual(urla, urlb) +# +# def testAddQueryItem(self): +# #QUrl.addQueryItem +# url = QUrl() +# valid_data = [('hl', 'en'), ('user', 'konqui')] +# +# url.addQueryItem(*valid_data[0]) +# self.assertEqual(url.queryItems()[0], valid_data[0]) +# +# url.addQueryItem(*valid_data[1]) +# self.assertEqual(sorted(url.queryItems()), sorted(valid_data)) +# +# def testAllEncodedQueryItemsValues(self): +# #QUrl.allEncodedQueryItemValues +# url = QUrl() +# key = 'key' +# valid_data = ['data', 'valid', 'test'] +# +# for i, data in enumerate(valid_data): +# url.addQueryItem(key, data) +# self.assertEqual(url.allEncodedQueryItemValues(key), +# list(valid_data[:i+1])) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/repr_test.py b/sources/pyside2/tests/QtCore/repr_test.py new file mode 100644 index 000000000..297960204 --- /dev/null +++ b/sources/pyside2/tests/QtCore/repr_test.py @@ -0,0 +1,105 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import PySide2 +import unittest + +from PySide2.QtCore import QByteArray, QDate, QDateTime, QTime, QLine, QLineF +from PySide2.QtCore import Qt, QSize, QSizeF, QRect, QRectF, QPoint, QPointF +try: + from PySide2.QtCore import QUuid + HAVE_Q = True +except ImportError: + HAVE_Q = False + +class ReprCopyHelper: + def testCopy(self): + copy = eval(self.original.__repr__()) + self.assertTrue(copy is not self.original) + self.assertEqual(copy, self.original) + +class QByteArrayReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QByteArray('the quick brown fox jumps over the lazy dog') + + +class QDateReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QDate(2010, 11, 22) + + +class QTimeReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QTime(11, 37, 55, 692) + + +class QDateTimeReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QDateTime(2010, 5, 18, 10, 24, 45, 223, Qt.LocalTime) + + +class QSizeReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QSize(42, 190) + + +class QSizeFReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QSizeF(42.7, 190.2) + +class QRectReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QRect(100, 200, 300, 400) + +class QRectFReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QRectF(100.33, 200.254, 300.321, 400.123) + +class QLineReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QLine(1, 2, 3, 4) + +class QLineFReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QLineF(1.1, 2.2, 3.3, 4.4) + +class QPointReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QPoint(1, 2) + +class QPointFReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QPointF(1.1, 2.2) + +class QUuiCopy(ReprCopyHelper, unittest.TestCase): + @unittest.skipUnless(HAVE_Q, "QUuid is currently not supported on this platform.") + def setUp(self): + self.original = QUuid("67C8770B-44F1-410A-AB9A-F9B5446F13EE") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/resources.qrc b/sources/pyside2/tests/QtCore/resources.qrc new file mode 100644 index 000000000..0a0b03d40 --- /dev/null +++ b/sources/pyside2/tests/QtCore/resources.qrc @@ -0,0 +1,7 @@ + + + quoteEnUS.txt + sample.png + + + diff --git a/sources/pyside2/tests/QtCore/resources_mc.py b/sources/pyside2/tests/QtCore/resources_mc.py new file mode 100644 index 000000000..6c4bd7901 --- /dev/null +++ b/sources/pyside2/tests/QtCore/resources_mc.py @@ -0,0 +1,3571 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# Resource object code +# +# Created: Thu Feb 3 16:09:36 2011 +# by: The Resource Compiler for PySide (Qt v4.6.3) +# +# WARNING! All changes made in this file will be lost! + +from PySide2 import QtCore + +qt_resource_data = b"""\ +\x00\x00\x00\x35\ +\x46\ +\x69\x6e\x65\x21\x20\x44\x69\x73\x68\x6f\x6e\x6f\x72\x21\x20\x44\ +\x69\x73\x68\x6f\x6e\x6f\x72\x20\x6f\x6e\x20\x79\x6f\x75\x2c\x20\ +\x64\x69\x73\x68\x6f\x6e\x6f\x72\x20\x6f\x6e\x20\x79\x61\x20\x63\ +\x6f\x77\x21\x0a\ +\x00\x00\xda\x88\ +\x89\ +\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\ +\x00\x00\xb1\x00\x00\x00\xd2\x08\x06\x00\x00\x00\x05\x49\x21\x31\ +\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\ +\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\ +\x00\x9a\x9c\x18\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xda\x03\x0a\ +\x0c\x02\x2e\xb0\x96\x99\x74\x00\x00\x00\x19\x74\x45\x58\x74\x43\ +\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\ +\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x20\x00\ +\x49\x44\x41\x54\x78\xda\x94\xbd\xd9\xaf\x24\xd9\x7a\xdd\xf7\x8b\ +\x21\x33\x77\x44\xe4\x9c\xa7\xaa\xcf\xa9\xb1\xab\x87\x6b\xf2\x92\ +\xd4\x15\x49\x0b\x84\x64\xd9\x22\x64\x3f\xd8\x30\x0c\xd8\x8f\x34\ +\xfc\x68\x43\x7f\x8b\xfe\x04\x02\x06\xfc\x64\xbf\xd1\x06\x04\x13\ +\x7a\x30\x65\x59\x04\x4d\x03\xa4\x48\xba\x29\xf9\x72\xb8\xdd\x5d\ +\x55\x5d\xc3\x39\x75\xea\x9c\x9c\x23\xf6\xce\xcc\x18\xfc\xb0\x87\ +\x88\xc8\xcc\x6a\xd9\xd9\x68\x44\xce\x79\x2a\x73\xc5\x8a\xb5\xd7\ +\xb7\xbe\x2f\xbc\xdf\xff\x17\xbf\x57\x09\x00\x15\x82\xc8\x29\x89\ +\xb0\x97\x24\xaa\x90\x52\x51\x12\x91\x44\x95\xb9\x37\x42\x56\x1e\ +\x91\x97\x91\x4a\xcf\x3d\x27\x8a\x04\x12\x1a\xaf\xd6\xcf\x45\x54\ +\xa0\x3c\x7e\xfc\x22\xeb\xe7\x9b\xeb\xfa\xbd\xea\xdb\x08\x01\x4a\ +\x01\x11\x42\x54\x28\xe5\xe9\x2d\x20\xc0\xdd\x6e\x5e\xdc\x7d\x4a\ +\x02\x7d\x2a\xd1\x73\x8f\x79\x6a\x07\xa2\xa0\x22\xd6\xd7\x81\x24\ +\xdb\xe3\x8d\x87\xad\xf7\xc8\xe3\x12\x80\x30\xf3\xc9\xe3\x92\x30\ +\xf3\x09\x63\x81\x22\x43\x10\x03\x99\x79\x66\x6c\xfe\xce\x12\x94\ +\x5f\xbf\xc1\xd1\xed\x38\x28\xf4\xfb\x85\x11\x79\x2e\xf1\x37\x7d\ +\xb6\xb1\xe4\x61\x76\xe0\xf6\xe5\x82\xc3\x04\x46\xe3\x01\x00\x7d\ +\x42\xb6\xe4\x4c\xbd\x31\xd5\x70\xc3\xc6\xef\x33\x28\xb7\x78\xeb\ +\x01\xeb\x47\x01\x09\x3d\x52\x76\x24\xe8\x7f\x57\x90\x29\x3a\x71\ +\x0f\x45\xfd\x7d\x77\x85\x60\xaf\xd4\xc9\x37\x2e\x44\x81\x52\x01\ +\x82\x0a\x85\x87\xcc\x04\xdf\x7e\xbc\x67\x1c\x06\xfa\xfb\x99\x54\ +\xcc\x98\x50\x72\x4f\x12\x27\x88\x69\x42\x99\x15\x27\xef\xe3\xc7\ +\x41\xeb\xfe\xbd\x52\xc8\x4c\x00\x50\x72\x8f\xcf\x8c\x49\x2c\x29\ +\x45\x84\x1f\x07\x54\x9d\x11\xde\x61\xa5\x1f\xcf\x0a\x56\x73\xb8\ +\x5b\xbc\xa4\x5a\xae\x4f\xde\xdb\x1b\x0f\x19\x52\xf1\xd9\xe3\x11\ +\x4c\x1f\x52\x75\x46\x27\xcf\x79\xf4\xe8\x6b\x42\xfd\x63\x07\x20\ +\x72\x50\x01\xb0\xa7\x2b\xba\xec\x91\xec\xa5\x06\x88\xaf\x0e\x48\ +\x72\x03\x18\x0d\xea\x14\x8f\x3d\x12\x64\xc4\x1e\x40\xda\xfb\x61\ +\x8f\x44\x00\x25\x5e\x8d\x4f\xc0\x47\x52\x12\x31\x2c\x3d\xd6\x7e\ +\xe5\x6e\x83\x47\x15\x65\x78\xd2\xc3\x8f\xa0\x94\xfa\x47\x90\x91\ +\xa4\xb4\x3b\x8a\x52\x06\xd2\x12\x94\x05\xa9\xbe\x47\x99\x5d\x47\ +\x35\x76\x16\x0b\x68\x0d\xe4\x08\xa5\x4a\x03\x66\xe8\x09\xfd\xfc\ +\xca\x00\xaf\x12\x3d\xfa\xf3\x0d\x69\xdc\xa5\xf2\xf5\xeb\x06\xa5\ +\xc7\xc6\xaf\x18\x64\x3e\x79\x2c\xd0\x1f\x1a\x93\xc7\x10\x02\x82\ +\xb8\x01\xe4\x06\x58\x9b\x00\x06\x8a\x2a\x26\x40\x11\x67\x92\x2c\ +\x8e\xc8\x8a\x80\xa2\x27\x98\x50\xd6\xc0\xce\x24\x19\x53\x1e\xbe\ +\x80\x2d\x39\x7d\x42\xd4\x7c\x05\xd3\x11\x7d\x42\xf6\xd5\x16\x56\ +\x1e\x83\xd1\x96\xd5\x6a\x44\x39\xd8\x32\xe2\x82\x42\x1c\x10\xf8\ +\xa0\x34\x80\x01\x14\x1e\x5d\x21\xda\x80\xa5\xa2\x14\x91\x03\x73\ +\x57\x08\x94\x52\xee\x7e\x94\xe2\x2f\x6e\x7e\xce\x24\xeb\xc3\x64\ +\x48\x31\x9a\x10\x2c\x16\x94\x13\x0d\xc2\xae\xf8\x34\xfd\x34\x01\ +\x5c\x55\x63\xba\x62\x09\x68\x20\xfb\xcc\xea\xbf\xc9\x3e\x7f\x59\ +\x12\x24\xf5\x0e\xc0\xbc\x60\xbb\x08\x48\x3c\x48\xab\x09\x89\xb7\ +\x00\x20\x8d\xbb\x24\xcb\x35\x98\x1d\x1a\xc0\x3b\xac\x5a\x40\xf6\ +\x0e\x2b\x92\x7e\x07\xfd\x8d\x0b\xf3\x87\x88\x02\x44\x41\xa6\xe6\ +\x35\x9b\x01\x4a\xe4\x1a\xe8\xe6\xf6\x1e\xc9\x1e\x49\xd7\x80\xa7\ +\x4b\x64\x71\x85\xdf\x40\xed\xbe\x71\xbd\x06\x2c\x6c\xfd\xcc\xec\ +\xa9\x91\x7b\xcc\x93\xb1\x7e\x8e\xf4\xf0\x0d\xeb\x5b\x30\xa7\xd2\ +\x03\xa9\xdc\xbb\xc9\x06\x5f\xcb\x16\x9b\xd7\xcf\x50\xca\xd3\x47\ +\x81\x06\xb8\x85\xa8\xe8\x89\x88\x9d\x92\x20\x0a\xc7\xc0\x9e\xda\ +\xe9\x2f\x30\x38\xb8\x77\xdb\xf8\x15\xd1\x11\xb3\xb7\x18\x3a\x53\ +\xa7\x00\xb6\xc0\xed\x09\xb7\x0d\x76\x35\x80\x5b\xaf\xcf\x25\x59\ +\x11\x10\xb3\x26\x9c\x68\x60\x66\x0c\x99\x7a\x63\xba\x5e\x9f\x7c\ +\x9a\x68\x20\x37\x2e\x87\x95\xa7\x9f\x1f\xea\xf7\x4a\xf0\x89\x18\ +\x20\x44\x41\x11\x0b\x3a\x71\xef\x04\xc0\x80\x06\xea\x19\x66\xb6\ +\xc0\x96\x99\xe0\xe3\xdb\x1c\x80\x65\x5e\x10\xac\x34\x90\x3e\x96\ +\x17\x44\xb1\x3a\x01\xeb\xa7\x2e\x41\xb2\xd1\xdf\x7e\x56\xff\x0d\ +\xf6\xf5\x00\x45\x3a\x20\x48\x36\x54\x9d\x11\x65\x56\x50\xa4\x83\ +\xd6\xe3\x16\xc0\xcb\xaa\x20\xc9\xf6\xa4\x71\xb7\xf5\xfe\x16\xc0\ +\x96\xc9\x01\xd2\xed\x01\x3f\x57\x92\x03\x19\x76\xbb\xc9\x4b\x64\ +\xd8\x63\x93\x97\xe4\x4a\xb2\xc9\x4b\x0e\xee\x90\x69\x7e\x33\x15\ +\x9a\x43\xc7\xbe\x05\x5a\x0b\x72\xcb\x5b\xdd\x86\xb8\x28\x3f\x71\ +\xdd\x8f\x2a\x4a\x22\xfd\x3e\x91\xa8\x81\x6c\xbe\x78\xbb\xb5\xaf\ +\x29\xa5\x57\x33\xf5\xb1\xe4\x70\xd7\x23\x07\xe0\x63\x56\xf6\xcc\ +\xbf\x45\x19\x06\x06\xe8\x77\x05\x24\x29\x69\xd1\x31\xcc\x1c\x18\ +\x00\x1b\x90\x92\x91\xc7\x82\x4c\x1f\x73\xb4\x1c\x88\x85\x79\x9f\ +\x8c\xa2\x8a\xdb\x3f\xe6\x4e\x51\xf4\x04\x83\x3c\xa5\x9f\x45\x2d\ +\x70\x0f\x7b\x5d\x27\x27\xe2\xa0\x60\x3b\xd0\xe0\xf7\x37\x7d\xca\ +\xc1\x96\x65\xe5\xc3\xd8\x27\x9c\x8c\xc8\xa7\x89\xf9\xf4\x5a\xe2\ +\x6c\x07\x3e\x49\x6c\x8f\x44\x01\x3e\x29\x25\x09\x82\xaa\x75\x88\ +\xf7\xe3\xa0\x75\x88\x3f\xbe\xde\x7c\x7e\x3e\xd2\xdf\xe7\x22\xde\ +\x32\x0e\x03\x96\xb9\x06\xec\x67\x7e\xc5\xff\x9f\x4b\x91\x0e\xd8\ +\x2b\xd5\x02\xe6\xb9\xbf\xc1\x3b\xac\xf0\xe3\x80\x20\xd9\x38\xc0\ +\xa7\xd5\x84\x65\x55\xb0\xac\x0a\xc6\x5e\xe0\xe4\x5d\x4b\x5e\x18\ +\xf0\x1e\xcb\x0a\x1f\x40\xe5\xe6\x07\x31\xdb\x6a\xb5\x43\x76\x6f\ +\xc9\x52\xc3\x6b\xf7\x1e\x07\xb1\xa9\x59\x57\xe4\x0e\xa0\xea\x88\ +\x71\xbb\x47\xaa\xf8\xdf\x75\xb1\x80\x6c\x5e\xb7\x4c\xec\x47\x15\ +\xa5\x92\x24\x51\x85\x2f\x22\xf7\xce\xb5\x3e\xaf\xb9\x58\xfe\x88\ +\x0e\x3f\xa7\x97\x05\xe0\x91\x51\x88\x94\x8d\x5f\x69\x20\x43\x83\ +\x7d\x63\xc2\x4c\x19\x29\x11\x1b\x19\x12\xb6\x98\x16\xa0\xd3\x9b\ +\x12\xec\x94\xbb\xff\x18\xa8\x00\x59\x1c\x31\xec\x75\xb5\x84\x88\ +\x43\x26\x71\x5b\x72\x0c\x09\xf0\x1f\x7b\x84\x61\x84\xff\xd8\x63\ +\x1d\x7b\x24\x71\xc2\xe8\xf1\x23\xd4\x24\xc1\x9f\x14\x74\x27\x43\ +\xb6\x03\x9f\x69\xd8\x37\x47\x80\x94\xd5\xfa\xee\x93\x8c\xdb\xbc\ +\x58\x76\xb6\x5b\x61\x8e\xbc\x16\x58\xe1\xaa\x82\xcf\x87\x4c\xb2\ +\xbe\x03\x70\x1b\x24\xe9\x89\x0e\x3e\x77\xf1\xbc\x25\x9d\xde\x65\ +\x8b\x89\x9b\x92\xc6\x32\xb5\x05\x61\x91\x1a\xed\x3f\x29\x38\x70\ +\xe7\xc0\x6b\xc1\x9c\xc6\x5d\x56\xc5\x96\xdc\xdf\x9e\x30\xb1\x05\ +\x74\x52\x76\xf1\xe7\xb1\xbe\x21\xc3\x9e\x03\xef\x7d\x25\x51\xe9\ +\x73\x7d\x7f\xf7\x16\x6f\xd4\xc3\x33\xa0\xd8\x23\x41\x05\x7a\x2b\ +\x0a\xba\x44\x8e\x99\xed\xe3\x25\x91\xd6\xd2\x47\x2c\x7d\x0c\xc0\ +\x13\xc9\xd1\x7c\xcc\xcb\x5a\xbb\x43\xa9\x34\xc3\xfa\x51\x85\x3c\ +\x62\xbe\x7a\x39\x69\x24\x85\xf2\xea\x6d\x53\x52\x58\x80\x9a\x6d\ +\x45\x4c\xa0\x12\x06\xa5\xc7\x76\xaf\xa8\x44\x8f\x4c\x2f\x13\x90\ +\x4a\xb2\xf1\xab\xc6\xc2\x0d\x02\xe5\xd3\x31\x12\xa1\x29\x17\x8a\ +\x9e\xd0\x92\xe2\xdc\x4e\x3a\xd8\xd6\x6c\x1c\xd7\xdf\xd3\x64\x3a\ +\xe3\xb3\xe1\x8c\xd1\xf0\x82\x22\x16\x24\xf4\x98\x4d\x05\x13\x31\ +\x62\x22\x46\x88\x69\x42\x57\x08\x92\x38\x21\x89\x93\x13\xb0\x0a\ +\x62\x46\xc3\x36\x68\x7d\x25\x5b\x00\x6b\x5d\x37\x40\x14\x54\x2d\ +\xe9\xd3\x15\x82\x0f\xa5\xc7\x17\xd5\x80\x7c\x90\x30\x79\xe0\x9f\ +\x2c\x00\x7f\x4c\x07\x37\x3f\xa7\xaa\xc6\x1c\x76\x37\x6e\x51\xd7\ +\x94\x16\xcd\x1d\xcc\x02\xd0\x82\x7a\xbb\xa8\xc1\x0b\xb4\x98\xd8\ +\xf3\xe6\x84\x65\x9f\xd2\x5f\xb4\x64\x84\xdd\x01\x52\x7f\x8f\x2f\ +\x3e\xd6\xd4\xac\x1e\xac\x48\x6f\xbb\x04\xc9\x15\x22\x79\xcd\x32\ +\x1e\x9f\xa7\x4f\x51\x20\x54\x48\x97\x48\x83\x56\x74\xcc\xa2\x50\ +\x33\xb1\x05\xaf\x3a\xf3\xd2\x54\x1e\x39\x15\x91\xa8\xb7\x52\xd5\ +\xb7\x81\x2d\x9a\x85\x25\x90\x44\x42\xbb\x22\x44\x2d\x80\x47\x44\ +\x48\x64\x43\x54\x44\x48\x51\x19\x38\x37\x80\x2c\xaa\xda\xc5\x30\ +\x00\x2e\x44\xda\x62\xe2\x41\xe9\xe1\xa9\x82\x98\x2e\x91\xa8\x18\ +\x94\x9e\x63\xe1\x4e\x4f\xd0\x69\x68\x5d\x0b\x5a\xa7\x7f\xab\x98\ +\x49\xec\x33\xa1\x64\x81\xef\xd8\x36\x0c\x23\xfc\x49\xa1\xc1\x48\ +\x8f\x84\x1e\x13\x31\xd2\x32\x40\x44\x74\x85\xa0\x2b\x84\x5e\xfd\ +\xf7\x8b\x5a\x0a\x64\x6b\xf6\x4a\xb1\x5a\xdf\xb1\x79\xa7\x98\xe7\ +\x5b\xfa\x1b\xf3\x99\xf3\xa5\x01\x98\x80\x78\xe8\x40\x74\xcc\xc4\ +\x4d\xb0\xa5\x94\x27\x2e\x85\xd5\xc7\x0f\xfa\x4b\xe7\x4a\xe4\xe5\ +\xd4\x49\x8a\x7d\xfe\xf6\x64\xa1\xfa\x63\x8b\x3b\xcf\x5b\xb6\x34\ +\xbf\xd5\xc4\x4d\xe9\x52\x75\x46\x0e\x80\xe7\xdc\x06\x56\xa1\x03\ +\xf3\xb2\x2a\xa8\xd6\x93\x16\x13\xdb\xc5\x5d\x90\x6c\xdc\xe7\x86\ +\xcb\x78\xcc\xc4\x82\x2e\x7d\xce\xc5\x58\xb2\x38\x40\xb4\x7f\x48\ +\xd4\x91\xb0\x7f\xe8\x98\x7a\x00\xa0\x02\xba\xa2\x8b\x62\x6f\xd8\ +\x2e\xd0\xc7\xe6\xc6\x1e\x5b\x44\x15\x9e\x8c\xe9\x1e\x31\x6e\xd7\ +\x30\x69\x53\x42\x68\x17\x83\x1a\xc0\x66\x5b\x20\xe9\x13\x21\x1d\ +\xb0\x65\xad\x51\xab\x18\xe9\x65\x0e\xc0\xc7\xf6\x5c\xa4\x3c\x63\ +\xc9\x79\x2d\x69\xa1\x0c\x0b\x6b\xdd\x9e\x11\xa8\x84\xc8\x00\xde\ +\x31\xa4\x88\x0c\x30\x05\x01\x0a\xcf\x80\xf4\x90\x78\x3c\xac\x1a\ +\xd2\xa7\xf3\x04\xff\xb0\xa4\xec\x8c\x19\x1c\x24\x9b\x4e\x04\x87\ +\x25\xe5\xe8\x82\x27\x07\x49\xca\x8e\x72\x74\xc1\x2c\xa8\xce\xda\ +\x52\x30\x84\xac\x60\xaf\x94\x61\xbb\x21\x7e\x39\x39\x79\x6e\x18\ +\x46\x0c\x27\xda\x70\xc3\xab\xd9\x7e\xbf\xbd\xa5\xe4\x33\xba\xfd\ +\x05\x6c\x87\xf8\x86\x89\x89\xfb\x2d\x60\xed\x95\xa2\x10\x07\x22\ +\x06\xec\x51\x28\x3c\x07\xaa\xbd\x52\x74\x85\x60\x53\x44\x2c\xf3\ +\x3b\xc2\x4d\x4a\x10\x06\x5c\x4c\xc6\x6c\xbf\xff\x81\xd7\x6f\x97\ +\x84\xbf\x1e\x31\x11\x33\x67\xa5\x1d\x5b\x6a\xcd\x7f\x93\x9a\xa7\ +\xa4\x59\x0a\xa4\x5a\xe3\x4f\xee\x81\xc4\xd9\x6b\x7a\x61\xb7\x72\ +\xee\x84\x5b\xb0\xd2\x90\x45\xa3\xdc\x5d\x1d\x7b\x01\xde\x70\x01\ +\x8c\xf5\x77\x53\xb6\xdd\x89\xaa\x1a\x6b\x77\xe2\x59\xa4\x57\xe8\ +\x83\xd0\x67\xd2\x91\x6e\xdb\xbc\x0c\x42\x9f\x41\xe8\x23\x1a\x4e\ +\x46\x57\x74\xe9\x12\x39\x3b\xae\x7b\xc6\x69\x00\xa8\xa2\x0c\xdf\ +\x3c\xbe\x8f\x2a\xa7\xa1\xfd\xa8\x62\xdf\x94\x0f\x0d\x00\x97\xd2\ +\xd3\x00\x06\x22\xc3\xcc\xa9\xf4\x88\x3c\xfd\xfc\xc8\xab\xb0\x0a\ +\x39\x32\xff\x39\x96\x76\x87\x15\x0f\x41\xa6\xf7\x2f\x7c\xad\x89\ +\x0d\xa0\x2d\x13\xdb\x45\x5e\x24\x2a\x36\x7e\xe5\x3c\xe1\x09\x25\ +\xe3\x64\xc3\x70\xa2\xd9\xf5\x6a\x1a\xf2\xac\x17\x50\x4e\xa1\xec\ +\x8c\x29\xa7\x10\x07\x6b\x84\xf0\x99\x05\x15\x62\x9a\x30\x0b\x2a\ +\x26\x62\xc4\xe0\x20\xcd\xce\x30\xe2\xc1\xc0\x77\xcc\xea\x18\xb6\ +\xaf\xfd\xd0\xd2\x5f\xe0\xc7\x01\x62\x9a\x68\xe7\x27\xab\xef\xd7\ +\xd2\x63\x48\x21\x0e\x24\x71\x42\x11\x0b\xed\x3e\x3c\xaa\xdc\xf5\ +\x45\x19\x10\x64\x8a\xfd\x5d\x17\x5f\x49\x14\x9e\xf6\x87\xb3\xf5\ +\x09\x80\x03\xd5\x69\xb1\x70\xd3\x47\xde\x2b\xc5\xe0\x20\x19\x87\ +\x01\xf9\x20\x61\xbb\xd0\x7f\xc7\xe7\x5f\x3c\xe3\x65\x01\x7f\xfe\ +\xe7\x6f\xb9\xff\x6e\x89\x9a\xa7\xf8\xa4\xa8\x79\x4a\x31\x5f\x3a\ +\xf6\xf7\xe3\x00\x6f\x34\x85\xf9\x56\x1f\x31\x16\x01\xf3\x45\xc0\ +\xd8\x2b\x9d\x0c\xaa\xaa\xb1\x93\x0f\xe7\xd8\xb7\xc3\x05\xdb\xfd\ +\xde\x31\xb1\x05\xf0\xb2\x2a\x60\x51\x51\x6d\x47\x90\xad\x5b\x1e\ +\x33\x80\x3f\xf6\x49\xb7\x07\x2d\x00\xfd\x20\x01\x34\x80\xed\xed\ +\xc4\x93\x66\xd5\x18\x91\xab\x39\x21\x7d\x54\x83\x6d\xad\x96\x3d\ +\x5e\xc8\x95\x44\x54\x51\x46\xe9\x2c\xb3\x18\x90\x1a\xd4\xb2\x21\ +\x1f\xa4\xd2\xaf\x8d\xaa\x1f\x2d\x7f\x58\xa0\xa6\x46\x9c\xe8\x42\ +\xcb\xe9\x6b\x9a\xf7\x09\x7c\x14\x25\x8a\x58\xb3\x8e\x28\x50\xca\ +\xa3\x27\x22\x3c\x91\x39\x00\x6b\x9f\xb8\xf6\x85\x43\x2a\x2d\x13\ +\xa2\x10\xaf\x6a\xc8\x2c\x55\x32\x13\xa1\x96\xc7\xc1\x9a\x84\x29\ +\x25\x05\x1f\x45\x48\xe2\x57\x06\x80\x09\x92\x0d\x01\x7b\x20\xd1\ +\x2c\x87\x70\xee\x81\x64\x43\xc4\x00\x89\x07\x2c\x49\x08\x80\x35\ +\xc4\x43\x0d\xe4\xf9\x2d\xa8\x00\x21\x02\x4a\x0a\xe8\xaf\x09\x54\ +\x97\x94\x1d\x42\xf8\x04\xaa\x83\xa2\xa6\xb0\xd1\xf0\x82\x0e\x15\ +\x05\x70\xc8\x76\x04\x40\x11\x17\x28\x95\x50\x88\x0d\x81\xea\x18\ +\x1d\xdf\x39\xfb\xfd\x5a\x20\xdb\x62\x47\x31\x9a\xc0\xbd\x66\xc4\ +\xe5\xee\x9a\xe2\xb3\x2b\x7e\xf6\x1b\x3f\x43\xbe\x7a\xcd\xdb\xc5\ +\x9a\x3c\x2f\xf8\xea\xc1\x8c\x7c\xb1\xe4\xe5\xab\x1f\xe8\x7c\xbf\ +\xe6\x97\x7f\xf5\x21\x28\x78\x9b\xdd\xb1\xf9\x7e\xc3\xab\x97\xbf\ +\xa0\x3f\xb9\xe0\xf3\x17\xcf\xd9\x8e\xa7\x4c\xd0\x45\x8e\xaa\xaa\ +\xa5\x80\x95\x03\xf6\xfa\x87\xd2\xe3\xc0\x1d\x7d\x19\x43\x37\x87\ +\x51\x4e\x59\x6d\x59\xd2\xaf\x8f\xec\x71\x41\x27\x9e\xb5\x5e\x5b\ +\xa4\x03\x0e\xbb\xf7\x24\xfd\x8e\x06\xb1\x05\xac\x03\xa5\xbd\xad\ +\x02\x12\x21\x41\x44\x40\x61\xa4\x43\xe1\x00\x9c\x56\x8d\xe7\x36\ +\xfd\x60\x0b\xe0\x06\xa0\x01\x3a\x51\xc6\x41\x2a\x84\x01\xb2\x4f\ +\xd5\xf2\x85\x6d\xd5\xcf\x8f\xaa\x96\x71\x26\x91\x24\x51\xf4\x49\ +\x00\x9f\xfe\x40\x65\xcb\x5a\xb3\xd7\x2b\x2b\x29\x94\x44\x08\xed\ +\x4e\x48\x15\x13\x09\xcd\xc2\x21\x10\x1f\x2a\xaa\x78\xd5\x02\x71\ +\xbe\xde\xf0\x61\x0d\xa3\x61\x44\x21\xba\xa4\x99\xd6\x7e\x0f\xc2\ +\x0a\xca\x09\x29\x25\xb0\xb1\x4b\x57\x53\x45\xcb\x59\xd8\x4a\x20\ +\xf7\x28\x42\x02\x14\x59\x67\xc8\xe0\x70\x57\xaf\x17\x94\x22\x25\ +\x04\x42\xc8\x52\x56\x6b\x49\x18\x2a\x12\xa5\xdf\xc7\xee\x44\xed\ +\x23\x70\x0a\x24\x0e\x88\x6b\x34\xb9\x0c\xb3\x80\x22\xfe\x34\x70\ +\x8f\xdd\x82\x26\x98\x3f\xf3\x2b\x82\x30\x60\x39\x48\x58\xbe\x4b\ +\x11\xd3\x25\x0c\xe0\xf1\x6f\xfe\x1a\xf3\xfb\x35\xb3\xd5\x82\xbb\ +\xc5\x92\x8b\xc9\x98\xce\x62\xcd\xdd\x72\xc1\x9b\x77\x05\x30\xe1\ +\xf5\xea\x7b\xaa\x65\xc8\x7e\xf4\x80\x8b\xf1\x98\x8b\xc9\xf8\x93\ +\x8b\xb9\x26\x08\x83\x64\xc3\x67\x7e\x85\xe4\x82\x03\xcb\x9a\x89\ +\x8d\xa3\x58\x56\x5b\xaa\xf1\x8c\x73\xb5\x96\xc3\xee\x86\x34\x4b\ +\x35\x13\x77\x89\xd8\xab\xba\x4a\x67\x81\xbc\x57\xfb\x96\xce\x75\ +\xa5\xca\xc6\xe1\x3f\x91\xf2\x44\xf3\x5a\x3f\x57\xeb\x62\x08\xa4\ +\x47\x69\xc0\xad\x88\xe8\xe2\x81\x94\x4e\x3e\xf8\x8d\x85\x9c\x2b\ +\x63\x9b\xeb\xbe\xb9\x1e\x9d\x61\x5b\x0b\xee\xa8\xe1\x4e\xb4\xca\ +\xd1\xca\xab\x8b\x1c\xf8\xba\xb8\x41\xa6\xe5\x84\xa8\x1c\x1b\x6b\ +\x49\x11\xb9\xd2\x76\x10\x17\x44\xbd\x09\x4a\x95\x08\xa1\x8f\x4c\ +\x01\x11\xc5\xbb\x94\x70\xbc\x45\x70\xe1\x0e\xf7\x6c\xd7\xa4\xe6\ +\xcb\xd7\x40\xcb\x0d\xa0\xd1\xc0\xcc\x72\x88\x43\x03\x52\x48\xb3\ +\x14\x3f\xde\x91\x66\xf5\xe2\x47\xdb\x70\xfa\x79\xc4\x21\xa1\x71\ +\x32\x52\xeb\x6f\x1a\x47\xc3\x02\xda\x28\x65\xc0\xee\x20\x3d\x86\ +\x04\xac\x29\x28\xe2\xc2\x01\xbc\x59\x8e\xfe\x14\x13\x0b\x2a\xc7\ +\xc4\x51\xac\x28\x4a\xcd\xc6\x77\xcb\x05\x17\xff\x46\x4b\x8a\x7e\ +\xfa\x9a\x89\x0f\xc5\x63\xc1\x40\x1b\x7b\xfc\xf2\xaf\x3e\x44\x66\ +\xcf\xf8\x50\xea\xef\x77\xb6\x78\x00\x63\xf8\x7c\x32\x74\x00\x1e\ +\x4d\x6b\xdd\x1a\x24\x1b\x07\xda\xa6\x1c\xd0\xd2\x62\xce\x61\xb5\ +\xd4\x0c\xbc\x5a\x90\x45\x09\xfd\xf5\x18\x46\x39\xb3\xaa\xa0\xda\ +\x54\xe4\xfe\x96\x90\x87\xad\x85\x9d\x98\x42\xa7\x77\x59\x57\xec\ +\xba\xa2\x7b\x22\x0d\x9c\xe6\x6d\xdc\xa7\xce\xf9\xc0\x0d\x10\x36\ +\x75\x70\x20\x3d\x57\xc0\xd8\x9b\x6d\xb7\xc1\xba\xcd\xd7\x36\xfd\ +\x5f\xd9\xb8\x1e\xb5\x96\x6b\x5a\x4a\x70\x24\x33\xb0\x15\x2a\x03\ +\xdc\xf6\x4e\x57\x39\x37\xc5\x82\xba\x09\xe0\x8a\x18\xd1\x5c\xd1\ +\x2b\xc5\x26\x0b\x90\xbb\x05\x42\xf8\xba\x54\xdd\x94\x4a\xeb\x7a\ +\xa5\x9f\x66\x4b\x94\x52\xa8\xf9\x1e\xb9\x5b\x40\x96\xb3\xf5\x52\ +\x16\x59\xa9\xc1\x9b\x99\x05\x8a\xb9\xbe\x96\x5b\x88\x43\xfd\xb8\ +\x2d\xa1\x14\x0d\xbf\x35\xab\x17\x34\xe5\xa2\xed\xc3\xae\xe5\xf6\ +\x47\x59\xd5\x32\x71\x90\x05\x67\x01\x5c\x88\xc3\x89\x2b\x61\x4b\ +\xce\xda\xae\xab\xe8\x0a\xc1\x6c\x02\x83\x99\x96\x03\x87\xd5\x92\ +\x57\xdf\xff\xc0\xab\x05\x6c\x19\x93\xb2\x73\xef\xbb\xe9\xe8\xef\ +\x2c\x58\x2d\x90\xaf\x5e\xeb\x1d\x72\x90\x70\x31\x19\x73\x98\x8c\ +\x98\x4c\xd3\x56\x15\xaf\xcc\x0a\x67\xa7\x59\x67\x22\x48\x36\x94\ +\x4b\xfd\x5d\xac\xaa\x0a\x56\x21\xfe\x48\x2f\x6c\xcb\xa1\x26\x86\ +\x85\xaf\x8f\x86\x61\xd9\x3f\xa9\xd4\x55\x9d\xd1\x91\x26\x6e\x94\ +\x84\x9b\x8b\xb4\x63\x1f\x57\x57\xe2\x74\x2e\x42\x49\x45\x27\xaa\ +\x38\x48\x75\xe4\x4a\x68\xf6\xb5\x4c\x5b\x36\xae\xfb\x4d\x1b\xad\ +\x11\x2c\x6a\x32\x30\x47\xc0\x75\x60\x3d\x62\xe2\xda\x56\x13\x44\ +\x48\x04\xc2\x1d\x25\xd4\xa7\x02\x47\x8e\xa9\x33\x97\x9b\x50\x4a\ +\x22\x44\x44\x98\xf9\x60\x16\x76\x9b\x2c\x00\x16\xa4\x72\x07\xd9\ +\x54\x33\xe6\x7c\xc5\xbb\x65\xc9\x44\x7e\x64\xdb\xbf\x22\x3e\x54\ +\x06\x88\x3b\xf0\x04\x78\x8a\x78\xe5\x43\x08\x6b\x4f\xd5\xb9\x09\ +\x2f\x63\x58\x09\x5d\xd5\xcb\x72\x5b\x5f\xd2\x36\x5c\xaf\xcb\xda\ +\x53\x0c\xa3\x3e\x6b\xb9\x65\x68\xf3\x06\x93\x7b\x67\x51\x85\x59\ +\xc4\x30\xee\xff\x7f\xab\x98\x19\x26\x4e\x8e\xc4\xc7\x39\x79\x61\ +\xf3\x0c\x7a\xc1\xa7\xaf\x0f\x0e\x92\xd0\x17\x7c\x18\x4d\x18\xfe\ +\x6c\xc2\x37\x7f\xfe\x0d\x37\x7f\xfb\x1d\x00\x3f\x7d\xa8\xa9\xf5\ +\x62\x5c\x3b\x28\x77\xcb\x05\xe3\xa7\x4f\x18\xcc\x2e\xf8\xcc\xaf\ +\x0c\xfb\xae\xb4\x55\x58\x6a\x17\xc3\x3a\x1a\x96\x89\x2d\x98\x2d\ +\x90\xef\xbe\x5f\x3a\x57\xa2\x5c\x2d\xe8\xf3\x80\xb2\xb3\x87\x55\ +\x48\x39\x5c\xe2\x8d\x4a\xe0\x49\x4b\x8a\x34\xb5\x71\xd2\xef\x10\ +\x5a\xd0\xee\x39\x95\x06\x4e\x5a\x44\x15\x5d\xa9\x0b\x08\x5d\x0b\ +\x9d\x48\xa0\x9a\xbe\xae\x54\x1c\xa4\x87\x88\x2a\x0d\x77\x03\x52\ +\xcd\xce\xc2\x95\xa3\x6d\x65\x2e\x89\x04\xa9\xac\x8b\x1c\xf2\x18\ +\xbc\x55\x4c\xe4\x65\xad\x4c\x5b\x1b\xc0\xb5\x3f\x8c\x10\x67\x81\ +\xab\x8e\x00\x7c\x2c\x25\xdc\xfb\x29\x0f\xcf\x4f\xe9\x67\x09\x39\ +\x0a\x01\x7c\x54\x7a\xf7\x2e\x59\x72\xd8\xa4\xe0\x57\x78\xc5\x9c\ +\xc5\xed\x94\x22\x54\xed\x32\xbb\xf1\x52\x33\x51\x12\x28\x05\xf8\ +\xae\x10\x82\xd0\x80\x0d\xbc\x8c\x45\x15\x13\xec\x14\x0b\x63\xdb\ +\xad\x3d\x45\x51\xc5\x2c\xb2\x92\xc0\x33\xc0\x8e\x57\x90\xc1\x26\ +\x4c\x18\xe4\x69\xcd\xd2\x8d\x42\x89\x9f\x8d\x28\xe3\x15\x65\x67\ +\x0c\xc6\x0d\x19\x12\xb0\xce\xb4\x1f\x7d\x4e\x4a\x58\x4f\x58\xa7\ +\xd7\x54\xcb\x62\xf3\x95\x34\xe1\x28\x8f\xd1\x14\xba\xac\x51\xaa\ +\xe4\xef\xfc\xa3\x67\x8c\xdf\x3e\x61\xf9\xdd\x5b\xc6\x4f\x1f\x13\ +\x6e\x52\xc7\xba\x83\xd9\x05\x4f\x79\x6e\x4a\xd3\x95\x29\x35\x9b\ +\x85\xec\x76\xa8\x17\xa7\x8d\x94\x9b\x95\x14\x16\xbc\x45\x3a\xc0\ +\x1f\xfb\x5c\x4c\x0a\xde\x7c\xf8\x6b\x58\xc5\x64\x51\x42\x2c\x3f\ +\x92\x1d\x12\xe2\xe1\x12\xd6\x07\x2a\xff\xe2\x93\xba\xba\xea\x8c\ +\x1a\x9a\xb8\x01\xe4\x26\xa0\x1d\x78\xa5\x76\x85\x9b\x55\xb8\x52\ +\x7a\x0e\x94\x0a\x0c\x2b\x7b\x6e\xa1\x56\x1a\x4f\x58\x57\x1d\x6a\ +\xeb\xcc\x8f\x04\xbe\x94\x86\xcf\x9b\xa0\x6e\xfb\xb5\x78\x59\xcb\ +\xa9\x88\x1a\xce\x44\xdb\x1f\xe6\x4c\x04\xf4\x0c\x98\xcf\x00\xb8\ +\xa5\x8b\x55\x00\x5d\x1d\xb9\x54\x71\xd9\x08\xfa\xf8\x78\xc1\x80\ +\x70\xb1\x26\x1f\x02\x83\xda\x73\x0e\x33\x1f\x11\x0b\x17\x02\x2a\ +\xaa\x98\x40\x64\xa0\x34\x68\x8b\x5e\xac\x41\xdd\x03\x94\xcf\x20\ +\x48\xc9\x08\x08\xcc\xbf\xcd\x66\x2e\x26\xb1\xcf\x5a\xd6\xd2\x61\ +\x90\x14\x4c\xd2\x84\xfc\x53\xc5\x05\x53\x65\x1d\x1c\xa4\xa9\x88\ +\xa5\x4e\x52\x68\x4d\x5c\xeb\x68\x0b\x66\x6b\xb1\xd9\x20\x97\x95\ +\x19\x7b\x05\x5d\x11\xe9\x8a\x9e\x0a\xf0\x95\x24\xeb\x0c\x89\xc5\ +\x9a\x9f\x54\x4f\xf9\xc9\x17\x70\xff\xc5\x0b\xd6\xd5\x8a\x7c\xae\ +\x01\x35\x9b\x98\x52\xb5\x75\x4a\xa6\x38\x8a\x2a\x49\xa8\xaa\x31\ +\x9e\xb7\x3c\xf1\x96\xeb\x62\x48\xe0\x40\xf9\xa1\xf4\x28\xb2\x88\ +\x15\x15\x03\x99\x6a\x4d\x2c\x63\x4a\x99\xc2\xb0\x53\x07\xac\xce\ +\x64\x28\xbc\xc3\x4a\x97\x9d\x8f\x59\xb7\xbd\x72\x52\xee\x7e\x6d\ +\x87\x09\x2d\x3b\x4c\x50\xc7\x79\xbb\x86\x85\x5d\xde\xc1\xea\x61\ +\xf3\x7a\x11\x09\x84\x54\xee\xb1\xa8\xa1\xa3\x65\x83\x89\x9d\x94\ +\x30\x3f\xae\xb4\x8c\x6c\x41\xeb\x65\x48\xf3\x9f\xf3\x87\x95\xd2\ +\xc5\x8d\x63\x8b\xae\x51\xe4\xb0\x9f\x96\x37\xdc\x0a\x17\xc3\x24\ +\x76\xd7\x9b\xf9\x61\xfb\x3a\x1b\xf4\xc9\x5f\x0c\xa9\x82\xa9\xcb\ +\x16\xeb\xc7\x1a\x5f\xae\xf2\x5d\x39\xda\x7e\xe9\xc1\x4e\x11\x07\ +\x85\x03\xad\x8d\x61\x1e\x03\x78\x91\x95\x0c\x23\x2d\x19\x86\x95\ +\xc0\xab\x46\x2c\xf0\x5d\xe6\xb8\xa9\x9b\xfd\x6c\x84\x9f\x8d\x5c\ +\x49\x37\x8a\xef\x19\xd2\xd4\xd0\xc9\x09\x80\xcf\xbb\x13\x29\x89\ +\x0a\x11\x54\x8d\x50\x50\x0a\xa2\xe4\xc1\x21\x23\x62\x40\xb0\xbb\ +\x26\xf0\xde\x71\xe1\xad\xf8\x6a\x2f\xf9\xc9\x45\xc5\x2f\xf5\x33\ +\xfd\x78\xac\x18\x4d\x61\x38\x19\x9f\x94\xb6\x03\xef\xdd\x27\x3f\ +\xb7\x29\x2d\x9a\x21\xa3\xd1\x58\xef\x84\xb1\x4c\x29\xf9\x88\x3f\ +\x9a\x90\x1d\xba\xee\xbb\x3d\x97\x66\xab\x3a\x23\x5d\x76\xb6\xcc\ +\xeb\xd8\xf7\x48\x13\x1f\x87\x75\x2c\x38\x8b\x66\xe5\xcd\x80\xb2\ +\x4b\xa4\xb5\xaf\x88\xe8\x97\x71\xeb\xb1\xd2\x80\xce\x37\x1a\x98\ +\x23\x56\x6f\xb1\xaa\x97\x41\x15\x1b\x49\x51\xb5\x64\xc3\x89\x3f\ +\x7c\x9c\x9b\x68\x2c\x00\x2d\x5b\xdb\x05\x5d\xa0\x12\xc7\xc2\xde\ +\x51\x32\x0f\x60\xbb\x57\x28\x25\x1d\x50\x15\x31\x79\xa6\x1c\x90\ +\xbd\xf1\x90\x62\x90\x10\xc6\x25\x79\xe6\xbb\x14\x1b\xa2\xd4\x91\ +\x55\xfb\x85\xdb\x2f\x5d\x94\x64\x9d\xd3\x1d\xac\xa8\x62\x97\x27\ +\x5e\xcb\xad\x2e\x55\x67\xa5\x06\x34\x1a\xd4\xf6\x71\x1b\x22\x22\ +\xcb\xf1\x99\x69\x19\x61\x98\x38\x8a\x95\x73\x3a\x80\x86\x94\xc8\ +\x29\x3b\xe3\x23\x47\xa3\x1d\x06\x82\xd8\x2d\xec\xba\x42\x80\xf2\ +\xb5\x0f\x6d\xfe\x76\x5f\x69\x8f\xd7\x25\xe5\x6c\x9a\xb0\xb1\x18\ +\xf4\x95\x74\x59\x89\xbd\x52\x2d\x96\xf7\x49\x5d\xd1\xc5\xb2\xb1\ +\xbd\x7e\xbc\xc8\x6b\x16\x39\x36\xd5\x85\xbb\x1d\x77\xf6\x3f\x1a\ +\xc5\xb4\xdb\xb3\x9a\xd8\x8f\x2a\x94\x2d\x46\x9c\xa0\x46\xb3\xaf\ +\x27\xe3\xda\x03\x96\xed\x1d\x20\xf1\x32\xd6\xbe\xe7\xec\xb3\xd2\ +\xd9\x65\xed\xbc\xb0\x05\x78\xd3\xb1\x70\x4c\x6c\xca\xca\x2d\xb8\ +\x2a\x79\x26\xf0\x13\x9d\x08\x0a\x0d\x7c\x88\x84\xae\xcd\x09\x17\ +\x00\xca\xe8\xb5\x0a\x1d\x75\x97\x47\xbf\x2b\xd8\xfa\x29\x42\x44\ +\x48\xe5\x11\xc5\x25\x52\x49\xa2\xb8\x22\x37\x07\x68\x9d\x68\xcb\ +\x34\x58\xe3\x92\xdc\xb2\xbc\xf9\xe1\x85\xcd\x15\xdb\xc3\x9f\xbd\ +\xae\x7c\x17\xa0\x1f\xe4\xa9\x76\x25\x4c\xaa\x6d\x51\xc5\x2c\x4c\ +\x95\x70\x2d\x33\x26\x71\xdf\x69\xe0\x45\x56\x32\xc8\x53\x07\xe4\ +\x32\x5e\x39\x3d\xec\x67\x23\xd2\x78\x75\xe4\x1e\xef\xdc\xfd\xfe\ +\x61\x79\x96\x89\xf7\x4a\x91\xb2\x43\x66\x23\xee\xb3\x05\x33\x26\ +\xdc\xb3\x70\x5d\x1c\x92\x99\x0b\xef\x90\x65\xb5\xf7\x9d\xd5\x8c\ +\x5f\x4b\x17\xa3\xf7\x17\xef\xc8\x33\x9f\x65\x3e\x24\xdc\xdc\xd2\ +\x9f\x0c\xf9\xfa\x71\x8f\xa6\xc1\x7b\x5c\xaa\x76\x60\x36\x05\xca\ +\x55\x55\x31\xf0\xa0\x42\x67\xd9\xb7\x51\x46\xbc\x3e\xc0\xf8\x54\ +\x46\x1c\x83\x3a\x3c\xab\x21\x8d\x0c\x38\x66\x65\x5d\xc8\x88\x8c\ +\xcb\x60\x5d\x88\xca\xad\xc6\x6c\xf8\x27\x95\x6d\x5b\x4e\x44\x15\ +\xd8\x16\xa6\x33\x15\xba\xa8\xe1\x0b\x63\x98\x58\x36\x16\x70\xd1\ +\x89\x5f\xd1\xbe\x1e\xa4\x3e\x45\x22\x8d\xe7\x19\x6b\x29\x61\x74\ +\x70\x33\xb5\xe6\x18\x58\x05\xae\x72\x67\x3b\x3b\xb6\x4a\x01\x01\ +\x0a\x49\x64\x81\xec\x5e\x97\x91\xc7\x75\x2b\x92\x75\x34\x5c\x5b\ +\x92\x05\xaa\xf2\x81\x0c\xa1\xe2\x13\x1d\x67\x3b\x41\x28\xe2\xfa\ +\xc7\xdf\x29\xe7\x50\x60\x1d\x0c\xeb\x5c\x64\x39\x13\x80\x30\x3a\ +\xab\x87\xed\xd6\x7a\xc4\xc7\x8f\xdb\xd6\x25\xc7\xe0\x68\xc7\x63\ +\xbd\xe9\xb3\xdd\x5f\xa3\x78\x8b\x48\x07\xcc\x79\xa9\x19\x90\x0d\ +\x07\xee\xe8\x18\x49\x60\xf3\x0c\x1d\x2e\x38\xf0\x9a\x4e\x12\x41\ +\x9a\x40\x92\x9a\x0c\xf6\x15\xd3\x49\xa1\x8f\x18\x93\x0b\xfc\xde\ +\x88\xa7\xb1\x42\x66\x33\x3e\xbe\xfc\x86\x8f\x3c\xe7\xc1\x63\x23\ +\xad\xe2\xe1\x27\x43\xf5\x77\x8b\x25\xdb\xc5\x1d\xfd\xc9\x45\xeb\ +\xfe\xb8\xa9\x89\x8f\xd8\xfc\xb8\xb3\x23\xb4\xc0\xeb\x1c\x81\xd1\ +\x05\x76\x8c\xfd\xe6\xb6\x51\x45\x81\xc4\x23\xa6\x38\xb2\xd8\xdc\ +\x73\x84\x4e\x9a\xa9\xa3\x50\x8f\x05\x6a\xd4\xd0\xbb\x78\x19\x52\ +\x2a\x92\x48\x1c\x89\x04\xd9\x28\x33\x67\xed\x62\x88\x54\xf4\xcb\ +\x98\xad\x9f\xd1\x2f\x63\xca\x6a\x4b\x90\xf6\x51\x49\x0d\x9c\xc8\ +\x84\x7f\x44\xc3\x9d\xe8\x99\x9e\xb8\x4a\xf4\x4e\xe4\xc4\x09\x13\ +\x8b\x0a\xa9\x3c\x2a\x11\xe0\xa9\x82\x48\x64\xda\x86\x03\xfa\x24\ +\x90\x59\xfd\x9c\x81\x8a\x5d\x44\x53\x19\x50\x2b\xe5\x6b\x66\x36\ +\x92\x43\x58\xd6\xb6\x8f\x99\x85\xdf\xda\xfc\xdb\x16\xf8\x47\x6c\ +\x6c\xe4\xc6\x6e\xcf\xb0\xd7\xa5\x4a\xd2\x56\x15\xd1\xcf\x46\x44\ +\xf1\x3d\xeb\x46\x26\xb9\x20\x27\x25\xac\x01\x6c\x5e\x9f\x67\x2f\ +\x5d\x90\x3f\x8c\x25\xcf\x26\x0f\x5d\xae\x61\xd3\x79\xee\x02\x4c\ +\xb3\xe0\x19\x00\xf7\x85\xc7\xe0\xf0\xb0\xf1\xed\x3c\x44\x66\xc2\ +\x85\xe7\xa7\xfe\xe8\x24\x47\x6c\xfe\x71\x74\x7a\x63\xf2\xc5\x73\ +\xfc\xf9\x1b\x0e\xde\x63\x3a\x8f\x22\x5d\x5e\x27\x71\x0b\xbc\x63\ +\x40\xf7\x27\x17\x8e\x81\x87\x5e\xc9\xba\xf2\x09\xe3\x88\x78\x9d\ +\xe2\x0d\xe6\x28\x9e\x20\x3e\x91\x61\x66\xed\x69\x39\x21\x22\xa1\ +\xcb\xc1\x06\xcc\xbe\xd4\xdb\xbd\xd4\x8f\xf9\x52\xb6\xec\xb2\xc0\ +\x64\x1e\x8a\x06\xe0\xad\xee\xf5\x91\x94\x0a\xfc\x48\xcb\x05\xd1\ +\x14\x00\x86\x69\x2d\x18\x71\xcd\xa6\xfa\x59\x41\xea\xb3\xf6\x2b\ +\x92\x48\xd6\xcc\xac\xe6\x48\xd0\x1a\xdb\xd7\x00\x06\xd8\x26\x3a\ +\xb5\x5c\x50\x12\xa4\x7d\xca\x6a\xeb\x52\x6e\x51\x23\xbd\xa6\x0c\ +\x9b\xf6\x88\xd9\x71\x5e\x4e\xd8\x7e\xba\xfe\xa1\x64\x4b\x0d\x60\ +\xbd\x2d\x88\x44\x85\x52\x92\x64\x69\xbe\xfc\x81\x87\x17\x0c\x1a\ +\x7d\x76\x70\xd8\x29\x02\x51\x82\x52\x28\x15\x23\x0c\x58\x01\xa6\ +\x99\x47\x16\x57\x4e\xd3\x17\x76\xe1\xd7\x70\x60\x02\x2f\x63\x6d\ +\x16\x76\x64\xb9\x03\x35\xa2\x24\x3f\x48\xc2\x34\x69\x34\x9a\xe4\ +\x8e\x71\xf5\xdf\xbf\x65\xed\xf7\xcf\xba\x12\xf3\x6c\xce\xe2\xd5\ +\x86\xc9\xe7\xcf\xe8\x67\xe0\x4f\x6c\x61\x44\x7f\x8f\x63\x63\x44\ +\x0e\xe2\x94\x85\x79\xcb\x32\x97\x6c\x36\x7a\xa1\xb9\x04\x86\xcc\ +\x59\xe3\xb1\xfd\x3e\xa0\x3f\xd1\xa5\x66\xfd\x7b\xcf\x09\xe7\x26\ +\xa7\x3c\x1d\xd1\xf5\xfa\xc0\x9c\xed\xcb\x37\x7a\x31\x3c\x5d\xd2\ +\x7f\xb7\x25\xf9\x72\xd6\x62\x53\xbb\xd5\x72\xe0\xde\x01\x18\x60\ +\x5d\xf9\x0c\xbd\x12\x64\xda\x4e\x3a\x9e\x61\xe2\x32\x2b\x60\x58\ +\x11\x0a\xa0\x40\x22\xf0\x50\xc6\x45\x50\x40\xc7\xbe\x58\x7a\x54\ +\x51\x45\x60\x4b\xc5\xad\x36\xa4\x88\x22\xca\x60\x11\x22\xd8\x3a\ +\xf1\xaf\x5b\x8a\x32\x84\x01\x5c\x5c\x94\x64\x52\xe9\x6d\xe0\xeb\ +\xcc\x6f\xa3\xd8\x11\xa4\x3e\x65\xb5\x65\x1b\xf8\x0c\xcb\x98\xad\ +\x94\xe8\x67\xe9\x2c\x85\x8e\x66\xda\xfc\x80\xd0\xaf\x6f\xf8\x19\ +\x9d\x24\xe3\x90\xf6\x29\x1a\xcd\x97\x3d\x62\x76\x22\x73\xad\x52\ +\x4d\x00\x1f\x5f\x36\xbe\xce\x0e\x6f\x8b\x0e\xd1\xe0\xdf\x91\xcd\ +\x30\x00\xae\x8a\x8d\x0d\x91\x1e\xc9\x89\x1a\xc0\x7a\xab\x8b\x09\ +\xb6\x22\x88\x10\x47\xa5\x08\x0d\x5c\x5b\x20\xb1\xa5\xe6\x49\x96\ +\xb3\xf6\x14\xf1\xa1\x22\x0c\xa3\x9a\x89\x1b\x9e\xb1\x2e\x67\xe7\ +\x2c\xca\x80\xa9\x1f\x38\x56\xd6\xe5\x6f\x28\xdf\x55\x75\x45\x6c\ +\xf1\x3d\x0b\x60\xf5\x32\x60\xe0\xdd\x39\xb0\xcc\x06\x3e\x55\x30\ +\x65\x34\x1e\xb0\x5a\x6e\x1a\x7f\xd5\x7d\xbd\xe6\x32\xdb\x47\x93\ +\x81\x03\x6f\xdf\xe4\x3d\x6e\x57\x25\xbb\x72\x41\x6f\x55\x72\x98\ +\x68\x81\x3b\x1b\xe9\x9d\x77\x38\x99\xb2\x5f\xac\x51\x4a\xd1\x15\ +\xc9\x89\xe5\xe6\x9b\x1d\xd1\x63\x4a\xc5\x9c\x75\xe5\xb7\x81\xdc\ +\xac\x14\xf7\xd7\x94\xdb\xe1\x49\xe8\xdf\x55\xec\x02\x22\x8a\x48\ +\xd2\x95\x1e\x45\x54\x21\xa4\x87\x32\x7a\xb7\x59\x81\x73\x8b\x32\ +\x23\x0f\xb4\x5c\x88\x40\x28\x50\x03\x67\xbb\x95\x52\xea\xae\x65\ +\x22\x7c\x35\x27\x03\xf2\x55\x48\x16\xe7\x70\x00\x9f\xd0\x24\xdb\ +\x42\xed\xc2\x89\x9c\xb8\x71\x84\x89\x8c\xf4\x00\xed\x37\x27\x54\ +\xa7\xb5\x3c\x67\xa1\xe9\x18\xa2\xdc\xef\x89\x92\xb0\x4e\xb1\x19\ +\xf3\x5e\x9d\x69\xf6\xac\xce\xb0\xb1\x2d\x4f\xb7\xb5\x70\xa3\x5d\ +\x49\x05\x78\xe3\x1a\x7e\xc5\x20\xa1\xb0\x5a\x57\x65\x74\x7a\x53\ +\x0e\xbb\x66\x79\x25\xa3\xa8\xa6\xa8\xe5\x9a\x55\xb6\x67\xc4\x80\ +\x2c\xae\xc8\xe7\x7b\xe7\x6e\x0c\x07\x1d\xe6\xc5\x0e\x44\x0d\xe4\ +\xb5\xa7\x40\xc2\x10\xe1\xaa\x82\x6b\x4f\x31\x34\x4c\x6c\xf5\x32\ +\x71\xe8\x4a\xd5\xfd\x4d\xc9\x7a\x52\x34\x98\x38\x24\x5f\x6f\x08\ +\x27\x11\x53\x86\xae\x73\xa2\x3f\x29\x98\x4c\xe0\x62\xf2\x33\xf6\ +\x8b\xef\xf1\x99\x32\xf6\x4a\xf6\x95\x6e\x52\x7d\x61\xed\xb2\xb1\ +\x0f\xcb\x52\x6f\x81\x4e\xdc\xe3\x90\x35\x9c\x8e\xc6\x63\x4f\xbc\ +\x3e\xf0\x14\xc6\x3e\x45\x2c\x08\xde\x67\xfc\xdb\xf9\x96\xc3\x6a\ +\xc9\xaf\x98\x58\x67\x90\x05\xf8\x22\xc5\x25\x7b\x4c\xea\x4f\x4b\ +\x1c\xc9\x76\x71\x47\x32\xf1\x9d\x94\x38\x06\xb2\x00\x28\x27\xae\ +\x80\xd2\x64\x65\x9d\x9d\x30\x01\x74\xeb\x36\x78\xb2\xb6\xc6\x02\ +\x63\x7d\x15\x06\xb8\x2e\xd0\xde\xd0\xb9\x42\x2a\x23\x87\xf2\x96\ +\x13\xa1\x6d\x9a\x43\xa3\xb1\x32\x22\xee\xf4\x28\xc5\x54\x5b\x27\ +\x22\x32\x5b\x3d\xeb\xa2\xea\xc7\x44\x91\xa0\x30\xba\x56\xb7\x31\ +\x45\x6e\xdb\xea\xa8\x33\x00\x96\xe6\xf0\x2c\xa5\x32\x76\x4c\x64\ +\x42\xef\x25\x42\x54\x2e\x3b\x21\x1a\x8b\xba\x73\x00\xf6\xc8\xd8\ +\xf8\x15\xc9\xa1\x3c\xe9\x70\x96\xd6\x6b\x1e\xd7\x11\xff\xad\x9f\ +\x36\x58\x22\x43\x08\xdb\xb2\x94\x35\x58\x58\x7f\x6a\x12\x1c\x60\ +\xe0\xb1\xc6\xd3\x95\x3f\x20\xce\xbc\xba\x64\xed\xa4\x9d\x62\x10\ +\x17\x14\x55\xec\x00\x9d\x15\x01\x59\xc7\xd3\xc9\xba\x24\xd5\x76\ +\x5c\xec\xd7\x00\x8e\xdb\xeb\xf2\x66\x79\x24\x0c\x23\x92\x38\x61\ +\x32\x9d\xd5\x8c\x3f\xe8\xf0\xf4\xf1\x15\xc3\xc9\x98\x07\x5f\x7e\ +\xc1\x83\xc7\x3d\x18\xfb\x74\x27\x43\xc6\x13\x03\x5e\x03\x4e\xb7\ +\x35\x51\xcf\x4e\xdc\x70\x3a\xcc\x63\x55\xb9\x6a\xbd\x26\xc8\x14\ +\xc5\xa3\x98\x27\x13\x0d\x56\xdb\xad\xdd\x89\xf5\x71\xb4\xcc\x0a\ +\x17\x4d\xfd\xb1\x4b\x93\x85\x8f\x17\x76\xc7\x76\x5d\xba\x3d\xe0\ +\x97\xd2\xe3\x60\x80\x77\x68\x54\xdb\x9a\x16\x98\x03\x76\xc3\xdb\ +\x15\x0d\xbd\xdb\x64\xd0\x33\xc7\x5f\x10\x11\xd1\x24\x24\x4b\x2e\ +\xf0\x45\x0d\xd8\xaa\x1f\xeb\x34\x5c\x54\x39\x97\x57\x82\x03\x27\ +\xc7\xc5\x68\x0b\xda\xa6\xa1\x26\x74\x01\x46\xcb\x14\x79\xc6\x6a\ +\xf1\x5a\x1d\xd8\xad\x05\x89\xa9\xd6\x09\x11\xe9\xb6\xfd\x8e\xef\ +\x40\x6b\xc1\x7c\x0c\xea\x3c\x2e\xdb\xa1\x21\xd0\x92\x41\x94\xad\ +\x56\x26\x5b\xec\xf0\x2f\x9e\x52\x0c\x1e\x90\xc7\x25\xfe\xc5\x53\ +\xdd\x35\x1d\x47\x84\xd3\xae\x91\x1e\xb5\x2b\xb1\x34\xbe\xe9\x02\ +\xdf\xb1\x70\x7c\xa8\xc8\x3a\x9e\xc9\x73\x68\x3d\xbc\xc8\xca\x16\ +\x13\x77\x46\x55\x43\x5e\x68\x67\xc2\x76\x44\xef\x95\xe2\xd5\xcb\ +\x5f\xe8\xac\xef\xa6\xc4\xdf\x7e\xa0\xb8\xff\x86\xe2\xfb\xb9\x66\ +\x57\x13\xc2\x71\xdb\x26\xdb\x36\xfe\xdf\x6f\x6f\xf5\x76\xb1\x86\ +\x65\x49\x55\xae\x38\xac\x6a\x0f\xbc\x13\xf7\xdc\xc8\x80\xe9\x17\ +\x9f\xb3\xaa\x2a\x3e\x2e\xee\xe9\x4e\x86\x94\x62\xd6\xc8\x9b\x27\ +\xf8\xe8\x80\x7d\xdd\x28\x7a\xe1\xd8\x37\x59\x04\x2d\x36\x06\xc8\ +\xfd\xad\x2b\xa4\x9c\x6b\x52\x0d\xab\x28\x03\xe9\xd5\xe1\x19\x03\ +\x13\x81\x70\x5e\x71\x2d\x13\xbc\x56\x74\xb2\x95\x87\x20\x42\x52\ +\xb5\x53\x6a\x22\xd7\x93\x85\x9a\xa5\xe4\x46\x93\xe7\x71\xb9\xd8\ +\x39\xbe\x4a\x9d\x3c\x2e\xed\x82\xcd\xde\x67\x26\x02\x49\xa0\x5f\ +\x64\x7a\x87\x20\xd2\xbe\xb0\x69\x41\xe2\x4c\x97\x73\x93\x85\x2d\ +\x2b\x4b\xe5\xe1\x99\xd8\xa9\x05\xad\x95\x15\x76\xf2\x8f\x03\xb0\ +\x59\xcc\xe9\x49\x40\xa5\xb3\xd8\x94\x52\x08\x3b\x94\x44\x98\x8a\ +\x5c\x4f\x03\x39\x30\x56\x5c\xd1\xf0\x92\x6d\x89\x7a\x58\xe9\x06\ +\xad\x45\x55\x7b\xc8\x71\x50\xe0\x6f\xfa\xc4\x83\xed\x89\x76\x76\ +\x0b\xbe\x46\x1a\xee\xb0\xf2\xf4\x5a\xcb\xb1\x73\x6a\x5c\x0a\x78\ +\x9b\x49\x7e\xc8\xde\xf1\x2c\x7e\x4c\xc6\x90\xb2\xd4\xef\xe9\x57\ +\x3e\xf1\x62\x8d\x9a\x24\x0c\x97\x25\xeb\x71\x45\xb9\xd0\x7a\xb7\ +\x4e\xc7\x4d\xdd\xa2\x6e\xbc\xd2\x8b\x39\x7f\x92\xa0\xa8\x28\x17\ +\x23\xfc\x49\x41\xb6\x80\xb7\x8b\x35\x89\xb7\xe0\xd9\xaf\x3c\x41\ +\xc4\x7d\x3e\x6e\x34\x03\xaf\x4d\x85\xf3\x84\x55\x0d\x13\xd7\x8d\ +\xa2\x5a\x4e\x00\xdc\x72\xc0\x67\xc1\xc5\xe2\x21\xc1\xf4\x00\xf8\ +\xe4\x65\xff\xbc\x17\x6c\x41\x3c\xdf\x54\x44\xb9\x42\xe6\x25\x22\ +\x54\xd8\xce\xa4\xb2\x55\x46\x8e\xf0\xe5\xf9\x84\x82\x6a\x65\x2a\ +\xda\xc5\x0d\x0d\xe0\xcd\x49\x41\xc2\x5e\xfb\x54\xde\x41\x0a\x41\ +\xa4\x54\xed\x0f\x3b\xc0\x4a\x22\x21\x74\xa9\xb9\x51\xbd\xcb\x02\ +\x9f\x7e\xea\x53\xcc\xaa\xd6\xdf\x64\xab\x68\x9f\x5a\xd0\x35\xdb\ +\x93\xd4\x32\x68\x69\x62\xeb\x50\x0c\x4e\xfe\xbd\xd9\xc9\x6d\xa1\ +\x62\xc7\xc8\x1a\xc8\x3e\x42\x64\xee\xd8\x65\xc3\x40\x81\x97\xb5\ +\x87\xac\x54\x31\x50\xb2\xde\xed\xb5\x5f\x5c\x04\xf4\xb3\x88\x6d\ +\x2c\xc9\x81\x69\xa3\xec\xdc\x04\xb0\x5d\x04\x0e\x2b\x41\xb9\x08\ +\xd8\x0e\xf4\x2a\xc3\xb2\x73\xea\xe4\x46\x8f\x19\x13\x7e\xfa\xf8\ +\x67\x6e\x41\x96\x15\x11\x79\xa6\x18\x32\xe7\x36\x8e\x18\x02\x6f\ +\xa3\x1d\x43\xba\xf8\x93\x02\x1f\x5d\xf2\x1e\x8d\xa6\x4c\x0f\x4b\ +\xfc\xec\x0b\xc6\x23\x8f\xca\xd7\x12\xc1\x5f\xac\x18\x4e\xc6\xdc\ +\x4f\x2a\xfc\xc5\x8a\xf1\x17\x63\xc2\xc5\x92\xbb\xc5\x90\x37\xef\ +\x16\x4c\x33\xd8\xee\x74\xa5\xed\xcb\xa1\x47\xc7\x24\xeb\x9a\x12\ +\xa2\x29\x29\xf2\xec\x3c\x0a\xd2\x49\xe1\xa6\x6d\x08\x30\xc9\xb8\ +\xba\x68\xd2\x64\xe4\x50\x9b\xfd\x15\x03\x7c\x36\xb9\xa0\x13\xe2\ +\x1a\x3a\x05\xc2\xb8\x13\x19\x05\x10\x50\x39\xc6\x16\x26\x5b\x21\ +\x8e\x18\xd9\xea\xd9\x54\x7a\xf4\x3b\x7b\xb2\xc3\x00\xc8\xd9\x02\ +\x81\x54\x10\x9d\xd6\xdb\x4e\x8a\x1f\x8e\x89\x4d\x5a\xcd\x54\xea\ +\x22\x03\xe6\xd6\x7d\x40\x50\xc6\x4e\x4b\xdb\xe6\xd0\xf6\xac\x89\ +\xcc\xfd\x8d\xc7\x9a\xb8\x32\x0b\x33\x08\x8c\x4c\xa8\x5a\x5a\xf8\ +\xf4\x62\xbc\xe6\x62\xe3\x16\x27\xea\xcc\x0e\xa2\x41\xed\x1b\xfb\ +\x6d\x4e\x60\x3e\xaf\xe8\x09\x0d\xe6\xaa\xd6\xc2\xe0\xeb\xad\xd0\ +\x1d\xde\x76\xc1\xb3\xde\xc1\xb0\x17\x01\xca\x01\xbd\xc9\xca\xa0\ +\x47\x02\x9c\xbb\x24\xb1\xa9\xe0\x21\x18\x3f\x7d\x42\xb8\x49\xe9\ +\x4e\x9e\xd1\x05\xa2\x89\x62\xd3\x89\x74\x03\xd0\xea\x8e\x71\xef\ +\x8a\xe5\xee\x9a\x71\xef\x8a\xbb\xc5\x92\xe9\xa4\x60\xfe\xca\x94\ +\xd2\x78\x69\xaa\x6a\x13\x57\xa3\xbb\x5b\x4c\x18\x32\xe7\x8e\x29\ +\x77\x8b\xa5\x71\x78\x34\x83\x87\xbb\x3d\x79\x16\x71\x31\x9e\x50\ +\x4e\x86\x28\x8a\x13\xd9\x69\x01\x6c\x01\xb9\x1b\x97\xb0\x80\x64\ +\xe2\x73\x28\x3e\xf0\x78\xf1\x84\x74\x52\xb0\xae\xec\x20\x2c\xce\ +\x96\xaf\x7d\x52\x5d\xec\x18\x0c\x62\xa7\xe5\x06\xa6\x75\x48\x49\ +\x2d\x27\xea\x92\x70\x44\x61\xb5\x70\x43\x5b\xda\x38\xa6\x38\x93\ +\x03\xf6\x91\x26\xc0\xb1\xa9\xa1\x6a\x16\x91\xcd\x7e\x0c\x3b\x8c\ +\x30\x6a\x15\x94\xdb\xcd\x49\x91\x59\xb0\x49\x03\xee\x08\xd9\xaa\ +\xf4\xcd\x92\x82\xc2\xf6\xcb\xd9\xd6\xfc\xc6\xce\x55\x11\x23\x0c\ +\xd0\x76\xc6\xd7\x3d\x76\x29\x3c\x91\xa1\x96\x7b\x2a\xd1\x6b\x31\ +\xf1\xd6\x46\x34\xe3\xa3\x24\x55\x30\xe0\xb0\xd9\x20\x06\x89\x03\ +\xb6\xb2\xfa\x18\x9c\x57\x8c\x5b\xe4\x95\x2d\x06\x0e\x3c\x3d\x39\ +\x28\x35\x16\x5d\x62\x99\xdc\x56\xf6\x8c\x55\xb7\x46\xdb\x6c\x04\ +\x85\x8b\x74\x5a\x56\x76\x51\xcd\x66\xb0\xde\xb2\x31\x90\xc4\x39\ +\x12\x1d\x74\x0f\xc2\x80\x57\x1f\xfe\x8a\x7e\x57\x10\xee\x04\x79\ +\x76\xad\xa5\x6f\x3e\xe4\x62\x78\xed\x7a\xeb\xc2\x18\xe6\x8b\x88\ +\x3c\x96\x84\x59\x44\x1e\x0b\x53\xc8\x91\x0d\xfa\x92\x6c\x7a\x13\ +\xf2\x9d\x74\x05\x9d\x61\x35\x61\x34\x9a\xea\x46\xd9\x09\xbc\x01\ +\x62\xd6\x08\x1e\xb4\xfe\xed\xad\x30\x90\x92\x2c\xf3\x82\xa9\x17\ +\xba\x8e\x98\x4e\xf0\x19\xe9\xa4\x40\x72\x4f\xd4\x82\xb0\x0d\x18\ +\x0d\x1b\x8b\xbc\xc4\x44\x31\xed\x62\xce\xe8\x5d\xd5\xe8\x81\xb3\ +\xb2\xa0\x38\xb3\x60\xb2\x61\x20\xa1\x6c\x0f\x5e\x0d\x3e\x69\x3d\ +\x61\x36\x8d\xc7\x3e\x7d\xb1\x15\x38\xcb\xa6\x16\xe6\x91\x6d\xbb\ +\x6f\x48\x15\x07\x6f\xc3\xca\x49\x54\x71\x48\x03\x48\x24\xa8\xa8\ +\x9e\x94\x69\x62\x97\x98\xc5\x9b\x05\x74\xaf\x31\xc9\xd2\x02\xd8\ +\xca\x09\x31\xee\x1a\x56\x8e\x1c\x13\x27\x87\x92\x66\x48\x2c\x63\ +\x4f\x6c\xf4\x71\xb0\xd1\x51\xcd\x30\x36\xa0\xb3\x9f\xd3\x00\xad\ +\x6a\xe6\x2b\x44\xc9\x61\x37\x77\xce\xc5\x61\x37\x87\xa8\x24\x69\ +\xac\x13\x6a\x56\xcf\x48\xbd\x92\x40\xfa\xf8\xa2\x44\x1c\x22\x07\ +\xe0\xb5\xa7\x75\xf6\x49\xca\xed\xf8\x90\x4c\x08\xdc\xb3\xb9\x87\ +\x8b\xe1\x9e\x71\x3c\x26\xcf\x14\x0b\x25\x19\x18\xef\xfa\x62\xb8\ +\x67\xdc\xbb\xa2\x8c\x57\xae\x6b\x63\x70\x90\x04\x19\x74\x26\x3d\ +\x14\xa6\x0b\x64\x3a\xf9\xd1\xdf\xd0\xc6\x2f\x2b\xff\xd2\x84\x82\ +\x16\x74\xbd\x91\x2b\xbf\x5b\x09\xe1\xb6\x26\x60\x34\x0e\x77\xbc\ +\x5d\x94\x8e\x8d\xfd\xc9\x82\x74\x31\x21\x99\xcc\x18\x2c\xbe\x85\ +\xe1\x57\xba\x3d\x69\x7b\xa1\x19\xdc\x3a\x1c\x59\xe2\x2c\xb6\xd0\ +\xfa\xbe\x55\x54\x51\xca\xb8\x66\xd7\x48\xb4\x17\x69\xcd\x85\x9f\ +\x54\xf8\x4d\xf7\x41\x6d\x80\x01\xd2\xa6\x39\xc0\xb0\xf0\xce\x59\ +\x74\x41\x43\x38\x14\x48\x02\x3b\x53\xc2\x14\x43\xb6\x41\xe6\xc8\ +\xd7\x8d\x89\x35\xc5\x01\x54\x04\xaa\xd6\xc3\x56\x7f\x46\xa6\xca\ +\xe7\xba\x76\x45\xd5\x72\x20\x9a\x96\x9a\x65\xdf\xe3\xaa\x9d\x6d\ +\x16\xf5\x44\x81\x5a\xee\x9d\x2e\xb2\x4c\x7c\x2a\x26\x72\x0a\x21\ +\x08\x94\xc2\x0b\x29\xf9\xbd\x95\x00\x00\x20\x00\x49\x44\x41\x54\ +\x06\x6c\xf7\x77\x24\x45\x8f\xce\x80\x46\x67\x89\x72\xec\xac\x7d\ +\xe4\x7a\xf8\xa0\x10\x82\xd4\xcb\x48\x2a\xed\x4c\xf8\x55\xc6\x6e\ +\xa7\x0b\x0b\xc1\x46\x5b\xa9\x5f\x4c\x47\x2c\x6d\x2b\x96\xf9\xda\ +\x8a\x95\x2e\x96\xac\x1b\x9e\xf2\x8f\x01\xb8\xd9\xf2\x14\x74\x57\ +\x14\xbd\x09\x4f\xe2\x88\xee\x95\x68\xb5\xf2\xd7\xbf\x6a\xcf\x65\ +\x94\x01\x96\xa3\x89\xbb\xbe\xc8\x22\x4a\x5b\xf2\x68\xb4\x51\x35\ +\x27\x13\x09\xf1\xce\xe8\x7d\xc9\x3a\x8b\x78\x44\x40\x35\xdc\x00\ +\xbd\x96\x23\xe1\xa4\x84\x19\x66\x68\xc7\x66\xf5\x96\x3e\xfe\x64\ +\x41\xb9\x98\xe0\x4f\x16\xc0\x8c\xcd\xe4\x2b\x2e\x4c\x7b\x52\xd9\ +\x2f\xf0\xb7\xfa\xf5\xf6\x3d\xf6\x4a\xe9\xb2\xb3\xed\xc0\x08\xa4\ +\x6c\x31\x5e\x13\xb4\xcd\x7f\x6a\x57\x7a\x0e\xc0\x71\x51\x92\x89\ +\x9c\xb8\xe8\x91\x1d\x36\x2d\x85\xab\x7d\xdb\x1e\x19\xd0\x27\x62\ +\x6b\x80\x6b\x8b\x2b\x4d\x19\xd2\xeb\x47\xf8\x69\x40\x91\xa4\x48\ +\xe9\x1d\x39\x15\x5e\xad\x9e\x8d\x0e\xce\x84\x47\xac\xac\x7f\xbc\ +\xa3\x93\x14\x3a\xb3\xa0\x70\x4c\x6c\x01\xaa\x27\x60\xd6\x32\xa8\ +\xf7\x09\x9f\xd8\x16\x3b\x6c\x76\xc2\x96\xa3\xb7\x45\x87\x04\xad\ +\x7f\xad\x53\xb1\x53\xb9\x63\xe3\x3e\x17\x1a\xc8\xef\x2b\x78\xd4\ +\x6f\x15\x3b\x9a\x3e\xb2\x65\x66\x9f\x0c\x5d\x14\xcc\xb8\x55\x8a\ +\xe2\xed\x82\x0f\xab\x5b\x76\x77\x7b\x3e\x2c\xdf\xf2\x48\xe4\xfc\ +\xd5\x93\x9f\xf0\xd3\xe7\xda\x76\xaa\x06\x53\x3a\x55\xc2\xd5\x64\ +\x4c\xe0\x95\x40\x41\xbe\x92\x70\x26\xe2\xd9\xb4\xdd\xec\xed\xf5\ +\x22\x73\x76\x1f\x71\xa9\x3b\xb0\x33\x93\xcb\xcb\xd2\xd3\xd7\x34\ +\x0f\xdd\x71\x42\x9a\xa5\x5a\x5f\x37\x82\x44\xee\x08\x9a\x09\xfa\ +\x2c\x59\x2e\x20\x98\xe0\xbc\xe4\x92\x7b\x32\x86\x8c\x58\x81\xf2\ +\x4d\xa1\x83\xf6\xe2\x4e\x49\xba\x22\x22\xdc\xdc\x36\xdc\xa9\x19\ +\xcb\xe2\x9a\x31\x57\xa4\x8b\x92\xab\xa9\xfe\x4b\x9a\x4c\xdc\xf2\ +\x8a\x15\xba\xec\x8c\x49\xa4\x45\xd1\x84\x54\xea\x6a\x91\x30\x76\ +\x1a\x26\x81\x56\x18\xe0\xb9\xd2\x85\x19\xc8\x9d\xf5\xe3\xfa\xe7\ +\x92\xbe\x2b\x2b\x47\x91\x60\x7b\x34\x1c\xb0\xa9\x77\xb7\x48\x44\ +\x14\xd5\x95\x3f\x24\x24\x11\x30\xa5\x44\x11\xa4\x1e\x45\x52\x3a\ +\x2d\x8c\x8a\x9c\x6b\x81\x52\xc4\xf4\x88\x84\x44\xa8\x8c\x83\x9e\ +\xd3\xd3\xea\xa1\xeb\x89\xc8\x01\xd3\x5e\xb7\xba\xb8\x82\x93\xf6\ +\x24\x77\x5b\x05\x48\xea\x8a\x5d\x4e\x45\x1f\xc1\x76\x0f\xc9\x26\ +\x85\x60\xe0\xd8\xb8\xe9\x1b\x57\xfe\x0c\xaf\xeb\xa1\x96\x8a\x24\ +\x38\xb8\xb2\xb4\x17\x0c\x34\xd0\xb7\xd7\x6c\xc3\x09\x87\x4d\xca\ +\xdb\xbb\x0f\x6c\xb2\x15\x3f\x7c\xfb\xbd\xfe\x61\xa3\x4b\xd4\xf5\ +\x3b\xae\xf7\x1a\xe4\x7f\x79\xb7\x81\x3f\xff\xd7\xfc\xcb\x8b\x01\ +\x5f\x3e\xec\x90\x2d\x0b\xe2\x71\xc0\xdf\xfb\xfa\x37\x99\x3d\x0b\ +\x18\x8b\x3e\xb3\xcf\x1e\x30\x59\xc3\x75\x67\x8f\x98\x07\x84\x93\ +\x91\x2e\x96\x78\x05\x1e\xc9\x09\x30\x3d\xb5\x23\x4e\xba\x75\x07\ +\x36\xb0\x5e\x64\xc4\x41\x41\xb6\x08\x18\xf6\xba\x8d\xce\x6b\xbd\ +\x28\x94\xd9\x0c\x50\x8e\x6d\x93\x38\x41\x70\x8f\x6a\x4d\xe0\x94\ +\x2c\xb2\x31\xdb\xf8\x9a\x07\xf1\xd8\xb1\xeb\x7a\xb7\xe7\x89\xd7\ +\x83\x46\x50\xc8\x02\xf8\xb8\xd8\x91\x0f\xea\xeb\xe9\xc2\xca\xc9\ +\x7b\x60\xc2\x87\x6a\xc1\x8c\x19\x61\xb7\x51\x59\xb5\xd5\xbe\x6c\ +\x4d\x57\x24\x86\x89\x5b\xae\x6d\xbb\x4d\xc8\xea\x61\xcb\xa0\x96\ +\x4f\x14\x15\x42\x49\x5d\xc9\x33\x00\xb7\x56\x17\x46\x0a\xb8\x09\ +\xf2\x26\xff\x10\x48\x0f\x19\xd1\x7a\x3f\x5b\x1c\xd1\x96\x9a\xfe\ +\x1b\x92\x08\x48\xeb\x50\x7b\xa4\x1a\xf6\x9c\x93\x17\x0a\x44\x84\ +\x42\xb5\x7a\x1a\x6c\x5e\xa2\x6d\xff\x65\x8d\x83\xe5\xa9\x57\xdc\ +\x6a\x4f\x32\x5e\xf1\x71\xe9\x19\xd0\x63\x5f\x8b\x3b\x44\x3c\x3d\ +\x11\x18\x91\xc8\x08\xd1\xab\xfd\x3c\xee\x12\x66\xba\x2c\x1d\x6c\ +\x36\x04\x1b\xf8\xb6\x90\xdc\xbe\x7b\xc5\xab\x77\x19\xea\xfa\x1d\ +\x37\xcb\x37\xf5\x0e\x14\x6b\x6a\x98\x45\x4f\xb9\x97\x6f\x78\xf6\ +\xf4\xa7\x74\x0b\x0d\xea\xef\x6e\x0f\xa4\x77\x1b\x7e\x7a\x7b\xe0\ +\x7f\xf8\x8b\xff\x91\x17\xcf\x03\xa2\xc7\xff\x21\xff\xf1\x3f\xe8\ +\xf1\x60\xf4\x1f\x10\xcb\x15\x74\x21\xcf\xbb\xf8\x1d\x89\x57\x3d\ +\x04\x8e\x3a\xad\x9b\x15\x3c\x7a\x48\x46\x94\xdc\x33\xec\x75\xf5\ +\x00\xed\xd0\xce\x10\x6e\x57\xd1\xce\x8d\x67\x55\xce\x8d\xa9\x07\ +\xaf\x44\xb1\x62\x9f\x17\x7a\x04\x80\x29\xf5\xf7\xb3\xa8\x36\x33\ +\x1a\x91\xd4\x93\xe9\x9a\x4a\x4f\x1e\x7a\x6b\x6f\x4f\x16\x70\x87\ +\x93\x14\x0f\x17\x0b\x18\xce\xc8\xf7\x99\x03\xb2\x93\x23\xb6\x83\ +\xc5\xdf\xb7\x3d\xe4\x61\xe9\xb1\x95\xd2\x68\x52\xa9\x01\x28\x3d\ +\x8a\xc8\x00\xcf\x68\xe1\x75\x2a\x11\x89\x06\xa6\x02\x02\x93\x58\ +\x3b\x8e\xa7\xdb\x02\x48\xab\xf3\xf6\x9c\xa9\xd6\xd0\x9e\xa9\xf4\ +\xf0\xcd\x02\x4f\x2f\xec\xa4\x0b\xfc\x38\x6b\xad\xe1\x11\x97\xd5\ +\x16\x21\xa6\x28\x2a\x76\x66\xae\x84\x05\x72\xd3\x99\x50\x67\x5c\ +\x89\xe3\xdc\xc4\xb1\xfd\x66\xc3\xf1\x22\xee\x12\x66\x3e\xdb\x3d\ +\xa8\xe5\xbe\x55\x82\x6e\xca\x06\xab\x50\x42\x33\x88\xe5\xa6\x08\ +\xd8\xbc\xbb\x65\x79\x77\xcd\xdf\xbc\xc9\x1d\x38\x89\x1f\xb3\xca\ +\xbf\xe6\x8b\x81\xa2\x5b\xbc\x63\x1f\x3c\x6e\x01\x79\x16\x3d\x65\ +\x16\xa1\x1f\x7b\xfa\x53\xb6\xa6\xdf\xf7\x46\xbe\x81\xd7\x6f\xf8\ +\xfd\x6b\x9f\xaf\x2e\xbf\xe3\xf1\xd3\xdf\xe2\xcb\x9f\x8c\x08\x46\ +\xa5\x8e\x86\xae\x37\x8e\x4d\x5d\x51\x84\x7a\x0e\x73\x9a\xa5\x10\ +\xef\x48\x48\x4c\x6b\x93\x32\x91\xcd\x5e\xeb\x76\x42\xaf\x9e\x7b\ +\xd1\x92\x18\x5a\x4e\x94\x8b\x40\xa7\xe1\x0c\x4b\x87\x8d\xcc\xf3\ +\x49\x37\x89\x25\x9e\x13\x97\xc1\xa7\x14\x11\xdb\xc5\xc7\xd3\xcf\ +\x31\xda\xf8\x76\x82\xd3\xc4\xc7\xaf\xb7\x3a\x3b\x29\xbb\xa6\x65\ +\xdf\xf8\xba\xbe\x99\xe0\x6e\x17\x5c\x76\x3b\xd8\x56\x64\x81\x02\ +\x15\xa2\xa8\x78\x38\x6b\x03\xd1\x2d\xd4\x8e\xfc\x5f\xdf\xee\x08\ +\x8d\x12\x36\x47\xbd\x19\xc7\xd5\xbb\x56\xde\xd8\x31\xaf\x74\xa7\ +\x3a\x88\xec\x8e\x61\xc6\xf5\x1f\xbc\x7e\x63\x9a\x4e\xfb\x3c\x1e\ +\x9f\xb2\xd4\xf2\xa3\x56\xa5\x66\xc3\xa8\x75\x2b\x8e\x2b\x76\xeb\ +\xd8\xc7\xf7\x0b\x50\x92\x30\xbb\x38\xb1\xdc\x74\x9c\x32\xa5\xa8\ +\x12\x96\x4a\xb2\x58\x2c\xb9\xfb\xdb\x1f\x78\x69\xe6\x32\xdc\xef\ +\xeb\xe7\xcf\xa2\xa7\x20\x7f\x01\x3c\xe5\xe3\xc3\xe7\x3c\x0d\xcc\ +\x21\xfe\x16\xc2\x27\x2f\xe0\x5e\xdf\xde\x07\x8f\x99\x8f\x5e\x33\ +\x5d\x3d\x77\xe0\xee\x16\xba\x7f\xed\xdb\x1b\x8f\xf7\xea\xcf\xa8\ +\xe6\x13\x2e\xfe\xee\xd7\x8c\x45\x9f\xac\x0f\x76\xc4\xc4\xc4\x00\ +\x2b\xcf\x22\xbc\xfd\x12\x46\x38\x6d\x2b\x19\x99\xd6\x26\xad\x89\ +\xed\x10\x40\xdb\xea\x94\x92\xb7\xe4\x45\x13\xc0\x76\xa4\xc0\xc9\ +\xbf\x3d\x53\x10\xf7\x74\xff\xdf\xe4\x9e\xa6\xa5\xd3\x94\x0f\xee\ +\xfa\x27\x4e\xa1\xd0\x09\x3e\x63\x77\xf7\x81\xf1\x85\x4f\xba\x98\ +\xe8\xcc\xd0\x51\x83\x41\xf3\xfd\x5a\x4c\xec\x37\x42\xf1\x27\x8b\ +\xdc\xc0\x2e\xe5\x36\x08\x11\x35\x3a\x99\x55\x6d\x7c\x35\x1a\x33\ +\xa3\x33\xe0\x94\xb4\xa5\x84\x3c\x03\xe6\xd6\xb4\x9f\x93\xce\x46\ +\xe3\x25\xab\xfa\xb1\x43\x1a\xd0\x49\x0a\x0a\x0b\x76\x3b\x40\x45\ +\x54\x27\x65\x71\x61\x58\x53\xcf\x24\x6e\x3b\x17\x1a\xac\x09\x1b\ +\xbf\x6a\x8d\xb6\x02\x58\xc7\x3e\x9e\xaa\x88\x45\x0e\x22\x22\x38\ +\x94\xdc\xed\xef\xb9\x60\x76\x02\xe4\x55\xe5\x91\x2f\x17\xbc\x7e\ +\xbb\xe0\xf5\x9f\xfd\x6b\xae\xf7\x25\xe9\xdd\x86\xe4\x62\xd0\x06\ +\x30\xf0\xe2\xab\x7f\x00\xc0\x4f\x2e\x66\xfc\x5f\x87\x11\x7f\xbf\ +\xb3\x82\xce\xbd\xae\x52\x3d\x86\x37\xea\x9a\xd1\x7d\xce\x74\xf5\ +\xfc\x84\xa5\x01\xc6\x83\x1b\xb2\x65\xc1\x1f\x2e\xef\x78\x51\x24\ +\x3c\xfb\xf2\x09\x97\xcf\xd7\x04\xa3\xaf\x48\xb3\x1d\xfd\x2a\x6a\ +\x05\xfe\xf3\x5c\x92\x66\x11\xc4\x21\x65\x76\xcf\xf5\x62\x4f\x1c\ +\x14\x84\x59\xc4\x7a\xb7\xa7\x9f\x45\xa6\x62\xa7\xc1\x3a\x1a\x5e\ +\x1c\xfd\x00\xf7\x46\x72\xd4\xd2\xc3\x4e\x0f\xb2\x2d\x4b\x13\x11\ +\x51\x66\xf7\x67\x17\x89\x9f\xac\xd8\x0d\xda\x32\xe6\x50\x7c\xa0\ +\x77\xd1\x65\x79\x77\x4d\xef\xa2\x0b\xcc\x4c\x05\xf4\x47\xca\xce\ +\x0e\x58\x52\x1d\x85\x79\x2a\xa4\xe9\x4c\xde\x22\xf5\x4c\x09\x67\ +\x87\xe1\xba\x3b\xdc\x20\x6d\x75\xe4\x2a\x9c\x01\x63\xd0\x90\x26\ +\x67\x2b\x75\xe7\xcb\x5e\x8d\xec\x84\x6a\x06\x3c\x5a\xfa\x8c\x46\ +\x07\xc7\xb9\x2a\xa2\x6a\x1c\xfe\x43\x51\x11\x9a\x53\x1f\xb8\x8a\ +\x9d\xef\x52\xbf\x8e\x89\x0b\x91\xd2\x27\x66\x2b\xb4\x0f\xac\x94\ +\xa4\x1f\x0c\x10\x9d\x94\x2d\x29\xa2\x39\x1d\x49\x49\x3e\x2e\x56\ +\xfc\xe2\xdf\x7c\xcf\xcb\xd7\x6f\x48\xef\x74\x2e\x20\xb9\x18\x38\ +\x20\xcf\xa2\xa7\x0c\x1f\xc2\xd7\xbf\xf6\x05\x9f\x5d\x3d\xa5\x5c\ +\xf7\x99\x87\x1e\xff\x19\x70\xb3\xdc\x33\x9e\xe9\x21\x21\xcb\xbf\ +\x79\xcb\x53\x71\x05\x8f\x61\xfd\xae\xd6\xcf\x57\x5d\x9f\x3d\x70\ +\x2f\xdf\x00\x4f\xe9\xa2\x59\xf9\xe5\xab\xd7\x04\xea\x15\xd9\xe1\ +\xef\xf1\xc5\x57\xdf\xe2\x75\x9e\x52\x25\x29\xc5\xca\x07\xfa\x6c\ +\xf7\x8a\xe7\xbe\xaf\xa7\xc5\x65\x39\xf9\x62\x45\x8e\x07\x03\xed\ +\x3b\x8d\x7b\x57\x44\x13\x75\x04\xd6\xf3\xce\x73\x21\xba\x04\x6a\ +\x6f\x8a\x32\x5e\xab\x42\xb8\x57\xaa\x76\x30\x1a\x71\xcd\xba\xf1\ +\x34\x69\x6d\x8b\xde\x15\xe1\xe6\x07\x0e\xc5\x07\xc3\xc0\xba\x5c\ +\x5d\x2e\x26\x74\x02\x78\xb8\xf8\x1e\x86\x33\x42\x7f\xeb\x7e\xcd\ +\xe3\x1d\x22\xe9\x77\x08\x0f\x44\x7a\xa2\x62\x54\xb9\xe8\x65\xad\ +\x65\x95\x03\x30\x91\x3e\xac\x67\x87\x2e\x7e\x60\x60\x7a\x34\x57\ +\xa2\x06\xb0\x6c\xed\x00\x7d\xfb\x63\x2b\xb3\xc3\x44\xc7\x13\x7e\ +\x9a\x4c\xac\x1f\xf1\xb6\x15\xbd\x7e\xa4\xb3\xc2\xa2\x6a\xa5\xd6\ +\x38\x3e\xa5\x55\xe3\xf4\x60\x34\x4f\x0b\x66\xde\x51\x1c\x55\x1a\ +\x43\xe5\x9d\x48\x8a\xe6\xc2\x4e\x29\xdd\x67\x97\x31\x44\xa9\x0d\ +\x7d\x11\xbb\xbe\xba\x9c\xd2\x81\x77\x6b\x5e\x9b\x2f\x7d\x16\x8b\ +\x0d\xdf\xfd\xe5\x1f\xf3\xd2\x2c\xc6\x2c\xfb\x5a\x30\x03\x46\x0a\ +\x3c\x06\x15\xf0\xf9\x64\x4c\x32\xd1\xc5\x85\x70\x55\x71\xff\xc5\ +\x0b\xf2\xfb\x35\x9b\xfb\x3b\xe6\xbf\x35\x63\xf9\xdd\x5b\x6e\xee\ +\xee\x19\x3e\x7e\x0a\x87\x37\xac\x6f\x71\xda\xf9\xaa\xeb\x73\xdd\ +\x90\x17\xfb\xe0\x31\xdf\xde\xbc\xe3\x2b\xfe\x94\xb9\xf7\x35\xd3\ +\x2f\xa1\x58\xfd\xc4\xc8\x81\x85\x9e\xb8\xee\x5f\x81\xc9\xe3\x86\ +\x93\x11\xd3\x46\x77\x74\x84\x72\x5d\xd2\x1a\xc0\xe9\x19\x20\x9b\ +\xd0\x8e\xb2\xc3\x0c\xdb\xcf\x49\x33\x5c\x72\x2e\xcf\x25\x8c\xdb\ +\x3a\xb6\x14\x91\x2b\x70\xd8\xad\x67\xe6\xd8\x5d\x97\x57\x3c\x0b\ +\x4a\x7a\x17\x5d\x76\x77\x7b\xc7\xc6\x37\x8b\x2f\xe8\x15\x77\x84\ +\xe5\xdf\x39\x49\xc1\x95\xa6\x33\x3b\xdd\x1e\x08\x3b\x48\x94\xf4\ +\x10\x78\xad\xc6\xce\x52\x7a\xe6\xd4\x5e\x9e\x69\xee\xd4\x95\x39\ +\xa1\xb4\x1f\xdc\xca\x50\x28\xe9\x5c\x09\xfd\xe3\x5a\x45\xa4\x41\ +\x1b\xa4\x3e\x71\xb5\x25\x13\xa7\x5a\xda\xce\x21\xb6\x47\x02\x89\ +\x47\x5c\x94\xb0\x3e\xe8\x25\x42\x3f\x6e\x2f\x10\x8e\x00\x2c\xa8\ +\x58\xd8\x40\x90\xd2\x3e\xb7\x70\x61\x9c\xc8\x01\x59\x1d\xb1\xf2\ +\x49\x2a\xaa\x31\x3c\x51\x88\xc8\x01\xd4\xc7\xd3\x41\xa0\x32\x21\ +\xa7\x64\x4b\x46\x9f\xd8\x9d\x16\x01\xe0\xe3\xe2\x3d\x2f\x7f\x71\ +\x7d\x16\xc0\xcb\x71\xc4\x78\xa9\xbf\x99\xeb\x7d\xc9\x0b\xe0\x90\ +\xbd\xe3\xcf\xfe\x48\x31\x1e\x8f\x78\xfe\xec\x21\xa3\x2f\x86\x8c\ +\x83\x29\xab\xc9\x03\x1e\x3d\x19\x72\x2b\x61\x91\x57\xa8\x59\x84\ +\xb8\x97\xdc\xdc\xc1\xd0\xb0\xf2\xf7\x1b\xc1\x28\xd4\x32\x46\x33\ +\x32\x5c\x75\x35\x23\xa7\x1f\x0a\xbe\x15\x07\xbe\xe2\x9e\xe9\x97\ +\x7f\xcb\x65\xfc\x33\xe6\x0b\x7d\x3a\xad\xfd\x62\x0d\x93\xc4\x65\ +\x90\xdb\xe7\xc0\x4b\x1b\xdf\x48\xda\x62\xde\x20\x0b\x28\xe2\xa2\ +\x35\x1a\xa0\x5c\x28\xfc\x09\x24\x71\x0d\xe4\xa4\xe1\x82\x4d\xfc\ +\xe2\x6c\x89\xb9\x05\xe4\x26\xa3\x1e\xde\x40\xe7\xb1\x63\x62\xc0\ +\x5c\xff\xc0\x20\xb8\x3a\xab\x89\xf5\x18\x81\xa4\x0e\x00\x75\xa2\ +\xca\x00\x19\x57\x72\xb6\x00\x2d\x4c\x76\x42\x33\x99\x86\x42\x3e\ +\x3f\xd0\x79\x6c\xaa\x70\x91\x30\x2c\xae\x4b\xcd\xbe\xd7\x67\xeb\ +\x7b\xa6\x25\xc9\x27\x8a\xa4\xb9\xad\xa5\x88\x46\x79\xe6\xb4\xb6\ +\x34\xef\x19\x45\xc2\x74\x2d\xeb\x56\x26\x26\x3d\x77\x68\xaf\x27\ +\xbf\xab\x23\xde\xd6\x72\xa2\xc9\xd2\x75\x7b\xbe\x0d\xc4\x47\x2e\ +\x5d\x86\x19\x46\x2d\x84\x40\x2d\x7d\x42\x3b\xab\xd8\x9c\x98\xd1\ +\x2e\xf2\xb6\xa4\x84\xca\xa3\x14\x03\x60\xa3\x47\xbf\xa2\x25\x46\ +\x5f\xc4\x6c\xc9\x88\x22\xc1\x66\xe1\xf1\xf1\xfa\x9a\x6f\xfe\xcf\ +\x6b\xfa\xd7\xdf\x90\xe6\x9d\x16\xfb\xf6\xe3\x35\x49\x38\x68\xc1\ +\xc2\x97\x37\xec\xee\x9e\xc0\xc5\x3d\x72\x79\x4f\x59\x6d\xc9\x8a\ +\xc7\xbc\xb8\x0a\x18\xc7\x43\xf0\x21\x61\xc0\x8b\x9f\x7c\xc9\x57\ +\x8b\x19\x1f\x9e\x7b\xf0\xe7\xdf\x38\x56\xfe\xe2\x9d\x96\x12\x16\ +\xc0\x76\xe7\xd0\x54\x1f\xc2\xab\xd7\x04\x4a\xff\xdb\xfb\xbf\x91\ +\x52\x15\x1b\x92\xac\x42\x7d\xf6\xd0\x2d\xec\xdc\x62\xce\x6c\xb5\ +\x17\xbc\x6b\xf9\xc8\x3e\x82\x92\x94\xf5\x4e\xc2\xae\x4e\x9b\x85\ +\xb1\x84\x18\x86\xb4\x4f\xcf\x65\x99\x78\xb9\xbb\x26\xcf\x46\x8c\ +\x9b\x55\x6a\x53\x72\xf7\x4d\xb1\x4a\x6f\x7d\xf6\x96\x5a\x3a\x4f\ +\x39\x14\xd7\x9f\xd4\xbc\xd6\x62\xb3\x16\x5d\xb3\x62\xe7\xe6\x13\ +\x07\x44\x04\x0d\xae\x2a\x90\x46\xdc\x7a\x04\xd2\xd3\x16\x9a\x05\ +\xb8\xd2\xad\x45\xba\x65\xa9\x69\x9b\x29\x67\x79\xc5\x05\x64\x87\ +\x1d\x1c\xc0\x2b\x7a\x70\x50\xd0\xe9\x21\x03\x45\x54\x98\x25\xd6\ +\x61\x07\x41\xd4\x0a\xd2\x17\xcd\x6e\x65\xdb\xd1\xa1\x38\x93\x38\ +\x6e\x6b\x60\x94\x57\x57\xf7\x8e\xc0\x5b\x7f\x91\xb2\x5e\x8c\x58\ +\x50\x5b\xcf\x58\xc4\xad\xa1\x2a\xa1\xb2\xb2\x6a\x4d\x6c\x40\xdb\ +\xa7\x5e\xec\xf5\x89\xd9\xca\x8c\xc5\x62\xc5\xcb\x5f\x5c\xf3\xc3\ +\x9b\x9f\xb3\xd8\x45\x4c\x7a\xa7\x95\xaf\x77\x79\xce\xe3\xc6\xc2\ +\xee\xbb\xdb\x03\xf0\x96\xcf\xcc\x90\xbc\x1f\xee\xde\xf2\xc3\x77\ +\x6f\xf9\xf0\xe5\x13\xaa\xbe\xc7\x2c\x18\x31\x0a\xfa\x84\x93\x11\ +\xb3\x27\x0f\x39\xa4\x7d\x5e\xfc\xe6\x13\xf8\x33\xb8\xb9\xbb\x67\ +\x35\x0b\xc9\xdf\xbe\x3c\xf9\x9c\xab\xae\xcf\xf5\xbe\xe4\xaa\xeb\ +\xf3\xed\x8d\x07\xfc\x82\xdd\xf8\x92\x8b\xb0\xa0\x1a\x4c\x1d\xd0\ +\x5c\x07\x88\xa9\xc6\xd5\xee\x44\x7d\x6e\xbd\x3c\x53\xe4\xf1\x9e\ +\x4e\x4f\x30\x31\x7e\x72\x39\xb1\x33\x2f\xbc\x06\x7b\x9f\xd7\xce\ +\x3a\x59\xd7\x37\x5d\x21\x01\x9d\x66\x17\x58\x63\x36\x47\xb7\xc1\ +\xc4\x9d\xf8\x31\x87\xe2\x43\xcb\xa5\x38\x14\x1f\xd8\x14\x77\xc0\ +\x17\xad\x79\x1e\x2d\xbf\xd9\x16\x3b\x22\x24\xdb\x48\x77\x70\x54\ +\x64\x6e\xe1\x25\x51\x26\xf7\x50\x03\xa6\x14\x1d\xc8\x34\x7f\xb6\ +\x22\x21\x91\xd0\x0c\xbb\x3e\xc0\xb0\x43\x2c\x4d\x3a\x3f\x2b\x08\ +\xed\xa9\x36\x94\x47\x66\x7c\xc4\xb8\xd3\xa3\x3a\xd3\x09\x22\xcf\ +\x74\x88\xd4\x8b\xba\xe8\x14\xcc\x06\xb8\x91\xad\xd8\x99\x57\x58\ +\xfc\x0a\x4e\xf3\x1f\xe2\x68\xa9\x7b\x5c\xbd\x2b\x44\x4a\xa0\xb4\ +\x36\x54\x4a\x12\xe2\xe9\x69\xa0\xa2\xd6\xc2\x1b\xe5\xb1\xbe\x97\ +\xbc\x7c\xfd\x86\xc5\x4e\x1f\x8a\x6f\x97\xb7\x94\xf2\x23\x7e\xf4\ +\xc0\x6d\xbf\x78\xf4\x81\x2a\x7c\xec\x18\x3a\xb9\x18\xf0\xdd\xed\ +\x81\x6c\xf9\x9a\x78\x5c\xdb\x50\xd7\x3f\xcf\xf9\xfc\x71\xcc\x9b\ +\xbb\x37\x8c\x2f\xae\x18\xce\x03\xbe\x79\xf5\x57\xae\xcb\x66\xd0\ +\xdf\x73\x73\x47\xcb\xa9\x68\x5e\x2c\x1b\x37\x81\x5c\x7c\xf3\x06\ +\xef\xc1\x67\xf4\x1e\xed\x18\x35\x2c\xb3\x34\x83\x3c\xbf\xd3\x43\ +\x5c\x76\x4b\x13\x62\x12\x80\xae\xde\xd1\xeb\xba\x41\x29\x7a\x4c\ +\x86\x76\x1c\x44\x7c\xcf\x21\x0b\x28\x9c\x8c\x48\x5d\x37\x89\x1e\ +\x68\x98\xd6\xbe\xb1\x59\xd8\x75\x6c\xf3\xa4\xcd\x93\xd8\x3c\xb5\ +\x6a\x30\xf1\x99\x8b\x05\xf4\x3e\x9b\xd6\x7e\xbc\x8a\x8f\xa4\xc8\ +\xbd\x2e\x3b\x07\x52\xb3\x58\xd0\x58\x5a\x35\xe3\x92\x4d\xc6\x45\ +\xe9\x54\xdb\x7e\xda\x21\x57\xba\xdf\xcd\x49\x04\x57\xb1\x2b\xf5\ +\xe4\x16\x33\xf8\x62\xb8\x3e\x40\xa7\x47\xd5\x8f\x89\xb7\x86\x81\ +\x2d\x78\xb6\x19\x55\xdf\x33\x59\x63\xcf\x2d\x0e\xcf\xf9\xc7\x38\ +\xcd\x6b\xd8\x3f\xf5\xdb\xc5\x12\xd1\x38\xf5\x97\x09\x17\xc5\x8b\ +\x1d\xea\x51\xd7\xc5\x4a\xad\x25\x77\x3e\xfc\xab\x35\x7f\x61\xea\ +\xfc\x96\x91\x9b\x0b\x40\x3b\xe2\x2a\xc7\x63\x7b\x7d\xcd\x87\xf7\ +\xd7\xbc\x7d\x27\x99\xf4\x72\x07\x64\x3f\x7a\xc0\xf5\xf5\x47\x36\ +\xea\x8a\xe7\xd1\x8e\x6f\xe5\x1b\x1e\x4d\x15\xf1\x44\x90\x5c\x3c\ +\x76\x52\xe3\x26\x5e\x53\xed\x1f\xd7\x8b\xb3\x0d\xfc\xf5\xf5\x2f\ +\xf4\x0e\xbe\x7c\x4b\x19\x5d\x72\xd5\x0b\x29\x67\x0f\x88\xbc\x15\ +\xb2\x1a\x11\x5e\x48\x9e\x7f\xff\x96\x25\x97\xe7\xbd\x83\xbb\x0d\ +\x3f\x0d\x0f\xbc\x1e\x4f\xb9\xea\xfa\x7c\x58\xbe\x25\x50\xaf\x78\ +\x11\x7f\x8d\xba\x1c\x73\x55\x14\xbc\x3b\xe4\x2c\x97\x7b\x67\xbd\ +\x0d\x07\x3d\xc2\x49\xd4\xee\xd7\xcb\x72\xa7\x83\x13\xe7\x03\x07\ +\x1c\x8e\x9c\x8a\x66\x55\x70\x8d\x9e\xc8\x39\x5f\xac\xc9\x83\xc2\ +\x2d\xec\x4e\x98\xd8\xc4\x4c\x5b\x4c\xfc\x23\x72\xa2\x1b\xcf\xeb\ +\x1c\xb7\x28\xcd\xe0\x43\x9b\xc7\x30\x51\x4c\x94\xc4\x13\x15\x92\ +\x18\xdb\xbe\x7f\x30\x4c\x17\x34\x2c\x14\x1b\xc7\x3c\x18\x98\xf5\ +\x85\x0e\xe4\xb4\xea\x5e\x07\x74\xf4\xb2\xd3\x00\xb6\xd5\xb6\x96\ +\x43\x27\x13\x5d\x44\x31\xe0\x97\xd2\xa3\x1f\x09\x88\x6c\x20\x3c\ +\x6a\x49\x85\x48\x19\x77\xa2\xb5\xb0\x93\x14\x89\x66\xd9\xa2\xd1\ +\x0e\xef\x6d\xeb\x10\xfc\xa4\x1f\x71\x28\x63\xca\xed\x96\x83\xa7\ +\xc1\xbb\xf5\x33\xfa\x69\x4c\xc7\x10\x71\x2e\x2a\xba\x4a\x39\xb6\ +\x6b\x9e\x1e\xcc\x56\xe2\xb4\xb4\xd0\x05\x92\x91\x57\x91\x4a\x9f\ +\x74\xb1\xe3\xcd\x56\xb2\xbe\xc5\x49\x88\x49\x2f\x87\xde\x43\x16\ +\xbb\x90\xab\x2b\xa8\xf6\x1b\xe6\xf7\x5b\xa6\xab\x29\xef\xf9\x88\ +\x2f\x1f\xf0\x70\x5c\x3b\x15\x6f\x16\x53\x9e\xf2\x8e\xbf\xcc\x73\ +\x1e\x87\x21\x3a\x81\x6b\xa4\xc1\x12\xf6\x1b\xf0\x07\x6f\x29\x77\ +\x39\xbe\xbc\x71\x39\x8b\x57\xfe\x8e\xe9\x27\xd8\x2b\xb9\x18\xf0\ +\xf3\xbb\x0d\x09\x70\xb3\x7c\xc3\x25\x4f\x79\x3f\x0e\x79\x01\xc4\ +\xdb\x15\xeb\x87\x0f\x61\x1e\x33\x1e\x6b\x54\x0d\x7b\xdd\xd3\x00\ +\x90\xb9\x6e\xa5\xc7\xf5\x42\x03\xfe\xb0\xf9\x08\x9b\x0a\x6f\x3c\ +\x64\xca\xd0\x2c\xe4\x12\x88\x77\xad\xd7\x8f\x99\x50\xb2\x3d\x62\ +\xe2\x8c\x7a\x68\x46\xdc\x8a\x6f\xde\x2d\xbf\x39\x2b\x27\x5c\x46\ +\x32\xb8\x38\x91\x21\x7a\xca\xbd\x19\x8a\x68\x27\xc5\x57\x06\xc0\ +\x56\xdf\x76\x8c\xab\x60\x59\xb6\x38\x1a\xb4\x6d\x17\x73\xba\x63\ +\xb9\xa7\x81\x2b\x22\xa2\x89\x7e\x97\x4d\xdf\xa3\xea\xc7\x8d\x22\ +\x89\x65\xdd\xd8\x2d\xe2\xaa\x7e\xec\x1a\x46\x6d\x17\xf3\xf1\x28\ +\x69\xd9\x3c\x81\x62\xc3\x33\xa6\x51\xec\xa8\xdf\xbf\x7e\xde\xcc\ +\x9c\x07\xad\x93\x14\xf8\x9e\x1d\xac\xa2\x8f\x1a\x4d\x26\x0e\x95\ +\x47\x89\x71\x30\x84\xce\x22\xe7\xa2\x72\x6c\x0c\xf5\xf4\xcc\x50\ +\x79\xa4\xd2\xd7\x67\x7f\x52\x7b\xf2\xeb\x65\xeb\x90\xbe\x10\x6b\ +\xed\x4a\x8c\xe6\x3c\x1c\x3f\xe4\xf9\xe8\x4b\xae\xae\x1e\x70\x3f\ +\xdd\x73\x58\x4d\x9d\xdc\xb0\x8c\x3d\xe9\xe5\x6c\xb3\x21\xe3\xa5\ +\x24\xbd\xdb\xf0\x2e\xcf\xf1\xb2\x77\x4e\x12\x74\x8b\x77\x7c\xef\ +\xef\x50\xd7\xef\xf8\xee\xf6\xc0\x72\x73\xc9\xcb\xd7\x6f\xa8\x6e\ +\xfc\x13\x29\x61\x59\xd8\xca\x95\xf4\x6e\xc3\x36\x1b\x72\xbd\x2f\ +\xc9\xff\xf6\x03\xdf\xbe\x3e\xb0\x54\x5b\x86\x1b\x7d\x62\x9d\xe1\ +\x24\x76\x00\xb6\x13\x36\xc9\x72\xd6\x8b\x8c\xf5\x6e\xc9\x7a\xb7\ +\x67\xbd\xdb\xb3\xc0\x67\xd8\xeb\x52\xf4\x04\x9d\xc1\x03\x3a\x8f\ +\x1e\x32\x9d\x0c\x0d\x6b\x1b\x2b\x2e\xcb\x5b\x91\xd0\x6d\xac\x65\ +\x8b\x8e\x61\x6a\x26\x3e\x2e\xd1\x5b\x39\x71\xd8\xdd\xe0\x4d\xf3\ +\x96\x7c\xb8\xde\xb5\xd7\x15\x5a\x13\x5b\x77\xca\x9e\x8b\xa5\x30\ +\x80\x16\x5a\x13\x7b\xe6\x84\x2c\xf6\x47\xde\x34\xaa\x6a\x59\xe0\ +\x9b\xfb\xda\x05\x85\x8e\xed\xac\x88\x74\xf0\xbc\xe5\xf3\x46\xda\ +\x23\x26\xaa\xbd\xe7\x28\xaa\xb4\x53\x71\xb6\x25\xa9\x2e\x26\xe3\ +\x3a\x38\x4c\x00\x47\x79\xad\xb3\x82\xfe\xd8\xa5\xd7\x8f\x38\xa4\ +\x81\x3e\x59\x49\x30\x45\x71\x40\x50\x19\xd0\x6a\xbf\x59\xdb\x75\ +\x95\x63\x61\xbb\x80\x13\xce\x58\x0e\x40\xe4\x46\x0f\x9f\x9f\x9e\ +\x99\x2e\x76\xac\xd3\x2d\x2f\x5f\xbf\xe1\xed\x3b\xa9\x0d\x9e\xd1\ +\x9c\xd9\x4a\x91\xaa\x0d\x4f\x2e\x1e\x33\x7b\xf0\x94\xd1\x2c\x24\ +\x7f\x1b\xd1\x79\x27\x39\x74\xdf\xd7\x3b\x9e\x7c\xcf\x62\x24\x60\ +\x35\x6d\x2d\x04\xc7\x4b\xc9\x96\x21\x64\x1a\x88\xd7\xfb\x12\x6e\ +\x7c\xbe\xbd\x5b\x91\x5c\x0c\xf8\xe1\xcd\xcf\x1d\x40\xcf\x31\x70\ +\x13\xcc\xcd\xeb\x3f\xc4\x92\x70\xf9\x96\xcd\x5d\x87\x95\xe8\x13\ +\xf7\x2e\x59\x54\xfa\x2c\x2a\xc1\x22\x33\x1d\x29\x99\xcb\x3b\xc7\ +\x41\x8f\x4d\xa8\xc9\x68\xc6\x84\x32\x5e\x31\x01\x7c\xae\xf4\x18\ +\xab\xc3\x52\x0f\x67\xc9\x72\x73\xb6\xd3\x94\xb7\x59\xc2\x73\x3c\ +\x37\x11\x6e\xb8\xf4\x60\x3c\x82\x65\x49\xe7\x51\x55\x47\x52\xdd\ +\x11\xae\x66\xe3\xe1\xa2\x03\x9d\xa7\x80\x96\x13\x57\xbd\xb6\xf9\ +\x19\x6f\x1e\x34\x18\xbc\x31\xb0\x51\x94\x28\x15\xe8\xb2\xb3\x88\ +\x22\xbc\x6d\xd9\x0a\xe8\x34\xcb\xc3\x75\xa5\xad\x6a\xb4\x14\xe9\ +\xdb\xce\x0f\x36\x80\x2b\x90\x6c\x81\x81\x99\xf8\x33\x28\x2a\xb2\ +\xc0\x73\x85\x0f\x3b\x7f\x4d\x7a\x99\xfe\x0c\x13\x78\x2f\x0c\x80\ +\xb7\x48\xfa\xca\x7c\x8a\x01\xef\xa7\x7b\xdd\xda\xee\x84\x12\x11\ +\xba\xe6\x56\x72\x6f\xd4\xdb\x71\x35\x4f\x9f\x0e\x2c\x72\xcc\x5a\ +\x11\xb3\xb3\xc3\x01\x8d\x26\xd6\x3a\x58\x5b\x6c\x42\x44\x4e\x07\ +\x5b\xe0\xef\xd5\x9e\x0f\xef\xaf\xf9\xe3\xbf\x0a\x98\xde\xbf\x61\ +\x5e\xcd\x99\xfa\x8a\x1f\x4a\xc1\xd4\x7f\x03\x7f\x03\xcf\x3f\x7f\ +\xca\x17\xc5\xd7\xdc\x5c\x96\x78\x79\x07\x5e\xb5\xff\xe4\x89\x1a\ +\xb2\x30\xec\xdd\x04\xb3\xf5\x94\xdf\xe5\x39\x95\xfa\xc0\x44\x0d\ +\x5b\xc0\xb4\xdb\xc5\x2e\x74\xaf\x59\x88\x35\xdc\x81\xbf\xbb\xe5\ +\xde\xec\x1c\x33\xde\x53\xf6\xf4\x2c\xb5\x67\xfb\x88\x6c\x59\xb0\ +\x7b\xbb\x64\x79\xb1\xa5\xea\xcc\x49\x3f\xe8\xf7\x19\x8f\xc7\xe6\ +\x7b\x89\xdd\xf9\xa8\x75\x37\x5d\x69\xec\xb8\x7b\xb0\x45\x8c\xf8\ +\x9e\x74\x65\xf3\x17\xd6\x17\xd6\x79\x8b\x60\xa7\xa0\x17\x39\x97\ +\x63\x3d\xae\x18\x2e\x4b\xaa\xe1\x86\x43\x36\xa2\x13\x17\x0e\xc0\ +\x3a\xca\x99\x02\x31\x5d\x21\xf4\x74\xa2\xe6\x02\x75\x97\xb7\x80\ +\x9c\x0d\x3e\x12\x96\xbf\xd6\x98\x2e\xea\xb9\x4e\x99\xd5\xfa\x4e\ +\x0f\xd9\xde\x42\x9d\x0b\x3e\xec\x5a\xb3\x82\x2d\x1b\x47\xad\x13\ +\x82\x73\x02\x78\x54\xed\xd5\xf6\x8f\x78\xb6\x5f\xc6\xee\xf5\x11\ +\xb8\xe1\x80\x7d\xd3\x7a\x14\x89\x8a\x3e\x7a\x28\x76\xdf\x76\xd4\ +\x99\xb3\x7c\x5a\xcb\x2c\xfa\x31\x36\x6e\x9e\x3d\xf4\x4c\x1f\xb5\ +\x70\x27\xe5\x3e\x75\x42\x9a\xd5\x3a\x65\xd8\xa1\xc9\xd0\x4d\x00\ +\x2b\xe5\xb1\x59\x6a\x16\x5e\xdf\xc2\xb3\xe1\x96\xde\x65\x40\x35\ +\xeb\x43\xf5\x88\x72\x5b\x70\xb7\xee\x30\x5f\x49\xfe\x8f\x3f\xff\ +\x53\x7e\xef\x5f\xfc\x3e\xdf\xfe\x6f\x7f\x42\xa5\x4e\x75\xde\xed\ +\xf2\x96\x19\xef\x5b\x00\x5e\xec\x42\x57\x14\x99\x7e\x78\x0d\xab\ +\x5a\xf9\xfa\xbb\x5b\x16\x62\xcd\xed\xf2\x16\x7f\x77\x5b\xdf\xb7\ +\x0b\x99\xad\x14\xb7\xcb\x5b\x6e\x24\xb0\x9a\x72\x90\xef\xdd\xe3\ +\x00\x3f\xcf\x3b\x5c\xef\x4b\xde\xa7\x1f\xd9\xdc\x7d\x44\xca\x1d\ +\x62\xdc\x65\x3c\xee\xba\x93\xa9\x0f\x27\x71\x3b\x58\x7f\x54\x81\ +\xb3\xb7\xab\x24\x35\xce\x86\xe4\xcd\xbb\x35\x2b\x33\xde\x3e\x0e\ +\x0a\x37\x99\x33\x37\x33\xde\x18\xfb\x78\x8d\x3c\xf1\x69\x97\x78\ +\x8d\xb3\x66\x69\xfd\x3c\x51\x95\x4e\x4e\x08\x2a\xe7\x13\x87\x61\ +\x04\xc3\x0a\xdf\xe6\x26\xb4\x7e\xd5\xa3\xa8\x2c\x38\x5d\xde\xb7\ +\xd1\x91\x71\x0c\xe0\xbe\x95\x00\x46\xd3\x7a\xdb\x86\x5d\xd5\x8f\ +\x29\x92\xf4\x44\x40\x44\x46\xe3\x44\x06\x84\x5b\x03\x58\xe9\xca\ +\xd3\xf5\x4e\x11\x35\x18\x59\x8a\x7a\x28\x9f\x2e\x8c\xf4\x5c\xce\ +\x58\x77\x36\x47\x35\x3b\x37\xec\x35\x7d\x52\x6e\x79\xb6\xdf\xaf\ +\x9e\x12\xd4\x5c\xc8\xb5\xf5\x70\x6e\xce\x46\xaa\xa4\xe2\xc3\xc7\ +\x90\xbf\xdc\xd4\x3e\xed\xa3\x6e\xc4\x7c\xf6\xcb\x78\xcf\x47\x5c\ +\x0c\x1e\xc0\x60\x82\x2f\xfe\x3e\x9b\xad\xe0\xc3\x12\xb6\xff\x77\ +\xca\xfb\x7d\xdb\xdb\xee\x44\x8f\xda\x00\x6d\x58\x74\x8b\x5d\xa8\ +\x01\x69\x80\x7d\xbb\xbc\xe5\x9e\x47\x1c\x6e\x14\x9d\x4b\xc1\x8d\ +\xd4\x92\xa4\xb9\x75\x55\xae\xf9\x37\xda\xf9\x90\x70\x3f\x12\x0e\ +\xc8\x5e\xf6\x8e\xf7\x66\xfe\xc7\xa3\xd0\x23\x16\x25\xc3\xde\xb8\ +\x35\xe8\xdb\xe9\xda\xc6\x22\x2d\xcd\xf4\x54\xcd\xd5\x5a\xb2\xde\ +\xed\xa9\xde\x0e\x59\xef\xf6\xb0\xd9\x13\xc6\xc2\x9d\xfd\x29\x2b\ +\x02\x86\x04\x24\xb1\x9e\x32\xf4\xe9\x4b\xbd\xb8\x6b\x4e\xa8\x1f\ +\x3e\x3c\xcf\xc2\x1f\x96\x6f\x19\x04\x17\xe4\xfb\xf3\xdd\xe4\x93\ +\xe9\x4c\x4f\x00\xa2\x15\x93\xdc\x9c\xd8\x5b\xda\xf6\x92\xad\x06\ +\xd1\xe3\x92\x71\xe1\x16\x5c\x7a\x12\x4f\x16\xf8\x66\x52\xbc\x96\ +\x17\x52\xaa\x76\x89\xc2\x02\xce\x16\x0f\x84\xce\x58\x34\x83\xe8\ +\xf2\x18\xf6\x8d\x94\x5c\x6d\xb3\xed\x1c\x08\x95\x63\x62\xd9\x38\ +\x97\x88\x57\x6f\x8f\x00\x9c\x37\x66\xac\x7d\xea\x62\x99\x3a\x37\ +\x9f\xbb\xbe\x97\x70\x78\xc3\x78\xa9\x6d\x35\x0b\xc6\xab\xce\xdf\ +\xf2\xa8\x1b\x39\x66\xfe\xc9\x8b\x9c\xe7\x83\xc7\x9a\xa5\xcf\x79\ +\xa0\x0d\xf0\xdd\x48\x98\xf1\x9e\x83\x7c\x4f\x27\x7a\xe4\x98\xf4\ +\x20\xf5\x7d\x97\x11\xf5\x7d\x37\xaa\xf1\x3b\xe8\x1c\xee\xee\xa6\ +\x70\x5b\x3f\x7a\x50\x7f\x86\x79\xae\x05\xf2\x68\xb5\xe3\x4d\xea\ +\xb1\x54\x5b\x53\x23\x50\xba\x7d\xc9\x53\x0c\x2b\x41\xd6\xf1\xf4\ +\x18\xd8\x5c\x32\x5f\xac\xdd\xe2\x2e\x0e\x0a\xe7\x64\x6c\x63\xc9\ +\xb0\xd7\x25\x9c\x8c\x18\x4e\x62\x9e\xf4\xea\xef\x74\x4d\x41\x90\ +\x05\x84\xc3\x01\x43\x82\xda\x1f\x3e\x26\x8d\x46\xa1\x62\xd3\xd1\ +\xad\xfd\xeb\xdb\x1a\xc0\xea\xf5\x77\xad\xc5\x9d\x5b\xd8\x99\x69\ +\xf6\xd6\x27\x46\x94\xae\x62\xd7\x3a\x19\x42\xdc\xe9\x59\x5b\xa0\ +\x96\x0a\x26\x0b\x61\x2f\x76\x8c\x6b\x33\x3f\x1c\xb4\xc6\x4e\xe9\ +\x05\x62\x91\x94\xce\xff\x2d\xa2\xaa\xb5\x23\x1c\x27\x3e\xb7\x4a\ +\xd1\x17\xa2\xa5\x7f\x23\x23\x31\x4e\xcb\xcd\xb4\x2a\x7c\xee\xac\ +\x49\xcd\x8e\x0e\x57\xe9\x10\x66\xc4\x54\xd5\xaa\xda\xb5\x98\x56\ +\x14\xc0\x96\x24\xeb\xb6\xc1\x7d\xec\x94\xd8\xe2\xcd\xad\x66\xc8\ +\xc5\x4e\x2f\xe8\x2e\x23\xe8\x5c\x8a\x16\x33\x03\xdc\x4f\xf7\x0e\ +\xd8\xf6\xbe\x73\x60\xb6\x40\x6e\xde\x6e\x5e\x9a\x4c\x6b\x19\xbd\ +\x94\x1f\xb9\x09\xfa\xad\xfb\x7b\x97\xc1\x09\xe3\xdf\x48\x28\x7b\ +\x0f\xd9\x66\x43\xfe\x62\x71\x8d\xc8\x7f\x41\x55\x4d\x11\x87\xc8\ +\xb5\x28\x59\x40\xeb\xef\xcc\x1c\x8d\x62\x41\x1c\x14\x3a\xaa\x19\ +\x46\xae\x48\x72\x35\xe9\xd6\x7e\x72\x83\xb1\xe3\xa0\xd0\xc5\x8e\ +\xd8\x33\x1e\xb3\xe0\x90\x05\x7a\x56\xdb\x27\xba\x43\x40\x37\xa5\ +\xde\x2d\x17\x6e\x41\x77\xbd\xcb\x59\x5c\x3e\x6f\xb1\xb1\xb3\xd8\ +\xcc\x6f\x6a\x7d\x62\xd7\xd9\xe1\x98\xb8\x59\xac\x50\x52\x83\xb0\ +\xb1\xb8\xeb\x9b\xd6\x9b\xe2\xf8\x7c\x1e\xa2\x72\x9a\xb8\x99\x47\ +\xab\xfa\x5e\xad\x8f\x1b\x92\x44\x36\xb4\xae\x34\xe0\x75\x5a\xf8\ +\xa8\x25\xc8\xb9\x18\x6a\x61\x2a\x72\xf2\x13\xba\xf8\x4c\x19\xda\ +\x4a\x04\x25\x99\x05\x5d\xed\x3e\x28\x69\x16\x7f\x38\x76\xdd\x39\ +\x9d\xd6\x27\x8d\xf7\x27\x72\xa2\x09\xea\x7b\x29\xf9\xf0\xfe\xda\ +\x49\x89\x83\x7c\xcf\xeb\x1f\x16\xbc\x9f\x7f\x6c\x31\x64\x13\xcc\ +\x16\x54\x96\x2d\x8f\x41\x66\x6f\x37\xc1\xb9\xbb\x29\x78\xbf\x97\ +\x6e\x5b\xca\x8f\x6e\x3b\x9b\x77\xdd\x73\xed\xf5\xe6\x4e\x62\x3f\ +\xd3\xb2\xb4\x95\x28\x76\x81\xb7\xbd\xa9\x48\x8b\x1d\xf3\x62\xa7\ +\x4f\x24\x49\xe6\x66\x28\x5b\x67\x22\xeb\x78\x9a\x6d\x2d\x78\xe3\ +\xd0\x69\xe3\x34\xd3\xe0\xb5\xb7\x8b\x58\x83\xb7\x79\x5e\x11\x9d\ +\x5b\x6e\x58\x94\xe5\x4a\x77\xff\x64\x01\x90\x11\x64\xca\x1c\x21\ +\x33\x3a\xbd\xcb\xb3\x0b\xba\x0f\x4b\xdd\xb0\xf4\xd9\xf8\x09\x9b\ +\xe2\xae\xdd\x63\xd7\xc8\x61\x58\xb9\xe8\xdb\x1f\xdc\x95\x7a\x85\ +\x96\x04\xc1\xd1\x02\x6f\x6b\x40\xe9\xce\x9a\x74\xd4\x56\xa4\xdf\ +\xa7\x1d\x75\xdf\x1a\x95\xdb\x5c\x00\xda\xfb\x11\x95\x5b\xdc\x6d\ +\x1b\x8b\xb4\x02\xc9\x20\xfc\x8e\x87\xe1\x77\x5c\xc9\x3f\xe0\xaa\ +\xfa\x23\xbd\x95\x7f\xc0\x17\xf2\x0f\xce\x80\xb6\xbd\x60\xd3\x80\ +\xf5\x98\x65\x26\x8c\x53\xec\x48\xb2\xae\xfe\xe2\xcc\xde\x9c\x8b\ +\x8a\xb0\xb5\x43\xd4\x4c\x7c\x96\x8d\x8f\x80\x6d\x19\xd3\xbb\xdf\ +\x72\x58\x4d\xb9\xbe\xfe\x78\x02\x9e\x26\x2b\xf7\x2e\x83\xd6\x6d\ +\x0b\x44\x0b\xba\x47\xdd\x88\xdd\x4d\xc1\x61\x35\x75\x0c\x0e\x70\ +\x59\x6c\xf1\xa3\x07\xcc\xe6\x5d\x6e\x82\x3e\x9d\xd1\xdc\x5d\xff\ +\x14\xc3\x3f\xea\x46\x2d\x59\x71\x69\x9e\xf2\x43\x57\x7f\xe6\xc7\ +\x77\x5b\xd4\x72\x6e\x16\xad\x71\x6b\x01\x1c\x86\x91\x9b\x2c\xe4\ +\x16\x79\x59\xee\x0a\x1f\x55\x92\xb6\x16\x7b\x36\xe1\x36\x24\x30\ +\x27\x82\x84\xf5\xe6\x70\x32\x4a\x20\xc8\xb4\xbc\x50\x24\x0d\x99\ +\x11\xbb\x93\xd6\x58\x26\x6e\x82\xf7\x7a\x97\x13\xa8\x57\xec\xb3\ +\x69\x5b\x13\x1f\x9f\x17\x05\x08\x2d\x70\x20\x72\xbe\x6e\x3d\x0c\ +\xbb\x06\x68\xdf\x36\x6c\x46\xed\x2f\x4e\xdb\x64\xb5\x08\xd0\x0f\ +\x6b\xef\x37\x10\xc2\xcc\x1f\xae\x08\x54\xd4\x38\xac\xdb\x05\x9d\ +\xb6\xd9\xfa\x4a\x4b\x87\xad\x52\x7c\x5d\xfd\x11\xdf\x7f\xf7\x03\ +\xbf\xc6\x3f\x6f\x7d\xce\xe8\x57\x61\xf5\x6f\xe1\xea\x19\xcc\x57\ +\x5f\xb1\x0f\x3f\xd3\x96\x9a\xeb\xb9\x33\x21\x24\xa1\x13\x77\xf3\ +\xed\x1c\xdf\x4c\x90\xdf\x99\xf3\x8e\x1e\x33\x71\xcb\xff\x8d\xf7\ +\x66\xf4\x95\x70\xe5\x66\xcb\xca\x12\x49\x59\x64\xac\x6f\xe1\x71\ +\x18\xf2\xd6\x68\xd7\x6a\xd6\x67\x7e\x3f\x67\xea\x4d\x99\xdf\xcf\ +\x39\x78\x53\x3a\x68\x20\xdf\x04\xfd\x13\x90\x59\x0d\xfd\x88\xf7\ +\x0e\xcc\xb3\x79\x97\xf7\x53\xc9\xe5\x68\xcb\x4d\xd0\x77\xb7\x67\ +\x68\xb0\x5e\xca\x8f\xdc\x4f\xfb\x06\xf0\x30\x6b\xec\x0c\xcd\xf7\ +\x3d\x27\x45\xac\xa4\x78\x68\x54\xe2\x7b\x15\xf2\x2b\x71\xce\x78\ +\x3c\xd5\xa3\x18\x7a\x42\xcf\x76\x43\xb9\x59\x16\xf1\xa1\x22\x18\ +\x95\x78\x69\x52\x4b\x06\x03\xe6\x7e\x95\xd4\x21\xa2\x58\xe7\x62\ +\xc8\x20\xcf\xb7\x4c\xb3\xbe\xcb\x2b\xbb\x35\x85\x3f\x72\x92\x42\ +\x19\x3d\x6c\x2d\x36\x45\xd2\x38\x93\x93\x61\x62\x03\xde\x0f\xcb\ +\xb7\x5c\x8d\x9f\xf0\x76\xf7\x84\x17\xf1\xfc\x14\xc0\x26\x47\xe1\ +\x02\x41\x91\xd0\x91\xca\xed\x51\x91\xa3\xa5\x1f\x0d\xe0\xa4\x39\ +\x31\xe3\xb1\x47\xdb\x5c\x74\xe9\xbe\xbc\xa8\x15\xce\x29\x8c\x2e\ +\x2d\x94\x02\xe5\x11\x08\xd1\xf0\x89\x8d\x3b\x61\x98\x7e\xfe\xb1\ +\x38\x01\x30\x68\x00\x03\x24\x3f\xfc\x2e\xcb\xd5\xff\x4e\x37\xfb\ +\x43\xae\xaa\x3f\xa2\x77\xfb\xaf\xb8\x92\x7f\xa0\x65\x07\x92\x37\ +\xd7\xd7\x2c\xae\xaf\x5d\xa2\xae\xea\x7b\x2e\x5c\x6f\x83\xf1\x16\ +\xc0\xa1\x68\x9f\x69\x5e\x34\x0a\x21\xb9\xf2\x50\x4a\x91\x1b\xf6\ +\xbe\x5b\xea\x0a\xdd\xbb\x3c\x77\x8b\xba\x47\xdd\x88\xab\xab\x07\ +\x6e\x41\xd7\xbb\x0c\x9c\x56\xfd\x14\xd0\xec\x02\xce\x3e\xc7\x32\ +\xef\x61\xd5\x2e\x26\x77\x46\x73\x2e\x8b\x1a\xd8\x56\x4e\x58\x56\ +\xb7\x2c\xdb\x89\x1e\x69\xbb\xee\x13\x97\xcb\xa8\x5e\xdc\x7d\x36\ +\x7e\x42\x34\x11\xf8\xa2\x64\x1a\xf4\x18\xe4\xa9\x1b\x4e\x68\xe7\ +\x23\x03\x1a\xc0\x86\x79\x01\x2a\x4f\x03\x71\xeb\xa5\xee\xfe\xe6\ +\x49\xd6\xed\xc2\xae\x5e\x8d\xed\x9d\x94\x68\x6e\x15\x89\x91\x13\ +\x89\x73\x27\xe6\xe6\x24\xe7\x96\x89\x7d\x79\xe3\x98\x78\x72\xf3\ +\xba\xd6\xc4\x67\x2a\xb6\xd8\x28\xa6\x34\x4c\x1c\x34\x67\x12\x5b\ +\xa0\xba\xd3\xde\x4a\xe3\xe1\xd2\x6e\xf8\xb4\xaf\x55\xb5\x7b\x10\ +\x99\x96\x7f\xf7\x9e\x06\xb4\xf5\xb6\x7d\x98\x8e\x44\xc5\x42\xbe\ +\xe7\x4a\xea\x39\x0c\xf3\xee\xbf\xc7\xe8\xcb\x1a\xb4\x2d\xcd\xfe\ +\x52\x11\xbf\x10\x7c\xf9\xf2\x7f\x21\x7e\x21\xe0\x07\x13\x50\xf9\ +\x01\xbe\xe2\x77\x79\x13\xfd\xb7\x26\xe0\x08\x1f\xd7\x01\xdd\x87\ +\xbf\xc9\x58\x3c\xaa\xa7\x55\x9e\xe9\xf0\x68\xc6\x32\xed\x8e\x9b\ +\x2b\xcf\x65\x34\x6e\x17\x92\xb7\x77\x8a\x97\x6f\xdb\x83\xfb\x26\ +\xbd\xdc\x55\xde\x00\x9e\x9b\xaf\xef\x37\xa2\xf7\xdc\xf3\xa5\x73\ +\x16\xee\x47\x82\xd9\x4a\x71\x3f\x9a\xf3\xb0\xf7\x90\x85\x58\x73\ +\xb8\x79\xdf\x3a\xfc\xef\x6e\x0a\xee\xa7\x7b\xb7\x20\x9c\xcd\xbb\ +\xdc\x4c\xfb\x78\xf7\x5b\x2e\xc7\x5b\x6e\xa6\x7d\xa0\xcf\xcc\xb0\ +\xf7\x65\xa1\xff\x96\xf7\x12\x6e\x02\x3d\x69\xbd\x33\x14\x1c\x56\ +\x53\x7a\x97\x81\x4b\xd0\xe9\xfc\x59\x0d\xf2\x40\xbd\xc2\xdb\x3e\ +\x61\xb7\x93\x94\xbd\xb8\x35\x03\x19\x30\xed\x4c\x0d\x26\xad\x46\ +\x3a\xee\x64\x40\xdd\xdc\xda\xa2\x87\x1d\x45\x8b\xe9\x14\xc9\x73\ +\x09\x9b\x3d\x6b\x0a\x06\xe8\xb1\xb3\x76\x7e\xb2\x3d\x4f\x88\x6d\ +\x2a\x3d\x89\x70\x46\x97\x4e\x13\x5f\x8d\x9f\xf0\x61\xd4\xab\xa3\ +\x98\x67\x4a\xd7\xee\x77\x44\x08\x02\x75\x6c\x7f\x09\xe7\x32\x64\ +\x52\x21\xa9\x4f\xba\x58\x34\x7c\xe4\xbe\x10\xe6\x40\x6d\x2b\x6b\ +\x5a\x46\x38\x96\xc5\x04\x77\x94\x4e\x95\x79\x32\x23\x2a\x04\x15\ +\x86\x7d\x8d\x84\x78\xd6\x81\xe4\xbb\xdf\xd5\x9f\xf1\xec\x9f\x38\ +\x00\x5b\x09\x61\xc1\x6b\x81\x7c\x0c\x6a\xbb\x7d\x2a\xff\x7b\xf7\ +\xf8\xf2\xc5\x7f\xc5\x68\xf7\x15\x8a\x47\xda\xa5\x68\xe9\x66\xdd\ +\x8a\xe4\xe6\xa6\x19\x0f\xd9\xc9\x0d\xa5\xe8\x89\x29\xd1\xa3\x29\ +\xdd\xf9\x8a\x57\x7f\xfd\x3d\xa3\xfb\x25\xf7\xa6\x3c\xdc\xac\xbc\ +\xd1\xcb\x5d\xe5\xed\x20\xdf\xa3\x55\xde\x7b\xae\xaf\x3f\xf2\x6e\ +\x5b\xe0\xf7\x03\x0e\x57\x0f\xb8\x44\x11\x4f\x60\xd9\xfd\x8c\xce\ +\xe5\x07\x58\x4d\x79\xbd\xfa\xce\xb1\xb1\x5d\xac\x35\x81\xdc\x19\ +\xe3\x98\xb8\x33\x9a\x73\x33\xed\xb7\x00\x0e\x50\x6d\x57\xcc\xfb\ +\x02\x96\x50\xcd\xf6\xcc\x6e\xba\xf4\x2e\x1f\x38\x16\xbe\x91\xef\ +\xb9\xbf\x14\x4e\xfd\xce\xc6\x25\x1d\xff\x0e\x8f\x08\x3d\xc5\x2a\ +\x26\x0c\x23\x27\x25\xf4\x64\x7a\x13\x5e\x7f\xd7\x67\xc9\x9a\xe1\ +\xa0\x43\x18\x46\x0c\xca\x2d\x8b\x55\xc1\x6a\xb9\xe1\xbb\xa5\xc7\ +\x78\x5c\xb1\xac\x0a\xc6\x5e\xe0\xba\xf3\x96\x4b\x8f\x07\x55\xc5\ +\x43\x42\x16\x14\x84\xf3\x94\xce\x68\xe8\xf4\x73\x1d\x28\xcb\x5a\ +\x79\xe4\xeb\xa3\xa0\xd3\xb1\x3b\x51\xf7\x4c\xc6\x6d\x30\xaf\x3d\ +\xfc\x63\x8a\xce\xf0\x35\x90\x27\x3a\x3e\xe9\xca\xcd\x51\xbd\xea\ +\xb7\x20\x95\x8d\xa0\x4e\xd4\x00\x30\xc6\x3b\x8e\x1a\xa7\x24\x00\ +\x5c\x20\x9e\x46\xd8\xa7\x0f\x6c\xf2\x47\xfc\xe9\xb3\x7f\xca\xe8\ +\x57\xe1\xd1\xf0\x77\x4f\x24\x44\x13\xa8\xe7\xc0\xdc\xbc\x6d\x1f\ +\xff\x35\xfe\x39\xd3\xd1\xb7\x34\xcf\x34\xda\x3e\x12\x79\x47\xb7\ +\xdb\xef\xf7\xd3\xab\x47\xfc\xd2\xc3\x2f\xf8\x8d\x5f\xfa\x75\x7e\ +\xe7\x77\xfe\x4b\x56\xb3\x90\x77\x79\x4e\x3f\x5e\xb7\x42\x3f\x00\ +\x4f\x7d\x78\xf2\x38\xe2\xdf\xff\xb5\xdf\xe6\xeb\xdf\xfe\x4f\x98\ +\x7e\xfe\x9f\xf2\x1f\xfd\xce\xef\xf0\xdb\xff\xdd\x7f\xc3\xb3\x2f\ +\x7e\xc6\xdf\xbe\x0c\xf9\xc3\x9f\x87\x7c\xff\x5e\x31\x5e\x4a\x3c\ +\xf1\x59\x4b\x72\x58\x66\xb5\x60\x76\x7a\x36\xe8\x73\x59\x6c\x5d\ +\x88\xc8\x5e\x9f\xcd\xbb\x54\xb3\x3e\x53\x6f\x8a\xdf\xd7\x00\x9a\ +\x7a\xd3\x13\x0f\xf9\x9e\x47\x3c\x1c\x3f\x74\xe5\x6b\xfd\x47\x57\ +\xf4\x47\x5f\xe9\xe7\xa9\xbe\x9e\xef\xb6\x5b\x12\xcf\x77\xac\x37\ +\x07\x0e\x1f\xef\x79\xfd\xc3\x2d\xab\x37\xf7\xbc\x5c\x7c\xcf\x76\ +\x7f\x07\x1b\xed\x1f\x6f\xfc\x3e\x6b\x3c\x96\x4b\x8f\xd2\x68\x7f\ +\x7b\x26\xd0\x65\x55\xb0\x5c\x7a\x1c\xe6\x4b\x3e\x7a\xfa\xbb\x9d\ +\x8c\xf4\xdf\x76\x58\x79\x14\x71\x61\x1c\x8a\x76\xcf\x9e\x23\x84\ +\x9b\xd7\x94\xd1\x25\x65\x74\xc9\xe4\xe6\xb5\xf3\x8a\xad\x4f\x2c\ +\x5a\xf6\x5c\xe6\x16\x8c\x7a\x8c\x55\x53\xdb\x02\x3d\x95\x91\x89\ +\x18\x5f\x35\xa6\xfb\x98\x98\x64\x60\x9e\x13\x08\x71\x54\xf6\xad\ +\x90\xaa\x06\x70\x20\x84\x9b\xa1\x66\x27\xf8\xc4\x45\xd5\x2a\x61\ +\x7b\xdb\x0a\xb6\xd2\x55\xf6\x22\x35\xe1\x3d\xff\x84\x47\xc3\xdf\ +\x75\x0c\x7c\x8e\x71\xdd\xc2\xf9\x08\xcc\xf6\xf6\xf1\xf5\x41\xfe\ +\x3d\x9b\xfc\x57\x8d\x8f\x6c\x22\x97\x94\x27\x76\x9d\x95\x1b\x5b\ +\xb5\x60\xb0\x6d\x3f\xf6\x60\x1c\xf0\x54\x5c\xf1\xea\xc3\xcf\xd9\ +\xf6\x86\x75\xeb\x51\xfc\x18\xfa\x70\xd9\x1d\x21\xfe\x2e\x7c\xfd\ +\xac\x47\x67\xf6\x80\xc7\x0f\xea\x91\xa4\x6f\xff\xf3\xff\x9a\x5f\ +\x7c\xf3\xcf\xf8\x97\xbf\xf7\x27\xfc\x3f\x3f\xbf\xe5\x5d\xfe\x97\ +\x3c\xfe\xfa\x92\x87\xe3\x87\x2c\x46\x82\xc3\x8d\x72\x8b\x40\x2b\ +\x2b\x66\x8b\x3b\xee\xa7\x17\x8e\x75\x67\xf3\x2e\xf7\xd3\x3d\x97\ +\x05\xee\xba\x77\xbf\xe5\x7e\xa6\x65\x86\xd6\xce\x7b\xed\x66\x5c\ +\x3e\x00\x1e\x98\x00\xcf\x7b\x6e\x96\xf0\x70\xfc\x90\xcf\x86\x07\ +\xde\xab\x90\x17\xc5\x1d\xd5\xeb\x19\xde\xf2\x9e\xc5\x66\x06\xa3\ +\x1c\x56\x21\x25\x1f\xb9\x9e\xc3\xd5\x14\xa6\xe3\x0b\x18\x78\x3c\ +\x0f\xc6\x30\xe8\xba\x12\x6f\x9e\x4b\xa6\x93\x21\x17\x93\x17\x6e\ +\x42\xd0\x33\xcb\xf0\xe6\xc4\x8f\xeb\xdd\x03\xe2\x4c\xa2\x26\x5a\ +\x72\x0c\x67\x03\x9d\x68\xdb\x6e\x29\xfa\xfd\x86\xab\xd1\xee\x0c\ +\x59\x5c\x3e\x67\x7d\x0b\xcf\xcb\xd7\xce\x2b\x56\x37\xbb\xb6\x26\ +\x76\x85\x12\x9d\xc3\xe8\xc4\x45\x7d\xf6\x24\x0b\x60\xcb\xb0\xb1\ +\xd2\xfe\x6f\xd1\x00\x6c\xa0\xa2\xf3\xb6\x93\xd5\xc2\x8d\x60\x50\ +\x64\x16\x82\x36\x47\xe1\x6d\x2b\xb2\xc3\x0e\x2f\xa8\xf0\xb6\xc6\ +\x37\x6e\xb4\x2a\x79\xdb\x8c\xbc\x1f\xf1\x0b\xfe\x21\xac\x39\x01\ +\xb2\x05\x65\x13\x9c\x4d\xf0\x66\x2f\x55\x4b\x72\xb8\x7d\xfd\x87\ +\xdf\x65\xfb\xe5\x3f\x25\x1c\x97\xe4\x4b\x0f\xc4\xe9\x79\x3b\x74\ +\xdf\x5d\xec\x5c\x8e\x3e\x11\x1f\x56\xaf\xd8\x7a\xb7\x88\x43\x42\ +\xd5\x19\x51\x36\xce\x67\xb1\x10\x6b\x9e\xfa\x75\x4b\xd0\xcd\x34\ +\x87\xb9\x8f\xff\x2a\x60\xf9\x17\xff\x8a\xde\xd5\x13\x66\x2f\x4a\ +\x61\xbb\xb5\x57\x00\x00\x20\x00\x49\x44\x41\x54\xae\xa2\xa7\x8c\ +\x7e\xeb\xa7\x5c\x7c\xf9\x1d\xbf\xfe\xe2\x1f\xf1\xd5\x97\xff\x90\ +\x3f\xf9\x9f\xff\x57\xfe\xa7\x7f\xf6\x47\xbc\xfb\xc5\x5b\xf8\xfa\ +\xd4\x53\xbe\x1c\x6d\x99\xcd\xa7\x0e\xc0\x96\x99\xf5\x22\xcf\x30\ +\xf3\x68\xce\x6c\x3e\xa5\x33\x06\xcc\xc2\xaf\x66\xf5\x48\xeb\x70\ +\xf4\x22\xf2\x9e\x47\x5c\x46\xef\x29\x81\x9b\xfc\x73\x7e\x63\xb5\ +\xe3\xe3\xea\x5b\xf6\xd9\x94\x0f\xd5\x82\x08\xf8\xdc\x9b\xc2\xb8\ +\xc2\x1b\x7f\xc1\x97\x9f\x4f\xd8\xc6\x92\x7e\x16\xb5\x86\x77\x5b\ +\x00\xd7\xdb\xfb\x56\xe3\x28\xe8\x89\x43\xd5\x62\x0d\x4c\x58\xa3\ +\x98\x02\xfb\xed\x96\x43\xe5\xd1\x5d\x0f\x5c\x34\xd3\xfa\xcb\x82\ +\x98\x45\x26\x98\xfa\x35\x61\x0c\x1f\xc2\x4a\xf6\xb4\xac\xe8\x3d\ +\x61\x75\xa4\x89\x2d\x1b\x37\xab\x7e\x49\xbf\xa3\xe7\x4e\xf4\x1b\ +\x3e\x30\x4a\x9a\x74\x9a\x6e\x51\xda\x2a\xe9\xdc\x04\x17\x8a\x57\ +\xb2\x66\xe3\x46\x7a\x8d\x08\xe7\x74\x1c\x07\x81\xe2\x4e\x0f\x0a\ +\x5c\x27\x47\x9f\x08\x5b\xc7\x8b\x44\x45\xa0\x3c\x54\xf5\xdd\x59\ +\x5b\xed\xac\xd5\xf6\x5f\x88\x13\x90\x1f\x3f\x0f\x20\x5d\x7f\xcf\ +\x46\xfd\x8a\x61\x5a\x6b\xb5\x35\xcf\x2b\x12\x21\x54\x66\x66\xbb\ +\xd5\xc2\x63\xf1\xcd\x77\x4c\xff\xf1\x18\x8a\x05\xf3\x72\xc4\xcb\ +\x6f\xff\x98\xff\x97\xb1\x37\x0b\x92\xe5\xbe\xce\xfc\x7e\xb9\x55\ +\x65\x66\x65\xd6\xd6\xdd\xb7\xb7\xdb\xb7\xef\x0a\x10\x0b\x09\x82\ +\x94\x48\x88\x04\x29\x8a\xa3\x65\x28\x5b\x33\xf6\x84\x2d\xc6\x48\ +\xb2\x3c\x96\x46\xa1\xa7\x79\x72\xf8\xc1\x0f\x8e\x90\xdf\xec\x07\ +\xdb\x31\xe1\x07\x4d\x8c\x6c\x86\x56\xca\xb2\x3d\x5a\x47\xa4\x16\ +\x8b\x82\x28\x40\x24\x38\x20\x81\x0b\x5c\x2c\xbc\x6b\xef\xcb\xed\ +\xee\xda\x32\x2b\x33\xab\x72\xf3\xc3\x3f\xf3\x5f\x59\xdd\x17\xd2\ +\x54\x44\x47\xd6\xd2\x6b\xf5\xc9\x93\xdf\xf9\xce\x77\xbe\xe3\x3f\ +\xda\x65\xe3\x23\xab\x60\x8f\xc8\xed\x75\x8e\xba\x09\xf9\x91\xca\ +\x51\xb0\x4b\xf0\x28\x12\x8d\x8f\x91\x98\xce\x78\xf9\xda\x0a\xcf\ +\xbc\xb7\xcf\xb5\xa7\x6f\xd1\xf8\x44\x9d\x1f\x7b\xe1\xa3\x5c\xb9\ +\xfc\x4f\x68\xae\x6f\xf0\x6f\x7e\xf5\x77\x99\x1c\x4d\x2e\x74\xd9\ +\x54\x6b\x09\x86\xa9\xc8\xac\x5d\x47\x64\xe4\xce\xa2\xe4\x8f\x4b\ +\xb6\x62\xa5\xd5\x93\x70\x43\x7e\x5d\xb5\x4b\x17\xde\x46\xb5\x96\ +\x04\xed\x56\xfc\x1b\x94\x60\x1f\xea\xab\x2c\xb5\x6e\xf2\xfc\xad\ +\x9b\x1c\x6a\x53\x1a\x76\x1d\x2f\xd0\x64\x61\x97\xe1\x63\x43\x61\ +\xa2\xf2\x84\x2e\xa3\xad\xa3\x07\xc5\x4e\xbd\x71\x63\xee\xd8\x19\ +\x37\xd8\x56\x73\x94\xe8\xf0\x9c\xcd\x17\x4c\x73\x9f\x86\xe3\xc8\ +\xa6\x47\x6a\xa7\x44\x04\x58\xb6\x22\xd9\x89\xce\xd1\x36\xc3\x56\ +\x9d\x81\xb7\x42\xf3\x92\x28\xee\x5a\xc3\x59\x26\x8e\x0b\xae\xd9\ +\xac\x64\xe3\x88\x40\xe8\x89\xb5\x50\xc1\x2f\xf8\x61\xdf\x0a\x71\ +\xfd\x1c\x4d\x53\x29\x5d\x1b\x34\x14\x52\x22\xe2\x02\xf5\x36\x8b\ +\xc9\x8f\x38\x12\xba\xe2\x18\x4b\x2c\x65\xac\x32\x18\x73\x10\x25\ +\xac\x74\xf1\x66\xca\x63\xbf\x38\x6a\x58\xf4\xcb\xd5\x04\xe1\x3c\ +\x26\xae\x06\x63\x15\x23\x97\xcf\x3d\x29\xc8\xcf\x7f\xae\x7f\xe3\ +\x7a\xa5\x30\xb0\x3e\x24\x13\x2b\x17\x5c\x95\xde\x1b\x9d\x31\x79\ +\xf3\xeb\xd4\x59\xe6\xbb\x5b\x31\x7b\xfb\xe1\x1c\xbd\x05\xc0\xc3\ +\x43\xc2\x7e\x24\x33\x5f\x3c\xec\x62\xb4\x7a\xc4\xa3\x88\xdf\xfa\ +\xee\x5b\xb4\xde\x7a\xc4\x0f\x5c\x49\x78\xf9\xc5\x4f\x30\xfe\xcc\ +\xdb\x98\x9f\xfb\x29\x9e\xfb\xe2\x02\x3f\xb3\xff\x32\xaf\xfd\xe5\ +\x5f\x31\x39\x4a\x59\x5b\xb1\x24\x5f\x9c\xb5\x04\x27\xac\x9c\xc1\ +\x4a\xdb\x27\xce\xd7\x80\xe9\x5c\x26\x5e\xe8\xd5\xa0\x35\xc3\xcb\ +\x47\x9a\x23\xdb\xd0\x2b\xa9\x5f\xfc\x0e\x48\x86\xa2\xca\x13\xbf\ +\xd9\x3f\xa4\xf1\x7d\x0d\x77\x71\x49\x0e\x8f\xaa\x40\x69\x53\x6c\ +\xc6\x16\x91\x51\xe8\x4f\x8a\xd6\x74\xd9\x8d\xd3\x5a\x19\x8c\x93\ +\x0b\x2c\x45\x79\x1c\x4d\xa6\x24\x67\x03\x0c\x16\xe9\x2e\xa8\xb8\ +\xc5\x82\x1b\x9f\x84\x4e\x4b\x63\xea\xfb\xe0\x38\x73\xf0\xad\xdf\ +\x33\xa9\x0d\x4f\x24\x9c\x10\x93\x21\x47\xb4\x8e\x26\x98\x9b\x37\ +\x38\x66\x4f\x66\xe2\xb2\x59\x22\x5c\x87\x02\x4c\x02\x89\x89\xd5\ +\x52\x2f\x6c\x15\x81\x7c\x5e\x7a\x59\xbe\x1e\x9e\x2b\x8e\xc2\x22\ +\x80\x0d\x42\x01\x43\x42\x85\xf3\xdb\x23\x7c\x19\xac\x52\x0d\x21\ +\x77\x52\x68\xa6\x39\x73\xdb\xac\x60\xf2\x57\xef\x7c\xe9\x43\x39\ +\xcf\x6a\x40\x97\xb7\x77\xf8\xd2\x85\xe7\x5b\xcf\xc3\xf8\xca\x2f\ +\x33\xbe\xf2\xcb\xc4\xfa\x73\xe8\xd2\x15\xe8\x09\x05\x5e\xa1\xa8\ +\x22\x0a\xa5\xb7\x45\x58\xec\x50\xf6\x92\x35\x72\xb7\xcb\xc9\x83\ +\x37\xd9\x1e\x3e\xb8\xd0\x91\xdb\xcd\x90\x6a\xb2\xb9\x6c\x0a\xb4\ +\xda\x57\xe9\xb6\x2c\x1e\x0e\x5d\xde\xf9\x46\xca\x5f\xbc\xb6\xcd\ +\x5f\xfe\xc5\xd7\x98\xf6\xde\xa7\xfb\x42\x1b\xe7\xda\x06\xdb\x61\ +\x9d\x2c\x3c\x91\x05\x5b\xc9\x50\x2c\x17\xac\x44\x2f\xef\xcd\x15\ +\x79\x25\x4b\x51\x16\x79\xe5\x73\xc7\x83\x59\xf7\xf0\xac\x3b\xe5\ +\x78\x30\xfb\x3d\x56\x2c\x81\xdf\xfd\x60\x56\xdc\x79\xa7\x27\x74\ +\xe2\xc2\x6d\xa7\x68\x3b\x97\x41\x0b\xe0\xe4\x5d\x19\xbc\x25\x0f\ +\xac\x8c\x05\x7d\x56\xed\xc6\x95\x8f\x47\x93\x01\x83\xc1\x00\x86\ +\x3a\x6b\x9d\x84\x8e\x9a\x12\x0f\x15\xfa\xc3\x74\xae\xf1\x51\xe5\ +\x93\xcb\x42\x7a\xda\x5a\x92\x9a\x94\xce\xd1\x36\x03\x6f\x85\xfe\ +\xca\x26\x87\x93\x84\xd6\x70\x32\x47\xa7\x09\x8e\x79\xe6\xad\x37\ +\x8f\x89\x0b\x3c\x6b\x59\x39\xfd\x92\x22\x2b\xe9\xb4\xbe\xe8\x82\ +\x35\x11\x6b\xa6\x47\xe7\xa4\x38\x71\xa8\x88\xe5\xe6\x73\x19\x78\ +\x9e\x0f\x08\xe2\x09\x16\xb6\x80\x29\xc5\x66\xa4\xb9\x56\x6e\x81\ +\xa1\xaf\x18\xf0\xf5\xec\xaf\x78\x99\x7f\xf8\x36\xbc\x23\x82\xb5\ +\x6c\x8c\x54\xb3\xf2\x9d\x07\xff\x92\xda\xda\x75\x3c\xbd\xc0\x52\ +\x91\x52\x09\xe0\xb0\xe8\x4f\xce\xae\x0a\x22\x13\xe7\x33\x2f\x37\ +\x60\x6b\x3f\x00\x8e\xf1\x81\x81\xb7\x22\x03\xb4\x64\x27\xf6\xfc\ +\x7d\x16\x86\x11\x47\x15\x46\xc0\x68\xc1\xe4\x68\x86\x69\x8d\xa6\ +\x08\xc2\x3b\x1c\xb0\xb6\xbd\xc4\x35\x1e\x72\x7a\x3b\xe1\x7e\x07\ +\x94\x65\x03\xf7\xe1\x61\x51\xbd\x77\x61\x8e\x27\x16\x8f\x97\xdb\ +\x70\x7c\xe6\x73\xb4\xe0\x54\x20\x46\x54\x14\x76\xb0\xa0\x9e\xd2\ +\xcb\x4d\xd1\x31\xcc\x7b\xb2\xe0\x5b\x6e\xcf\x32\xf1\x59\xcb\x24\ +\x0b\x9a\xf2\xf7\xbe\x7f\xa4\x70\xed\x69\xe8\x3f\x36\x20\x0c\x51\ +\x34\x17\x02\x95\x49\x2a\x7e\x57\x45\x73\x19\xd9\x03\x6c\xad\x2e\ +\xdb\xc8\xfe\xd4\xa3\x11\x4c\xc1\x15\xef\xcd\xd8\x50\x69\xf4\xd2\ +\x42\x6f\xe2\xd0\xd0\x62\x1a\x41\xce\xb8\xd5\xc1\x01\xe2\x61\xb1\ +\x88\xb1\xdb\x90\x0c\xc5\x88\x94\x06\x62\x0f\x75\x56\x19\x44\x2b\ +\x33\x71\x89\x87\xdb\x1c\xc9\xe0\x19\xb6\xea\x4f\x16\x4e\x15\x90\ +\xc4\x84\x8b\x2a\x36\xc5\xcf\xe5\x3e\x66\x67\x2c\xf4\x13\xb6\x51\ +\x87\xa8\xb0\xb2\xc2\x91\x6b\x99\x9a\xb2\x13\x25\x96\x38\x96\x54\ +\xdc\x05\xb9\x64\x45\x83\xe1\x14\xd4\x5b\x58\x48\x2f\x4b\x41\x50\ +\x58\x60\xd4\x07\xe1\xd6\x1c\x14\xf8\x8f\x09\xe4\x5f\xcf\x6a\x73\ +\x30\xe3\x7b\xfc\x32\x93\x4b\x3f\x4c\x9c\x5c\x17\x2e\x99\xf2\xac\ +\xb7\x3e\x54\x0b\x21\x56\x25\x08\x58\x64\x12\x72\x96\x8b\x77\xf1\ +\x83\x37\xee\xf1\xdd\x3f\xf8\x4d\x6e\x9f\x7c\x5b\x34\x1e\x2c\xf0\ +\x83\x26\xbb\x19\xa2\x81\xc1\x9a\x0c\x60\xd5\x5a\x92\xfa\x86\x95\ +\xd4\x07\xe5\x60\x4e\x69\x76\x14\x42\xb2\x13\x71\x90\xee\x90\x1f\ +\xa9\xb4\x07\x21\xf9\x82\x73\x11\xef\x16\x59\xb9\x7c\x9c\x2f\x08\ +\x6c\x7c\x3c\x10\x54\x5c\x2f\xab\x00\x9f\x5c\xfc\xfc\x32\x63\x97\ +\xd4\x5b\xb5\xfb\x57\xd2\x6b\x65\x26\xb6\xdb\x1a\x93\xbd\x01\x4a\ +\xda\x03\x2f\xa7\xdf\xef\xd3\xef\xf7\x19\x8c\x12\x06\xbb\xd0\xef\ +\xf7\x89\x0f\x7c\x74\xdd\x22\x48\x35\xfc\x69\x44\x7c\x10\x33\xc8\ +\x53\xf0\x72\xc6\xa9\x41\xa3\x27\xb2\xa9\x53\x5b\xa4\x11\x4c\x69\ +\x69\x0e\xe3\xbc\x43\x43\xe9\xe3\x17\x06\xe4\xee\xb5\x26\x9d\x96\ +\x86\xa2\xb6\xc8\x2a\x30\xc2\x53\x1d\x49\xb5\x59\x76\x34\x97\x89\ +\xa9\x24\x8c\x92\x2b\x2e\x31\xb1\xea\xfb\x92\x67\xae\xca\x3c\xc7\ +\x7e\x8c\x9a\x5a\xb9\xd8\x5e\x64\x99\x72\xa6\x4e\xeb\x47\xf8\xd3\ +\x33\x88\x74\x31\xed\x61\x76\x65\xb6\x8d\x11\x03\x95\x71\xe1\x0a\ +\xa4\x95\xc7\x50\x91\x4a\xb7\x92\x27\x76\xe6\x66\xd4\xc2\xf9\x76\ +\x74\xa1\x66\x4b\x09\xb1\x22\xf1\xb5\xee\xc1\x16\xf6\xce\x0f\xf3\ +\xeb\x59\xed\x3f\x2a\x88\xcb\xcf\x7b\x07\x01\x41\x0e\x46\xbf\x5c\ +\xd1\x1f\x5b\xf2\xb2\x25\x3a\x72\x33\x71\x92\x98\xdf\x8b\x8a\x20\ +\xcf\x99\xf8\xe1\xac\x03\x54\x14\xac\xa3\xc7\x62\x60\xf3\x78\x64\ +\xcc\x4d\x59\x94\x19\x2d\xab\x5f\x92\x9d\xb0\xd2\x67\x62\xae\xd5\ +\x9c\xaf\x49\x01\x4f\x19\xe8\xdb\xb5\x75\x8e\x47\x86\x1c\x08\x2d\ +\x1b\x1d\x65\x93\x63\x2e\xdb\x14\x3f\x53\x64\x74\x73\xae\x90\x2b\ +\x3f\xbf\x97\xf7\x24\x5f\x5c\x3e\x5e\xe8\x9f\x62\x14\x85\xdf\x8a\ +\x35\xe3\xb2\xd5\xc9\x63\x82\xbe\x48\x50\x8f\x3b\x1d\xf2\x62\x51\ +\x62\x5b\xd1\xe8\x74\x3a\x74\x3a\x1d\x36\xaf\x3a\x6c\x76\xda\x74\ +\xda\x9b\x24\x89\xd0\x0e\x5f\xae\xad\x72\xe3\xc5\x75\xba\xd7\xaf\ +\xd1\x69\x6f\x72\xb9\xb6\x8a\xd2\xde\xa4\xd3\xde\x04\x3a\x28\xed\ +\x4d\x86\x03\x0f\xa7\x93\xa2\xb4\x9b\x05\x9b\x92\xa3\xa8\xad\x82\ +\x57\x2e\xf4\xc8\x85\x29\x84\x9b\xf9\x32\x8b\x7a\x86\xc5\xd1\xe9\ +\xd9\x9c\x30\x5e\xc2\xb2\xa2\xf1\x51\xf2\xc4\xb3\x13\xa1\x51\xd4\ +\x37\x36\x71\xa0\x89\x4c\xac\x99\x33\x0b\x14\xb9\xaa\xb6\xd3\x01\ +\xd3\xc2\x3f\x27\x92\xb7\xca\x9d\x64\x45\x86\x4b\xcb\x59\x8c\x42\ +\xbe\xa9\xf8\x02\x57\xeb\xa1\x28\x10\xc3\x7e\x84\xd5\xd7\x84\x25\ +\x40\x38\x2b\xf2\x6c\x3f\x28\xd8\x8b\x50\x66\x6a\x13\x13\x6f\xed\ +\x2a\x1f\x78\xdf\x62\xe7\xdd\xda\x3f\x98\x8d\x7f\x3d\xab\xb1\xf3\ +\xae\xf8\x90\x75\xd6\xce\x0e\xd1\x9a\x5a\x74\xe8\x66\xab\x74\x4b\ +\x56\x62\x5e\x64\x6f\x8a\x93\x71\xac\x51\x77\x8a\xe9\x90\x73\x3f\ +\x63\x6f\x3f\xe4\xe1\x41\x84\xff\x68\x97\xe5\xf6\x0c\x07\x5f\x76\ +\xd6\x65\x70\x9c\xc7\xc2\x17\x5a\xa9\x45\x96\x5e\x75\x14\xa9\x61\ +\x38\xaf\x3a\x2b\x71\xec\x4a\xea\xcb\x63\x99\x8d\x7b\x79\x8f\x23\ +\x4d\x04\x6a\xd9\xa5\xeb\xe5\x3d\x19\xb8\x0b\xbd\x9a\xcc\xc4\xcb\ +\x6d\x64\xa6\x2e\x8b\xba\x4e\xd4\xe4\xf1\xe0\x31\x07\xbd\x13\x8e\ +\x42\x21\x8e\xbf\xd4\xef\x33\xb6\xa7\x28\xed\x26\x69\x65\xcf\xc8\ +\xa8\xe8\xcc\x96\xf4\x5a\xd2\x1f\xb2\xab\xf6\xd8\x79\x38\xc6\x3b\ +\x3e\x62\x57\xed\xb1\x37\x3d\x04\xfa\x0c\xe8\xa3\xdb\x21\xba\x1d\ +\x62\xac\x5d\xa2\xe9\x1a\xb4\xe9\xa0\x77\x44\xf0\x96\x7a\x89\x86\ +\xcd\x9c\x9f\x5b\xe6\x38\x73\xf4\xdc\x95\xc2\xde\x61\xf4\x58\x64\ +\xe1\xb6\x3b\xeb\xda\x55\x31\x71\xc9\x2f\x6b\x41\xb9\x3b\x31\x10\ +\xdf\x53\xe8\x89\x43\xd1\x55\x3b\x27\x69\xb4\x2c\x53\x8c\xe0\x9b\ +\x16\xb9\x15\x48\xbf\x09\x2a\xd9\x56\x0b\x15\x69\xc4\xcd\x28\x16\ +\xc6\x28\x51\x28\x9c\x7e\xe2\x09\x49\xa0\x73\x9c\xf7\xc9\x23\xa1\ +\x8c\x3b\xe9\x47\xe8\x61\x48\xa0\xa9\x28\x7e\x40\xd8\x37\xb0\xd3\ +\x8c\xb0\x9f\x90\x0f\xb6\xd8\xe8\xc7\x8c\x57\x27\xbc\xf3\x76\xfd\ +\x43\xb3\xf1\xf0\x0e\xfc\xeb\xb7\x45\xf0\xde\xc9\xc6\x8c\x57\x67\ +\x7f\xe8\xf5\x2b\x57\xb0\x8d\xcf\xcc\x4f\x83\x48\x43\xc1\xf0\x82\ +\x88\x24\x8a\x14\x8c\x46\x4a\x3c\xd6\x64\xb3\xa3\xc4\xc4\x67\xe1\ +\x2e\x71\x78\x20\x29\xb0\x12\x5f\x6e\xa8\x82\xae\xea\x44\x4d\x09\ +\x27\x00\x96\xb5\x53\xb2\xf0\x44\x04\xab\xb5\x24\xb3\xe1\x6a\xa1\ +\xad\x56\x6a\x8b\x4f\xfc\x7b\x26\x47\xa9\xec\xd8\x1d\x0f\xb8\x70\ +\x5c\x6e\x8b\xa2\xad\x5a\xe4\x55\x03\xb9\xcc\xc6\x00\xf1\x28\x9a\ +\x3b\x56\x27\x3b\x0e\xf7\x52\xb2\xf0\x84\x61\xab\x4e\xb8\x7e\x95\ +\x89\x1f\x72\x3a\x0d\xd8\x3f\x1c\xd0\xef\xf7\x39\x9d\x06\xf4\xfb\ +\x7d\x0e\xa6\xa2\x73\x27\xd2\x66\x8d\x8e\x69\xd1\x5e\x37\x30\xdb\ +\x35\x3a\xed\x3a\xed\x95\x26\x7a\xb7\x56\x38\x06\x09\x65\x59\xa9\ +\x3f\x56\x3b\xe9\x1c\x6c\x68\xa2\x31\x0e\x98\x19\xb1\x14\x01\xdd\ +\xb0\x0b\x53\xc7\x61\xce\x4e\x2c\x10\x6d\xdb\x3d\xa2\xed\x1e\x49\ +\x38\x71\xfe\x56\x85\x13\x65\x46\x2e\x23\x56\xad\x96\x38\x98\xf9\ +\x6c\x73\x7d\xa9\x03\xb6\x72\x49\xaf\x11\x46\x62\xea\x23\x54\xf0\ +\xfb\x7d\xfc\x52\xe9\x66\x5a\xc2\x24\xa5\xea\x3f\x61\x5a\x34\x5b\ +\x1a\xcb\xad\x4b\xe2\x44\x70\x14\x1c\xd3\x22\x29\xa4\x9c\xbe\xd6\ +\x10\xcb\x6b\x34\x15\xf0\x38\x1d\x2f\xb2\xdb\x31\x78\x66\xe9\x65\ +\x94\xe7\x7b\xec\xbc\x5b\xe3\x5f\xbf\xfd\xe4\x8c\x5c\x06\x30\x80\ +\x77\xf7\xe7\xe4\xf3\xb7\x13\x95\x38\x3f\x38\x27\x96\xaf\xee\xfc\ +\x50\x66\x27\x6b\x41\xeb\xc5\xc5\xd6\xa6\xb2\x5a\x2e\xc7\x9d\x86\ +\xc9\x2d\x0c\x6b\x0d\xe5\xcc\x97\x01\x59\x36\x39\x72\x7b\x9d\x41\ +\x5b\x78\xaf\x95\x7a\xdd\x43\x3f\x67\xd5\x51\x38\x4e\x17\xc9\xc2\ +\x13\x9e\x1f\xac\xc9\x00\x5e\xd6\x4e\x9f\xf8\x8f\x31\xac\x35\xce\ +\xba\xd3\x39\xec\x5c\x66\x54\xe5\xcc\x27\x5f\x70\x64\x40\x57\xdb\ +\xca\x5d\xb5\x08\x52\x65\xa6\x6b\xee\xaa\x11\xbd\xcc\x64\xb9\x8d\ +\x84\x1f\xcb\xda\x29\x47\x61\x31\xba\x94\x8f\x58\xeb\x2e\xb1\xdc\ +\xbe\xcc\xc6\x92\x41\x77\xa3\xcd\x62\xcd\x66\x7d\xb5\x8d\xbe\xd0\ +\xa6\x6e\x5a\x74\x3a\x1d\xb1\xac\xd1\x36\x09\xd2\x59\x72\x68\xd6\ +\x6b\x98\xa6\x49\x33\x17\x1f\x25\xaf\x5c\x15\x0f\x25\x49\x38\xe7\ +\x22\x94\x24\x21\xa9\x9d\x4a\xaa\xad\x2a\x92\x97\x57\x29\x7b\x76\ +\x7f\xe0\xad\xcc\x65\xe2\x12\x4e\xc8\x02\xd0\x71\x64\x46\x8f\x8b\ +\x8c\x1c\x81\x98\x76\x9e\xf7\x98\x9c\x05\x74\x5a\x04\xad\x16\x2a\ +\x18\x84\x58\x15\x16\x42\xaa\x87\x8a\x06\x41\x69\xa6\x52\x7e\x84\ +\x08\xa3\xc0\xa0\x30\x48\x29\x9d\x35\x2d\x2b\x97\xd3\x1e\xaa\x95\ +\x0b\x45\x9c\x65\xe2\x03\xef\xef\xef\xc2\xe3\x1b\xd4\xf2\xa7\x04\ +\xce\x7d\xbb\x3e\x87\x7b\xab\x85\xdc\x9d\x6c\x4c\x7e\x47\xfc\x53\ +\xdd\xa7\x7e\x7b\x16\x14\xfa\x55\x3a\xd6\xf5\x4a\xf0\x7e\x88\x77\ +\xdb\xdc\x88\x53\x5d\x42\x9d\x30\x8a\x20\x8a\x48\x4e\x5d\x5a\xfa\ +\x3d\xe2\xf0\x80\xd5\xd5\x19\xa6\xdd\xcd\x40\x29\x6c\x54\x85\x6b\ +\x8f\xe8\x8e\x3d\x7b\x68\x08\xfb\x2a\x3f\x97\xd9\xf8\x4e\xfb\x80\ +\xc3\xa2\x7d\x7d\x9c\x8a\x2c\x6c\x77\x4c\x59\x18\xaa\x93\xc7\x42\ +\xe9\x96\xfa\x12\x26\xcc\x06\x24\x45\xa0\x56\x9f\xaf\x66\x62\x59\ +\xdc\xe5\x6b\x17\x9e\x2b\x83\x3e\x0b\x4f\xe4\x09\x75\xea\x9d\xd0\ +\x6d\x59\x3c\xff\xe2\x47\xa8\x2f\xd6\x08\xf4\x06\x69\xde\x40\xef\ +\xd6\x30\xb1\xe9\x98\x16\x1d\xd3\x42\xe9\xb4\xe5\x68\x12\xd8\x72\ +\xca\xa3\x9c\xc3\x4b\x92\x90\x91\x12\x09\xf1\x7c\xbd\x26\xc7\xfc\ +\x47\x93\xa9\x18\x1a\x2d\xf4\xc7\x49\x12\xd2\x6a\x5a\x8c\x03\x91\ +\x91\xcb\x2c\x5c\xc2\x09\xd5\xf7\x81\x06\x99\x21\x30\x5a\xb9\xc2\ +\xa1\x74\xbf\x1f\x78\x2b\x73\x22\xa0\xf3\x90\x22\xb5\x53\x89\xab\ +\xc7\xea\x14\x75\x6c\x65\x33\xea\xa9\xf8\x27\xa6\x15\xac\xca\x39\ +\x3a\xad\x54\x13\x39\xa6\x25\x82\xba\x90\x66\x6a\x17\x2c\x51\x28\ +\x3c\xdd\xaa\xcc\x72\xb9\x70\x3c\xaf\x28\xe6\x20\xd4\xeb\xe8\xab\ +\x6d\xe8\x36\x69\xad\xdc\xa2\x3d\xbc\x89\xf2\x7c\x8f\x3f\xfd\x5d\ +\x97\x7f\xa1\x4e\x2f\xe0\x60\x00\xe5\x79\xf1\x4f\xfd\x49\xe5\x27\ +\x79\xf9\xf9\xaf\x73\x37\xfc\x9f\x41\xb9\x01\x91\x52\xe8\x84\x0b\ +\xe1\x4f\x21\xa9\x94\x59\xb8\xa2\x81\x2e\x2d\x60\xc5\x54\x4b\x51\ +\x08\x86\x17\x47\x8d\x54\x6b\x09\xd5\x5a\xa2\x7b\xb2\x47\x3e\x5d\ +\xe7\xc6\x25\x03\x65\x25\x93\xa6\x25\xef\xad\xc6\x73\x83\x9a\x65\ +\xf0\x96\x99\xb9\xcc\xd6\xbb\x99\x28\x0c\x17\x86\x11\x47\x21\x1c\ +\x1e\x9e\xc8\xa0\x2b\x9b\xb7\x17\x02\xf5\xef\xb9\x9d\x87\x18\xcb\ +\x6d\x24\xb4\x50\xad\x25\x26\x47\x29\x87\x7b\x22\x0b\x3f\xf3\xe2\ +\x2d\x96\xdb\x97\x59\x6e\x5d\xa2\xdd\x6e\x63\x4b\x81\x79\x25\x40\ +\x26\xe2\x6f\x0f\x52\x8d\xb4\x2e\x32\x6e\x1f\x95\xa6\x25\xbe\xa7\ +\xa7\x37\xb0\xe3\x9c\xd1\x64\x4a\xaf\x3f\x62\xe7\xf8\x31\x23\x2f\ +\xc6\x09\x2c\x6c\x2d\x95\x1c\xb2\xae\x8b\x00\x2e\xb3\x70\x19\xc0\ +\xe5\x63\x4f\x75\x80\x31\x6a\x2c\xfe\xf8\xd2\x3c\x3c\x18\xa4\x4c\ +\xb5\x75\xda\xee\x11\x6a\x78\xc4\x61\x3e\xcb\xec\xd3\x02\x4e\x94\ +\x90\x42\x0b\x84\x8f\x6b\xc3\x31\x50\x1b\xa1\x2a\x2b\xf5\x52\xd4\ +\x5e\x06\xb0\x9d\x66\xd8\x69\x86\x1e\x9e\xb3\xb1\x2a\xb2\x6f\x19\ +\xb8\x17\xd6\xe6\x16\x81\x20\x97\x2f\x9a\x22\xdb\x96\x46\x85\x69\ +\x71\xa2\x94\x5f\xdb\x75\x15\xae\x2d\x76\xb1\x2d\x8b\x4e\xd6\xe4\ +\x0b\x9f\xff\xe2\x5c\xe0\x96\x90\xa2\x84\x11\x6f\xbf\x29\x84\x07\ +\x1f\xef\xfc\x02\xfb\x0b\x2b\x1c\x8c\x7e\x19\x4f\xbf\x2e\x5c\x3a\ +\x4d\x93\x64\x30\x28\xe8\xb2\x73\x53\xd2\xe7\x94\x6a\xf2\x14\x33\ +\x73\x4c\xd3\x14\xac\x85\x25\x0a\xdd\xf1\xa9\xc7\x61\xfc\xd4\xdc\ +\x3c\xdc\x5b\x7b\x39\xe3\xe3\x3d\x54\xee\xf1\x63\x2f\x3f\xc5\xad\ +\x97\x3e\x8a\xbb\xfc\x31\x39\x82\x54\x06\xf2\xf1\x40\x60\xd0\x9d\ +\xfd\x0e\x59\x78\xc2\x19\x6b\xd8\x1d\x81\xa7\xcb\x06\x49\xb5\x71\ +\xe2\xf9\x95\x69\x72\x3f\xbd\x10\xd4\xe5\x73\xe2\xd8\xff\xd0\xa0\ +\x3e\x1e\xcc\x98\x8b\xc9\x51\x2a\x83\xbc\xdb\xb2\x58\x6e\xc6\xd4\ +\x17\x6b\xac\x6c\x26\x42\x4f\x1c\xa9\xc2\xc2\xb5\xd0\xf8\x96\xbe\ +\x10\xe5\x73\x79\x7f\xc0\xfe\x78\xca\xc9\xf1\x01\xb7\x1f\xee\xf3\ +\xfa\x07\x77\xb9\xfb\xc1\x07\x7c\xf7\xfe\x2e\x0f\x0e\x0f\xd8\x9d\ +\x84\x44\x64\x82\x9e\xa3\x7f\xa1\x39\x32\x0b\xd6\x99\x87\x85\xa7\ +\x8a\x2c\x5c\xfa\xb8\x95\x16\x5a\x67\xe1\xae\x84\x11\x1f\x76\x53\ +\x9b\x22\x70\xcd\x39\x6a\x54\x50\x6c\x7a\x18\xcd\xfb\x12\x6b\x28\ +\x85\x07\xb1\x27\xc9\x31\x3f\x56\x70\x4a\xf1\x4c\x91\x79\x4b\x5d\ +\xb1\x71\xce\xab\xb8\x2c\x0a\xcb\xc5\xe3\x61\x18\x91\x72\xb1\x19\ +\xe2\x54\x2e\xed\x21\x16\x5a\xa7\x58\xb4\x68\xc1\xb5\xe6\x0f\xf0\ +\xf1\x4e\xc2\xd6\xc6\x37\xd9\x79\x77\x02\x1f\x9d\xf2\xea\x9d\x2f\ +\x71\x27\xfb\x33\x00\x3e\xf6\xe2\x3d\xda\xc3\x9b\x5c\x7d\x41\xe7\ +\xd9\xcd\x97\x85\x01\x92\x9c\x30\x89\xf8\xce\x77\x1e\xb1\x5a\xdf\ +\x25\x5b\x58\xc2\x6e\xc0\xae\x1f\xb2\xe1\x58\x2c\x75\x8a\x00\x0d\ +\x23\x82\x7e\x8f\xb8\x63\x16\x89\x7a\x42\x4c\x9f\x28\x99\x51\x71\ +\x83\xb6\x45\xfe\xf8\xb6\xcc\xd0\x0b\xbd\x1a\x3d\xe0\xad\xbd\x1e\ +\x8d\xe5\xcb\xfc\xd0\x0b\x2a\x57\x3e\xf5\x0c\x2b\x1b\x47\xfc\xed\ +\xff\x73\x83\xbf\x7b\x5f\x83\xfc\x35\xba\x47\x45\x3b\xd7\xd1\xa8\ +\xaf\x68\xac\x58\x4b\x64\x85\x41\x8a\x1f\x34\x89\x07\x8f\x99\x1c\ +\xef\xd2\xcb\x4c\x32\x3f\x65\xcc\x14\xd7\xb1\xe8\x67\x03\xf4\xc0\ +\xc4\x75\x34\xa0\x4f\xe6\x37\x51\x9d\x4e\x11\xb4\x85\x13\x10\x53\ +\x5c\x3a\x78\x7e\x88\xeb\x5c\xd4\x36\x2c\xb7\x41\xb5\x34\x0e\xa6\ +\x8e\x5c\xed\xad\xe6\x23\x36\xaf\x3e\x45\xa3\x2b\x4e\xfc\x47\x7b\ +\x09\x56\x3a\x00\x06\xc5\xea\x62\x70\x6a\xe2\xb8\xaf\x0e\x68\x16\ +\x5a\x06\xe1\xe9\x51\x9c\x58\x51\x48\xa7\xd3\xa4\x5e\xd0\x96\x1d\ +\xd3\x22\xad\x17\x54\xe4\xb0\x8f\x47\x4e\xb3\x08\xde\x20\xd5\xb0\ +\x99\xd9\xc8\xba\x99\x2f\x83\x17\xd5\x21\x73\x1c\x86\xa3\x90\xe5\ +\x26\x8c\x6d\x81\xbb\x17\xac\x0d\x06\x1e\xd4\xd8\x97\xc1\x3c\xf0\ +\x56\xe4\x4e\x12\x80\x24\x73\xd0\x64\xe7\xae\xd0\x26\x17\x7c\xb3\ +\xf4\x27\x0e\xb1\xa4\xbd\x2a\x51\x02\x08\x97\xf4\xf3\x2a\xfa\xf2\ +\x72\x6b\x22\x96\xc8\xb4\xc6\x0d\xfc\x62\x75\x58\xc9\x1d\xfb\x85\ +\x49\x77\x79\xa4\x32\x2c\x5a\xf5\xa8\x28\x67\xec\xac\x88\xd9\x65\ +\x1f\x70\x8d\x3a\xff\xd5\x47\x3f\xc2\xee\xf5\x67\x78\xe5\xe1\xfb\ +\xfc\xf4\xed\xaf\xf0\xbc\xfa\xb7\x02\x37\x0d\x6f\xf2\x85\xcf\x7f\ +\x91\xd6\xca\x2d\xd6\xeb\xcb\x72\xd4\xdf\x2a\x0b\x52\x33\xa4\x7e\ +\xf3\x19\x0e\xef\xbf\x0f\x27\x3a\x6b\xdd\x26\xd7\xcc\x70\x6e\xa8\ +\x54\xb5\x72\x74\x4b\x74\x97\xc4\x89\xd9\x21\xf2\x32\xfa\xb1\xc5\ +\x52\x57\xe7\x23\x2f\x75\x69\x3f\x7d\x99\x77\x6e\xff\x07\xb6\x5e\ +\x7f\x0f\xff\xd1\xee\xec\xd2\xed\xc1\xfb\x6f\xde\xe3\x6b\x03\x8f\ +\x1f\xfc\xcf\xee\xf3\xc9\x4f\x7c\x9a\xab\xbf\xf4\x73\xdc\x7a\xe7\ +\x36\x6f\xbc\x7a\x1d\x9f\xf7\x71\x8e\x37\x50\x96\x0d\x89\x9b\xc5\ +\x7f\x77\x24\xfd\x8b\x7b\x99\x89\xe7\x87\xc4\x4e\x0d\xc3\x17\x99\ +\xb8\xe3\xe4\x78\x45\x56\x6e\xd0\x44\x75\x46\x32\x90\xc7\x84\xb8\ +\x95\x2c\xd1\xa0\x46\x8f\x94\x2e\x33\x2d\x71\x95\x1b\x06\x0b\x56\ +\x80\xbb\x22\x6b\x5f\xbf\x76\x8b\x2b\x37\xaf\x73\xe9\xc6\x66\x31\ +\xc2\x50\x38\x3e\x15\xff\x4b\xbd\x48\x4c\x5d\x20\x9d\xb6\xd0\x6a\ +\x43\x3a\x99\x22\x18\x08\x33\x93\xc5\x5b\x75\x25\x18\x64\xf4\x51\ +\x51\xa2\x09\x4e\xcd\x94\x01\x0c\xa0\x7a\x0e\x74\x52\x19\xc0\x79\ +\x63\x8c\x37\x76\xc4\xe3\xc0\x41\xd7\x2d\x22\x1a\xa8\x81\x29\x33\ +\xf1\x8d\x4b\x06\x03\x6f\x1d\x06\xfb\xd8\x6d\xad\xc0\xc7\xf3\x58\ +\x58\x14\x85\xce\xdc\xf0\xa9\xdc\x63\x27\xc5\xec\x16\x28\xa1\x82\ +\x6a\x26\xb3\x82\xc8\x32\x71\xc2\x48\x76\xe4\xe2\x0a\x56\xd6\x42\ +\x05\x5f\x0d\xb0\xac\xfc\x82\x2d\xab\x66\x9a\xa4\x51\x24\x8f\x16\ +\x33\x75\x5c\x5a\xd1\x50\x94\x41\x1d\x86\x0a\x76\x9a\x0b\x89\x26\ +\x26\x53\x7d\x99\xe5\x16\x7c\xe1\x3a\x6c\x7d\xe3\x26\xbf\xf5\x78\ +\x99\x17\x6f\xbd\xc6\x8f\x7e\xe1\x5f\xb1\x79\x6b\x1d\x3b\x2a\xf6\ +\xdd\x45\x9c\x9b\xc1\x52\x58\x30\x15\xb2\x67\xae\x8a\xb3\xbc\x5b\ +\xc7\x2a\xf7\x89\x16\xda\x08\xcb\x34\xcf\x95\x7c\x39\xb0\x80\xdb\ +\x1f\x01\x36\x86\xe2\x89\xa5\x8f\x4f\xe2\x7d\x95\x26\xbd\xe1\x88\ +\x3f\x7e\x4b\x8c\xee\x7b\x67\x47\x18\xcb\x9f\xe3\xc7\xaf\x2d\xf2\ +\x89\x8d\x0e\xdb\x7b\x1d\x8e\x0f\x0e\x51\xc3\x23\x1e\xaa\x22\xd3\ +\xe4\x47\x2a\x0f\x0f\x22\x26\xc7\xbb\x9c\x8e\x0c\xc6\x14\x12\x4b\ +\x5f\x1c\x5d\x27\xc2\x2b\x24\xaa\xe2\x3e\xb8\x88\xe0\x6d\xf8\xb5\ +\x27\x66\xdd\x6e\x65\x4f\x5c\x2f\xef\xb1\x0c\xac\xac\x3e\x87\x6d\ +\x8f\xb8\xb6\xbe\xce\xa3\xfb\x0f\xe8\xf5\x15\xbe\xf8\x99\x0e\x37\ +\x57\x72\xdc\xee\x0a\x0b\x56\x9d\x34\xb7\x30\xea\x1d\xb4\x49\x84\ +\x55\x0c\xd5\x96\x59\x55\x9b\x44\x60\x4e\x49\x8b\xd7\xc5\x7b\xa6\ +\x0a\x0b\x40\x2d\x9d\x33\x53\xa1\x92\xe6\x3c\x35\xa7\x59\xb0\x18\ +\x49\x12\xe2\xdb\x21\x76\x92\xd2\x47\xa3\xab\x6a\xe4\x5e\x8e\xa7\ +\xce\xe0\xc5\xf9\x9b\xcc\xc4\x45\x81\x57\xb2\x14\xab\x4a\x32\x27\ +\xdf\xd4\x82\x96\x1c\x46\x4d\xed\x14\x83\x27\x6c\x14\xbd\x70\xb3\ +\x4c\x39\xae\x54\xbe\x65\x9a\x55\x32\x17\x8a\x1c\xeb\x11\x2e\x98\ +\x79\xa5\xbd\x6c\x49\x09\x67\xd9\x6e\x0e\x0b\xef\x8a\x92\x97\x4e\ +\x2b\x30\x26\x2c\x27\xac\xe3\x09\xf6\x48\x63\x94\xa7\xe8\x76\x82\ +\x6d\xd4\xd9\xcb\x6a\x74\x9e\xdd\x42\x7b\xa8\x70\x9c\xff\x2c\x97\ +\x17\x4d\x16\xc8\xc0\x9c\x59\xbf\x5a\x91\x22\x8a\xd2\xb2\x33\x17\ +\x28\xa8\x5a\x83\xfa\xa4\x47\xd4\x1f\x48\x08\x24\x3b\x75\x4f\x5a\ +\x8a\x16\xf6\x19\x8d\x43\x9a\x45\x76\x4e\xc7\x27\x6c\x6f\xdd\xe3\ +\xdd\xf7\x1e\xe3\x9a\xf3\x05\x54\xb7\x65\xf1\xa8\x77\xc4\x1f\xbf\ +\xf5\x88\x3f\x7e\xeb\x11\x1f\x7f\xe6\x11\xef\xdf\x5a\xe6\xe6\xa6\ +\x8d\xaa\x7d\x9a\xcb\xf9\x1e\xf7\x07\x0a\x0c\x0e\xd9\xcd\x60\xf2\ +\x68\x97\xe3\x01\x78\x7e\x8e\xeb\x8c\xc0\x37\x49\xec\x09\xf9\x28\ +\xc7\xd0\x4d\x19\xc0\x02\x1f\x8b\xfb\xfd\x6c\x40\xc7\x69\x8b\x23\ +\x6d\x09\x21\x24\x04\xa9\x24\x8c\xae\x1a\xf1\xe9\x85\x15\x8c\xb5\ +\x16\x76\xbb\xcb\x83\xc7\x31\x2b\x16\x1c\x76\x72\x1a\xcb\x97\x49\ +\xcd\xab\x74\xac\x19\x3c\x88\x27\x3d\xb4\xca\xb8\xbe\x36\x11\xc2\ +\x1a\x0d\x5b\x14\xee\x93\xf3\xdb\xa9\x32\xce\x39\x6c\x8b\x91\xa6\ +\x89\x38\x09\x95\x68\x02\x8d\x99\x78\x9e\x54\x58\x5d\xe1\xd6\x18\ +\x91\x92\xbb\x0a\xc5\x8c\xa9\xcc\xce\x42\xe0\x3e\x9f\x89\xcb\xcc\ +\x5b\xf2\xc5\x2d\xb6\x67\xed\xe5\x00\x1a\xc5\x74\x88\x9c\x12\x29\ +\x8a\x3c\xdd\x2a\x27\x94\xad\x52\xe7\x10\xce\x63\xe4\x48\xd0\x68\ +\x46\x45\x7d\xe6\x44\x96\x5c\x18\x63\xa7\x19\x9e\xa3\x14\x7b\x3f\ +\x66\x25\x93\x53\x1d\x5f\x2a\xe6\xed\xca\xad\x19\x56\x14\x51\x6e\ +\x75\x88\xc2\x10\x2b\x35\x45\x00\x17\x2e\x3b\x4d\x25\x23\x34\x73\ +\xea\x96\xc5\xb3\x5a\xc4\xfd\xad\x9f\x27\xdf\x3c\xe6\x27\xba\x75\ +\x0c\xb3\x0f\x74\xa4\x5b\x50\xd5\x2e\x36\x2c\x32\x31\x40\x43\x09\ +\xa1\xd3\x91\x85\x80\x45\x58\x08\x93\x8a\x1d\xd1\x61\xb9\xca\x61\ +\x16\x0c\x4a\xab\xce\x58\xab\x95\x12\x3c\xf2\xe3\x18\xd7\x3c\x94\ +\x4d\x85\xf2\x76\x3a\x32\x68\xb5\x5b\xe0\x41\x2f\x85\xbf\xb9\xf3\ +\x88\xb7\xf6\xca\xae\xd9\x43\xd9\x70\xe8\x65\xe1\x5c\x80\xba\xf9\ +\x2c\xe3\xea\x41\x5d\x2e\x2c\x8a\x93\x08\xa3\xb0\x53\x4d\xec\x09\ +\x7a\x50\xa7\xa3\xb6\x0b\x9c\x5c\x27\x23\x95\xb8\xb9\x85\x5b\x64\ +\x66\xf1\x3e\x74\xd5\x08\xa3\x69\xd2\xb0\x2f\x71\x65\x25\x07\x12\ +\x82\x9a\xca\xdf\x85\xd0\x6d\xde\xe0\xc5\xce\x2a\x37\x37\x0d\x1c\ +\x7d\x4c\x4e\x1d\x3d\x50\xd1\xed\x4c\x14\x74\x72\x99\xa4\x2d\xbb\ +\x60\xe7\xe7\xd8\x6c\xad\x4e\x50\xbc\xa7\xd5\x2c\x2c\xda\xd2\x16\ +\x03\x90\x70\xa2\xba\x85\xb4\x67\xe7\x98\x05\x3e\xee\x78\x39\xfd\ +\x4c\xbc\xe6\xa9\x0e\x49\x12\xa2\x05\xb3\xac\x3c\x3e\xf5\x18\x58\ +\xcf\x4a\x0c\x1c\x0c\x52\xda\xed\x23\x0e\x07\x3a\x3f\xa6\x05\x24\ +\x99\xf3\x44\x48\x21\xdb\xce\x8a\x1f\x40\xa4\xe3\xfa\x79\xe1\x9f\ +\x36\x7f\x4b\x09\x65\x03\x40\x2b\x98\x85\x12\x0a\xd8\x46\x5d\xfa\ +\x53\xa4\x17\xa4\x9a\x4f\x30\x9e\xaa\x70\xb4\xae\x9f\xa3\xf8\x39\ +\x56\x6a\x12\x6a\x11\x4a\x49\xbb\x35\x0d\x68\x1a\x58\xa9\xc9\xc4\ +\x0f\x09\xb1\xb9\x7a\x45\xe7\x85\xee\x9f\x8a\x4b\xb0\xb2\x36\xe7\ +\x16\x54\xde\x0f\x2b\x98\x37\x4b\xc7\x60\x89\x25\x07\x96\x69\xd2\ +\x31\x4d\x30\x3b\x73\x3c\x38\x96\x39\xa3\x11\x73\xf1\x77\xbb\xae\ +\x8d\x6a\x07\x9c\x45\x19\xbd\xdb\x03\x76\x46\xce\x05\x2a\x6b\xe0\ +\x88\xa2\xcd\xf3\x4d\x3c\xe3\x59\xba\xed\x0e\x69\x7b\x83\xde\x00\ +\x86\x83\x21\x77\xdf\x7a\xc8\xab\x6f\x3d\xe2\xf5\x87\x87\xf4\x06\ +\x02\x1e\xc8\x2c\xab\xcc\x02\x35\x4e\x22\xe2\x24\x2a\xf8\x6d\x13\ +\x37\x8f\x64\x70\x27\xf6\x44\x64\x60\x35\xc7\x75\x2c\xc6\x4c\xf1\ +\xfc\x90\x56\xe0\x56\x58\x8a\x59\x00\x7f\x7a\xa1\xcd\xf2\x52\x01\ +\xcf\xcc\xab\x92\x27\xde\xbc\xa6\x61\x6e\xde\x90\xfa\xe1\x34\x6f\ +\xa0\xdb\x99\x18\x0e\xb5\x33\xf4\x40\x9d\x9b\x59\x33\x2f\x4c\x14\ +\xdb\x04\xe9\x64\xae\xb9\x71\xfe\x96\x9b\x75\xfc\x69\x34\x37\x01\ +\x22\xdc\x2b\x6d\xec\x20\x2c\xae\x2a\xb3\xf4\xe6\x66\x42\x5c\x94\ +\xda\xb3\x9f\x56\x2e\x65\x2f\xa9\xb6\xea\xed\x30\xb5\xd1\x55\x1f\ +\x37\xf3\x19\x91\x4a\x0d\x45\x49\xb5\x8d\xfd\x18\x5d\xec\xd0\x98\ +\x10\xc4\x00\x13\xd1\x75\x2b\x60\x82\x53\x66\xd1\xca\xf8\x52\x89\ +\x85\xd3\xc2\x38\x5b\xc2\x85\x62\x1c\xdf\x2a\xee\x5b\x55\xc6\xa0\ +\xc2\x4c\xa4\x73\x6b\x09\x98\x1b\x22\x0d\xac\xc9\xec\x22\x37\x8a\ +\x09\x3b\x29\x9d\xa2\xc3\x77\xd4\xff\x4f\xa1\x53\x4a\x39\x43\xc2\ +\xc2\x26\x40\x40\x89\x19\x33\x21\xbc\x36\x8b\x8c\x62\xe6\xf4\xfb\ +\x03\xa9\xb6\xd3\x0a\xcd\x44\x29\x3e\xc2\x2a\x1d\x3d\x33\xc6\xa1\ +\x45\x03\x11\xf0\x47\xe3\x87\xc2\xae\xea\xf4\x8d\x0f\xc5\xa2\xb1\ +\x53\xa3\xcb\x7b\xe2\xf2\xe7\x37\x41\x2f\xd8\x84\x36\xb4\x80\x1e\ +\x29\x86\x3f\xc5\xf3\x9f\xf0\x8f\x2f\x60\x44\x35\x0b\x97\x01\x5e\ +\xc5\xc7\x5e\x91\x0e\x5c\x27\x2a\x8a\xbc\xb2\xd8\xd3\x8a\x4c\x6c\ +\xb1\xd6\x5d\xa2\x61\x77\xa8\xaf\x2e\xc8\xb1\x7c\x50\x58\xeb\x2e\ +\xcd\x35\x37\xce\x27\x94\xa4\x08\xe0\xf3\x9b\x57\xab\x33\x6c\x60\ +\x4b\x49\xe6\x93\x6e\x65\x61\x57\xcd\xce\xba\x6e\x61\xc7\x62\x0d\ +\x46\x99\x8d\xd7\x8d\xa9\xcc\xc0\x9e\xee\xc8\x79\xb9\xb3\x22\x9e\ +\xce\xef\xad\xb6\xdb\x1a\xc1\x20\x65\x55\x49\xa4\x8a\xad\x6c\x63\ +\xa7\xa4\xa8\xbe\x4f\xe6\x38\x32\x90\xd5\xb2\x55\x2c\x47\xd6\xcb\ +\x82\x26\x0a\x45\xa6\x2c\x2d\x58\x4b\x21\xbb\x29\xba\x73\x8e\xa4\ +\xd3\x84\xd9\xb6\x2c\xd0\x2a\x19\xb2\x0c\x5a\x2b\x52\xb0\xa2\x08\ +\xfb\x34\x94\x43\x98\xaa\xe2\x10\x68\x2a\xb9\x23\xcc\xae\xcb\x6c\ +\x1c\xc4\x93\xb9\xe5\x34\x61\x91\x2d\x57\x3a\xff\x9e\xb5\xcd\x87\ +\x52\xca\x59\x9e\x24\xe5\xb6\xd1\xb4\x82\x75\xad\x64\x22\x03\x35\ +\x26\x60\x74\x16\x72\xb6\x17\xe1\xf7\xfb\x78\xfd\x03\xa2\x28\x62\ +\x2f\x88\xe8\x13\x32\xee\x4f\x88\x22\x85\x2c\x1d\x33\x0e\x22\xa2\ +\xfe\x80\x47\x7b\x3e\xf9\x71\x7c\xa1\xdd\x5b\x75\xb9\xec\xa2\x91\ +\xf9\x4d\xf0\x40\x75\x46\xa8\xf9\x88\xcc\x4f\xf1\xfc\x50\x06\x70\ +\x99\x5d\x65\x51\x98\x1c\x3f\x59\x1f\x9b\x44\x17\x30\xb1\xeb\x44\ +\x73\x59\xbc\x2c\x06\xcb\xf0\xe9\xaa\x16\x57\xd6\x2c\x36\x94\x58\ +\x66\xe1\xd5\x8a\x66\xe2\xfa\x35\xd1\xdc\xb8\xb4\xbe\x8c\x65\xd5\ +\x45\x16\x0e\xc4\xba\x86\x24\x88\xd0\x6d\x93\xa4\x92\x8d\xa3\x39\ +\x18\x81\x84\x0f\x65\xfb\x39\x48\x27\x04\x86\x72\xa1\x39\x92\x9b\ +\x75\x9c\xda\xac\x4d\x5d\xe5\x89\xf5\x40\xc5\xd6\x52\x19\xc0\xe5\ +\xd8\x7f\xc9\xb1\x2c\xcc\xef\xdf\x9a\x5d\x07\x06\x22\x38\x0f\x73\ +\x7d\xe6\x8a\x59\xb4\xac\xcb\x2e\xa0\x9c\x76\x06\xd4\xb2\xf5\x8b\ +\x65\x8a\x0e\xdc\x39\x0b\xd4\x28\x0c\xa5\xc8\xa7\x0c\xd4\xb2\x79\ +\x51\xbe\x5e\x85\x1e\x56\xa4\x10\xa0\x16\xde\x6b\xa2\x71\xa2\xf8\ +\x81\xcc\xbe\x0b\xb9\xd8\xa3\x91\x36\xb2\x62\x0b\xa9\x60\x40\x72\ +\x6c\x49\xfd\xc8\x5f\xba\x02\x3f\x9e\x57\x1b\x1c\x6c\x5f\x97\xc1\ +\x29\x57\xe5\x56\x27\xb0\xab\xcd\x8c\x02\x22\xd8\x96\x45\x73\xbd\ +\xc7\x71\xfa\x06\xdf\xf7\xbe\x0a\xfa\x9b\x8c\x03\x85\x86\x2d\x4c\ +\x62\xfa\x39\x78\x9e\x90\x03\xb6\xfa\x23\x46\x67\x21\xc9\xde\x23\ +\xe2\xf0\x00\x2f\x5a\xc5\x68\xf5\x58\x5d\x5d\x92\xed\xe7\xd5\xd5\ +\xa5\x59\x57\xcc\xd1\xc0\xed\xe0\x45\xcf\x92\x29\x4d\x09\x15\x0c\ +\x7f\x2a\x03\x30\x4e\x22\x19\xbc\xaa\xbe\x4c\x9c\x44\x68\x0c\xe7\ +\x82\xb7\xcc\xca\x25\x6e\x4e\xec\x09\x78\x22\xa0\xdd\x3c\x9a\x73\ +\xdc\x15\xc1\xdc\xc1\x68\x9a\x28\xb5\x45\x1a\xf6\x25\xea\xab\x97\ +\x59\x1d\x45\x1c\x36\x4d\xc6\xc7\x29\x76\x5b\xc3\x5c\x5d\x67\xe9\ +\xa9\x45\xec\x92\x7a\x8c\x14\x92\xca\x25\x3c\x2a\x82\xcc\x53\xf3\ +\xb9\xbd\xd7\x65\x20\x27\x81\x3a\x17\xc0\xb6\x56\x97\xef\x6f\x55\ +\x57\x01\xe0\x4f\xa3\xbf\x37\x63\x97\x81\x5d\x16\x75\xe5\xe3\xb3\ +\xa2\x71\x33\x3e\xf5\x64\x16\xae\x76\xf0\xec\xb6\xc6\xaa\x16\xc8\ +\xef\xe1\xa9\x0e\x0d\x5b\x7c\x9f\xaa\x12\x4e\x8f\x8a\x0e\x9b\x9c\ +\xce\xb0\x2a\xc6\x29\x9a\x0a\x56\x77\xbe\x0d\x1d\x4e\x24\x37\x25\ +\x16\xd3\x98\x78\xc5\xc4\x47\xc7\x34\xf1\xa3\x90\x7a\xd1\xcc\xa8\ +\x0f\x8e\x50\x8a\x3d\x64\x81\x95\xa1\x98\x39\x5b\x96\x85\x43\x26\ +\xa8\xae\x28\x92\xd8\x59\x29\xb7\x29\x99\x39\xa3\xde\x08\xa5\xdb\ +\x04\x84\xcb\xbc\xae\x3e\xc7\x78\x75\xc2\x33\x4b\x0f\x81\x2f\x14\ +\xdb\x94\x94\x73\xeb\xc1\x22\x89\xc6\x75\xd3\x82\xa8\x47\xdf\xdc\ +\xe7\xdd\xdd\x3f\x83\xf4\x35\x00\xde\xef\x89\xbf\xf1\xb9\xa5\xcf\ +\x22\xfc\xf5\x2c\x3a\xb6\x49\x98\x5b\xdc\xed\x8f\x21\xab\x73\x7c\ +\xf8\x16\xc3\xe4\x16\xf0\x80\x9b\x2b\x87\xb2\x95\x6c\x58\x6b\xac\ +\x71\x20\x0d\x00\x0f\x8a\x6e\x82\x72\xe6\xd3\x48\xf6\x64\xa6\x2c\ +\x31\x6d\x6f\x00\xdd\x36\x68\x83\x21\x29\x2d\xd2\x4a\xf1\x56\x3e\ +\x2e\x03\xb8\x84\x14\x71\x12\x41\x1b\x0a\xef\x6b\x12\x7b\x82\x17\ +\x08\x26\xa3\x15\xd4\xc8\xfc\x1a\x6e\x3e\xa2\xab\x2a\xac\x3a\x16\ +\xd7\x36\x35\x16\xb4\x36\x93\xc3\x3d\x0e\x57\x2f\xcb\x69\x88\x35\ +\x33\xc1\x59\xde\xc7\xb4\xae\x91\xb2\xc0\x70\xd8\xc2\x69\x0e\xd0\ +\xbc\x13\x52\x77\xe6\xdd\x90\xd8\xe0\x06\x2a\x04\xc5\xff\xd6\x36\ +\x99\xd9\xbb\x22\x03\x53\xf0\xbf\xa9\x74\xcd\xbc\xe4\x19\xf8\xae\ +\xc8\xd4\x83\x82\x27\x16\x81\x6d\xcb\xe2\x2f\x09\x22\x9a\xe4\xc2\ +\x80\xbb\xd0\x58\xf4\x93\x10\x5d\x9d\xf1\xcd\x79\xbf\x28\xc2\x17\ +\x5d\xa6\xda\x3a\x67\xe1\x2e\xab\x35\x75\x2e\xa0\x0f\x53\x9b\x85\ +\x51\xb1\x6a\xb7\xe0\x99\x1b\x8e\x03\xc1\x0c\x17\xab\x06\xa1\x98\ +\xce\xc0\x22\x0e\x15\xfa\x05\x4e\x09\x34\x55\x72\xc3\xe5\xe4\x72\ +\x75\x49\xa2\x16\x2a\xf2\xd2\xaf\x87\x82\x9a\xb2\xa2\x08\xd7\xcf\ +\xd1\xc3\x10\xe5\x60\xca\xe9\x78\x91\xbc\xf7\x50\x16\x81\x66\xa7\ +\x23\x9c\x30\x9f\xd0\x02\x2e\x0b\x44\xd3\xb2\xb8\xb4\x7e\x95\xc4\ +\xb2\xa4\xa6\xe1\xda\xe5\x90\x56\xf0\xf3\x1c\x6c\x5f\x17\x2a\xb5\ +\x48\xe1\x71\xd8\xe3\x9d\xed\xbf\xe4\xfb\x93\x2d\xfc\xa8\x3f\xd7\ +\x8a\xf4\x92\x8c\x1d\xf5\x88\x77\xb7\xfe\x07\xde\x3f\x79\x55\x06\ +\xaf\xbc\x64\x27\x19\x53\x42\x82\xa8\x47\x18\xf6\xa1\xd0\x8f\x1c\ +\x9d\x9e\x31\x7a\x0c\xde\xf1\xdb\x73\x1a\x61\x63\xc5\x94\x73\x74\ +\x6b\x35\x4b\xb6\x8c\x95\x33\x5f\x52\x5e\x73\xf4\x53\x50\xa7\xab\ +\x41\x6f\x20\x02\xf6\x49\xb0\x41\x14\xca\xc3\x39\x66\x42\x69\x2a\ +\xf4\x33\x05\x75\x34\x00\xb7\x60\x30\x98\x1d\xc7\x4c\xe9\xb6\x2c\ +\x8c\xa6\xc9\x95\x7a\x8b\xfa\x69\x93\x83\x74\x47\x66\xe2\xea\x6d\ +\xa9\x75\x93\xd5\x85\x18\x27\xf6\x69\xeb\x23\xb9\xba\xa1\x84\x0f\ +\x26\xd0\x0d\xce\xd9\xd8\x06\x62\x61\xa2\x5d\x3e\xef\x09\x61\x8f\ +\x1d\x84\x22\x48\xbd\x29\x76\x6f\x82\x4f\x82\x3a\x39\x12\xc1\x3d\ +\x6e\x90\xa7\x9e\xc4\xd8\xd5\xa6\xc7\x79\x46\x63\x3e\x33\x8f\x59\ +\xec\xb4\x65\x26\x06\x61\x81\xf0\x24\x58\xa1\x36\x05\x84\x28\x33\ +\xf1\x38\x10\x22\x7b\xd5\xf7\x05\x3b\x11\x63\xc9\x81\x4f\x2c\x93\ +\xe6\x13\xd8\x89\xaa\x07\x9b\x55\xc2\x0f\xc1\x42\x91\x04\x3a\x56\ +\x2a\x2a\xfd\xb0\x1f\x31\x1a\xa6\x58\x7d\x8d\xe3\xbc\x4f\x53\xc9\ +\x88\x6e\x6c\xca\xc5\x8c\x73\xad\x67\x33\x2f\x4c\xb4\xc5\xd1\xb2\ +\x04\xcd\x56\x62\xe0\x52\x34\x5f\x42\x99\xa1\xfd\x9b\x22\x10\xa2\ +\x0e\x29\x21\x5b\x8f\xbf\xcb\x1f\xde\xfe\xb7\x7c\xf3\xce\x7f\xcf\ +\x7b\xdb\xaf\xe2\x85\x33\x06\x21\x1f\x4e\x38\x39\xfe\xd3\xb9\xe0\ +\xad\xde\x37\xf5\x08\xb3\xd3\xc6\xe9\x74\xb0\x3a\xe2\x32\xd9\x31\ +\x42\x76\xa3\x43\xb1\x5e\xab\xd5\x9b\x5b\x49\x50\xfa\x0f\x67\xe1\ +\x89\x14\xed\x94\x01\x3c\xb4\x3d\xdc\x7c\xc6\x34\x94\xc7\x5e\x3a\ +\x1f\xac\x4f\xba\x95\x01\x5e\x32\x15\xf9\x28\xa7\xa3\xe6\xa8\xfa\ +\xf2\x1c\x35\x57\xb6\x8f\xdd\x5c\xb0\x11\x6b\xdd\x25\xce\xda\x2e\ +\x93\xc5\x11\x6b\xda\x15\xc6\xc7\x29\x87\x85\xfc\x32\x18\xa4\xdc\ +\x3b\x78\xc4\x64\x6f\xc0\xe5\xf6\x0d\x6a\xed\x53\xc8\x66\x7c\x6b\ +\x9e\x7a\x12\x2e\x8c\x2a\x7b\x33\x66\xcf\x47\x8c\x50\x64\x20\x27\ +\x41\xc4\x70\xe0\x11\x1f\xf8\x0c\x07\x1e\xc3\x81\xc7\xe8\x6c\x9b\ +\xfe\x63\x83\x24\x88\x38\x53\x4f\x18\x8c\x12\xf2\xc1\xa8\x08\x76\ +\x4d\xb2\x12\x81\x9d\xcf\x69\x2a\x3a\x6a\x3a\x87\x99\x8f\xb3\xf9\ +\x93\x48\xee\xa8\xae\xdc\xaa\x70\xa2\x84\x11\x25\x53\xe1\xa9\x8e\ +\xb0\xb1\x32\x08\xe5\xe8\xbd\xc1\x6c\x4c\x47\x21\x90\x10\x22\xaa\ +\xd0\x66\xe5\x06\x24\x2c\x13\xc7\xb4\xd0\xed\x44\x70\xbc\xe9\xfc\ +\x2f\xe0\xda\x2d\xd4\x56\x87\xdc\x12\x70\x22\xd4\x22\x29\x34\xaa\ +\x1a\x4b\x95\x38\xdb\x27\xc4\x2a\xb4\x0d\x61\x18\x11\x86\x82\x4b\ +\xb6\x2c\x93\x38\x9a\x15\x00\x86\xd9\xe7\xbd\xed\x57\xb9\x7d\xfa\ +\x15\xa1\x05\xd8\x4f\xb8\x7d\xfa\x15\xee\x9e\xfc\x2e\x3b\x93\xad\ +\x42\xfa\xf8\x06\xef\x9f\xbc\xfa\xa1\x18\xcd\x30\xfb\x95\x6a\xdd\ +\x22\xc2\xe2\x74\x30\x60\xc3\x5c\x2d\x34\x9f\x5d\x28\xda\xb8\x07\ +\xd3\x90\x83\x69\xc8\xfe\xbd\x23\xee\xef\x85\x73\xc5\xd5\x98\x29\ +\x7a\x50\xc7\x53\xcc\x19\x1c\x28\x82\x52\x63\x38\x07\x1f\x3e\x2c\ +\x90\x65\xa1\xa8\x21\xb3\x77\x19\xd4\x55\x1a\xae\x6c\xb2\xac\x3a\ +\x0a\x1f\x69\x74\x58\x6e\xc6\xac\x69\x57\xd0\x33\x31\x6c\x3a\x39\ +\xdc\x93\x9f\xf7\x68\x3b\xe5\x7f\xfc\x3f\xfe\x6f\xfe\xe8\xab\xbf\ +\xc3\x5a\x57\x5c\xa5\x9c\xe4\x54\x0c\x85\x7a\x39\x79\xea\x89\x8f\ +\xc1\x48\x7c\xa4\x9e\x78\xbe\x7c\x3c\x18\x31\x4c\x7d\x46\x28\x34\ +\xc9\xe5\xd8\x51\xab\xed\x16\xc5\xee\xa2\xc4\xc2\x6a\x14\x63\xb0\ +\x28\x5f\x8b\xbd\x93\x4a\x16\xae\xcf\x4d\x48\x97\x54\x5b\x19\xd8\ +\xba\x3a\xdf\x44\x3a\x9f\x89\xed\xb6\xc6\x59\xc7\x44\x2f\x78\xe2\ +\xb2\xa0\x2b\x27\xa7\xdd\xcc\x17\x23\xfb\xf1\x39\xf2\x45\x0b\x15\ +\xcc\x62\x3a\xa3\x1c\x10\x35\x08\xe9\x17\xa3\xf9\x17\x6e\xc5\x42\ +\xc6\xc0\xb1\xc5\x0a\xad\xae\x41\xb0\xd6\x82\x4e\x07\xbf\x58\x38\ +\x5e\x2e\x61\xec\x17\xcd\x94\xf4\x1c\xe3\x21\x99\x0d\x98\xe3\xaa\ +\xa5\x9a\xce\xb2\x68\x05\x3f\xcf\xd0\xfe\x4d\x3c\x7f\x55\x06\x6f\ +\x79\x7b\x6f\x38\xe6\xfd\x93\x57\x19\x1e\xdd\x63\x67\xb2\xc5\xd6\ +\x4e\x32\xf7\xfa\x05\x36\x20\xea\xcc\xf1\xca\x7a\xa7\x49\x72\xea\ +\x32\xda\x9f\x59\xb7\x32\xec\x4a\xfb\x56\xe5\xcc\x67\xe0\x88\xe0\ +\xea\x0d\xfa\x92\xa7\x6d\x30\x6b\x09\x97\x4c\x44\x57\x9b\x65\xd9\ +\x38\x89\x18\x28\xf9\x85\x40\x2e\x9f\xab\x06\x70\x2f\x85\x61\x3a\ +\x9c\x2b\xf4\xca\xa3\x9b\x47\x74\x5b\x16\xd7\x5b\x1e\x57\xea\x2d\ +\x26\x8b\x23\x09\x25\x76\x72\xc1\xa2\xd4\x57\x2f\xcf\x7d\xcf\xfb\ +\x5b\x11\xaf\xff\xc6\x9f\xf1\x27\xbf\xfd\x7d\x8c\x56\x46\x9e\x77\ +\xc9\x07\x23\xc6\x76\x0d\xbc\x5c\x7c\x80\x98\x60\xf6\xf2\xd9\x24\ +\xb3\x5d\x34\x7b\x8a\xd7\xcb\x40\x6e\xb5\x5d\x70\x6b\xb4\x36\x16\ +\x38\x53\x33\x5a\x6d\x17\xa7\xb6\x8a\xd5\x71\x49\xdc\x06\x7a\x4f\ +\xb4\xe4\x5a\x9a\x43\x60\x5b\xb3\xc9\x8f\x0f\x29\xf4\xb4\x40\x23\ +\xc9\xba\x12\x13\x97\x38\xb8\x9a\x8d\x83\x41\x4a\xbd\x7f\x89\x44\ +\xf5\xe7\x98\x8d\x5e\x52\xe1\x2d\x47\x0a\xba\x59\x76\xa3\xc3\x88\ +\x18\x05\x2d\x0a\x49\x02\x5d\xb4\x7d\x43\x55\x58\x3f\x15\x7b\xe8\ +\x64\xfe\x54\x02\xc1\x2f\x16\x63\xfd\x3d\xec\x02\x8e\x88\xa0\xec\ +\x17\xcb\x5c\x3a\x45\x9f\x3b\x04\x52\xcb\x22\xe9\x0b\xa1\x91\x63\ +\xe5\x85\x6e\x19\xe9\x3e\x24\x79\x64\xb2\x42\x46\x54\x6a\x76\xcc\ +\xd9\x04\x09\xc2\x27\x78\x6b\x67\x3e\x40\x9f\x6d\x35\x78\x6f\x38\ +\x06\xbe\xc2\x0b\xfc\x02\x5b\x5b\xdf\x84\x96\x08\xf4\x6b\xeb\x17\ +\x3b\xeb\x7b\xa7\x11\x8b\x49\x0f\x55\x6b\xd0\x98\x4c\x79\xe4\x3f\ +\xe4\xd1\xfd\x77\x8a\xe5\x8a\xd0\x67\xb6\xf5\xb3\xf9\xa1\xce\xa2\ +\x00\x00\x20\x00\x49\x44\x41\x54\xcf\x1a\x9b\x3f\xb4\xc9\x95\xe3\ +\x98\x38\x3c\xe0\xee\x23\x9d\x31\xe0\x72\x28\xcd\xfc\x44\x37\x6d\ +\x02\xa3\x7c\x0e\x46\x9c\xc7\xbf\x29\x2d\x06\x4a\x4e\x3b\x9f\xbf\ +\x8c\xf6\xd2\xd9\xeb\x55\x48\x12\x27\x11\x5d\x8d\x82\xf9\x88\x49\ +\x1a\x62\x9a\xf2\x78\x64\xb0\x10\x3c\x46\xc7\xa4\x7e\xda\x84\x65\ +\x18\x1f\xa7\x34\x96\x35\x29\xd4\x87\x7b\xfc\xd1\xde\x19\xfe\xd7\ +\xfe\x98\x6b\x4f\xdf\xc2\x5d\x54\xa1\x09\x8d\x51\x07\x5c\x05\x45\ +\x73\xc9\x53\x4f\x64\xe7\x36\xa2\x08\x5b\xcb\x59\x0b\x14\x46\x45\ +\x07\xae\xcc\xd0\x07\x76\x8d\x86\x16\xe3\x8f\x1d\xdc\x4c\xa1\xd5\ +\x76\x19\xa6\x3e\x8a\xa6\x30\x0e\x23\x16\xac\xc7\x64\xdd\x0d\xa0\ +\xf7\xa1\x38\xb8\xda\xae\x2e\xa7\x3e\xf4\xa0\x27\x31\xf1\x74\xe3\ +\x59\x59\xd8\x55\x6f\x0e\x3b\xc0\x75\x92\x24\x44\xd1\x5b\x24\xc9\ +\x2c\xa0\x3d\xd5\x99\x37\x4f\x31\x81\xa4\xd8\xf3\xac\xdb\x89\x64\ +\x14\x88\xc2\x79\x5f\x89\x73\x78\x19\x20\x33\x67\xff\x94\x7e\x14\ +\x51\x37\x33\xea\xa5\x1d\x7d\x81\x7b\x35\x2c\xb9\x0f\x3a\xec\x47\ +\x72\xa8\xb4\xc4\xbf\x5a\xa8\x08\x0e\x38\x8c\x24\xa4\x98\x1b\xa8\ +\xdc\x7c\x88\x77\xf7\xe7\x48\xb2\x77\x49\x86\xbf\x07\x20\x03\xf4\ +\xd1\x7e\x22\x03\x79\x6b\x27\x61\xd0\xba\x3f\xbb\xb4\x3e\x21\x23\ +\x5f\x5e\x34\x51\xb5\x06\x1d\x05\x46\x63\xbf\x22\xfa\x3f\x60\x7b\ +\xf8\x00\xff\xd1\x2e\xdb\xc3\x07\xbc\xf5\x78\x9b\x38\x3c\x60\x5d\ +\xd7\xf9\xdc\x67\x9e\xe2\xd6\x17\x7e\x94\x9f\xf8\xb1\x4d\x9e\x7b\ +\xf6\xd2\x1c\xd5\x56\x16\x5f\x55\xaa\x4c\x63\xc8\x40\xc9\x59\xc8\ +\x47\x0c\x94\x5c\x06\xe8\xf9\x00\xae\x06\xf8\x93\x20\x47\xa6\x34\ +\x59\x6c\xc6\x5c\x59\x13\x19\x7f\x67\x32\xfb\x9c\xe3\x91\xc1\x64\ +\x71\x84\x9e\x1d\x62\x5f\x3e\x65\x7c\x3c\x0b\x9e\x9b\x9b\xd7\x71\ +\x17\x37\x79\x63\x47\xe7\x95\x3f\xfa\x6d\xe8\x17\xfc\x7d\x77\x8a\ +\xa2\xb9\x24\x76\x86\xa2\xb9\x45\x07\x4f\x64\xdc\x24\x50\x8b\x2c\ +\x9a\xa1\x17\xaf\x1b\x6b\x0e\x4e\xcd\x44\xd1\x5c\x94\x68\x82\x3f\ +\x15\x18\xb9\xa5\x39\x78\x6a\x8e\x1a\xc5\xe4\x66\x9d\x8c\x1e\x81\ +\x9d\x4b\x03\x42\x89\xe5\x3d\xe7\x89\x74\x1b\x34\xe6\xd8\x89\x5a\ +\xba\x7f\x21\x80\x57\x95\x04\xbf\xb3\x39\xd3\x6a\x90\x0a\x96\xa2\ +\x80\x16\x49\x12\x8a\x4c\x5c\x95\x81\x39\x66\xb1\xe3\xc8\x2c\x3a\ +\x5c\x85\xc8\x47\xc3\x22\x0e\x23\x34\xcb\x9a\x2b\xf6\xca\x72\x6d\ +\x12\x05\xa5\x4e\x4c\x14\x86\x51\x50\x74\xc7\x66\x66\x24\x32\x53\ +\x47\xb3\x8e\x1c\x56\x86\x92\xd6\x09\xe2\x44\xb6\x8d\xe4\xe2\x46\ +\x39\x6d\x91\xe3\x14\x13\xd9\x49\xf2\x2a\xf0\x45\xf4\xd6\x97\x09\ +\xe3\x5f\xe5\x51\xc1\xc4\x5c\x5b\xd7\x79\x6f\x38\xe6\xd9\x56\x83\ +\xb7\xf6\xbf\xc2\xdb\x6f\xde\xe2\x63\x2f\xde\x9b\x0b\x74\x39\xab\ +\x95\x3f\x85\xdb\xe9\x60\x91\x11\x46\x0a\x9b\x37\xdb\x6c\xd2\xe6\ +\xf2\xa2\xc9\x4b\x67\x9f\xe2\x2c\x0f\x49\x0e\x07\x72\xed\xed\xf6\ +\xf0\x01\x93\x57\xef\xf2\xe8\xfe\x03\xae\xdd\xbc\xc1\xb5\x4f\xa9\ +\x2c\xbc\xf3\x14\xb7\x4f\x7a\xb0\x53\x71\xc3\x29\x34\x0f\xe5\xed\ +\x4c\x69\xa2\xa4\x1e\x67\x5a\x93\x85\x7c\x34\xc7\x52\x68\x0c\xe9\ +\x65\x0a\x2d\xb5\xf9\xa1\x01\x5c\xc2\x92\x6e\x33\x96\x33\x73\x92\ +\x2b\x3e\xde\x23\xa8\x2d\x62\x03\xb5\xd1\x63\x76\x9a\x97\xb8\xb2\ +\x03\x8d\x55\x0d\x8e\xc4\xc9\x78\xea\x9d\xb0\xe8\x2e\xd1\x1b\x8d\ +\x38\x7a\xbd\xcf\xdb\x1f\xf9\x16\x9f\xfc\xc9\x97\x60\x0c\x89\x9d\ +\x11\x45\x21\x4e\x31\xfe\x1e\x16\xa6\x7e\x4a\x34\xc1\x2c\x82\xda\ +\x84\x4a\x8b\x5a\x50\x72\x6b\xd4\x19\xa1\x90\x07\x53\x86\xa9\x8f\ +\x65\x37\xe8\x99\x06\x6e\xa6\x10\x14\x63\x4d\xea\xe4\x88\xac\x58\ +\x28\xa3\xeb\x16\x49\x31\x39\x5d\x35\xe3\x2e\x19\x6f\xa5\xa3\x5e\ +\xc8\xc4\x55\x6c\x5c\x4e\x76\x64\x23\x31\x0d\x9a\x24\x21\xa5\x53\ +\x4a\x13\x4d\xe4\xfd\x66\x5e\xf0\xc4\x72\x70\x31\x87\x50\x21\xb4\ +\x72\x0c\x59\xd0\x39\x18\x84\x84\x16\x72\x71\xf9\x6c\x1a\x4f\x3c\ +\x6e\x9e\xc3\xca\xa5\xdc\x32\x2e\x9c\x34\x4d\x29\xd5\x01\x8a\xac\ +\x1d\x10\x02\x2e\x81\x96\x60\x39\x3a\x61\x98\x14\x5d\xc0\x59\x6b\ +\x58\x37\x33\x32\x9a\xd4\x8a\xe0\x1b\xb4\x5e\x01\xbe\x48\x32\xfc\ +\x3d\xac\xac\xce\xb5\x75\x9d\x47\xfb\x02\xff\x3e\xbb\x2e\x32\xb1\ +\x45\x5d\x06\xf0\xf9\xdb\x33\x5d\x85\xd6\xca\x2d\x08\x1b\xf4\x95\ +\x00\xc2\x08\x6f\xff\xa8\x70\xfb\x11\x96\xfb\xc9\x24\x81\xe5\x7d\ +\x7e\x64\xfd\x69\xec\x8f\x76\xc9\xc6\xbf\xc4\x07\xdf\x7e\xc8\xdf\ +\xfe\xcd\x5f\xb1\xb7\x1f\xf2\x77\xbf\xe1\xb0\x6a\xbc\x22\xe9\xb6\ +\x83\x05\xc1\x54\xe8\x41\x1d\x37\x8f\x28\x4b\x15\x25\xf5\xc8\x35\ +\xf7\x42\x00\x0b\x38\xd1\xa2\xa5\xc2\x30\x1b\xa1\x07\x36\x0d\xe7\ +\x43\x8a\x3f\xb7\x03\x44\xc4\xa3\x88\xc3\x0a\xc4\x5a\x75\x14\xf2\ +\xe9\x29\x41\x7f\x91\x40\x69\xa2\x37\xcb\xe0\x4e\x4b\x89\xb8\xa0\ +\xfd\xbc\x13\x16\x9b\x37\x78\x5b\x39\xa0\x7b\xf0\x88\x6b\x0f\x6e\ +\xe1\x5c\x5b\x64\x1c\x8a\x55\xc0\x5e\x34\x9b\x7a\x51\x08\xc8\x4d\ +\x9b\x28\x0a\x30\x4d\x8b\x24\x50\x49\xec\x0c\x93\xa0\xa0\xcf\x54\ +\x02\xdb\xa4\x1d\x58\xf4\x19\xd1\xd2\x1c\x46\x41\x97\x66\x31\xf8\ +\x59\x76\xf7\xec\x69\x97\x32\xa3\xc9\xac\xeb\x4d\xb1\xcf\x65\xe8\ +\x71\x00\x49\xd6\x65\xb4\xbf\x3b\x87\x89\xab\xd9\xb8\x2a\xc5\xac\ +\x4e\x8b\xb8\x99\x4f\x2f\xd3\x68\x35\xad\xc2\x64\xbb\x12\xc0\x31\ +\x16\xe1\x79\xdd\xb0\x99\x12\x87\x0a\x56\xa8\x30\x31\x85\x54\x4f\ +\xc3\xfa\x7b\x2b\xed\xf2\xc4\xc8\x4c\x45\x32\x1e\x73\xf2\x4e\x20\ +\xed\x98\x44\x1d\xbd\xe8\xda\x95\x8d\x13\xf1\x7d\xc7\x56\x46\xcd\ +\x74\x51\x69\x52\x37\x67\x99\xb4\x3d\xbc\xc9\xee\xc1\x26\x7a\xeb\ +\xcb\x73\x50\xa1\xcc\xb6\x96\x2f\xde\xbd\xb7\xdf\xbc\x45\xe8\x4c\ +\x2e\xfc\x5e\x35\xf5\xbf\xc1\x9a\x5e\xe2\xc4\x3f\x65\xb4\xd7\x67\ +\x74\x16\xb2\xb5\x1f\xf0\x68\x7b\x97\xec\xf6\x6d\x1e\x6d\x6d\x13\ +\xee\xff\x2d\xea\x96\xc6\xde\xfd\x3f\x67\xe1\x83\xbf\xe3\x73\x37\ +\x1e\xf3\x33\xff\xf2\x13\xfc\xea\x6f\xfd\x77\xfc\x4f\xff\xe6\x7f\ +\xe7\x67\x7f\xea\xd3\x18\xd6\x1a\x77\x1f\xe9\xdc\x7d\xa4\xe3\x6f\ +\x9f\x48\xa1\xba\xa7\x98\x73\x81\xd8\xce\x67\xae\x8f\xe7\xe1\x03\ +\x40\x4b\x6d\x5e\xa0\xdc\x4a\x96\x02\xb7\x33\x9b\x6a\xfe\x30\xf1\ +\xcd\xf4\x94\xb3\xb6\x2b\x70\xf1\x13\x6e\xca\x66\x4b\x4c\x44\xe7\ +\x6b\xd4\x4f\x9b\xec\xe5\x6d\xc2\xa2\x59\x55\xf2\xc6\x4a\x34\x41\ +\x21\xc0\xc9\x1a\x58\xa6\x58\x38\x5f\x72\xc9\x7a\xa0\x4a\xfe\xb7\ +\xec\xf6\x0d\xe8\xa3\xb4\x9b\x45\x21\xd7\xc7\x60\x71\xd6\xd5\x2b\ +\x68\xb9\xf3\x1d\xbd\xf3\x10\x23\x48\xc5\xd8\xbe\x36\xec\xd3\x5c\ +\xdf\x98\xe3\x89\xab\x85\x5d\x75\xc6\xae\x4a\xd1\x8d\x5c\x85\x8e\ +\x2a\x6c\x00\xc6\xea\x14\xed\x17\xff\xeb\x2f\xff\x8a\x0e\xa8\x89\ +\x82\x9e\x24\xd4\x0c\x71\x22\xd5\x12\x05\x3d\x0a\xd1\x93\x04\xc5\ +\xd5\xd1\x0c\xd0\x93\x18\x8d\x84\x29\x86\xa4\xe5\x94\x22\x1b\xab\ +\x18\xe4\x24\x92\xaa\x8b\xb1\xa8\x25\xb3\xcf\x51\x99\x71\xc5\x96\ +\xa1\x93\x62\x54\x8c\xe0\x22\x62\x55\xc1\x30\x74\x30\x4d\x6c\x1d\ +\x14\xea\xd4\x4d\x9d\x20\xb3\xc8\xb5\x3a\x5e\x36\xe2\x71\xfe\xef\ +\xb8\xba\x92\xe0\x0d\x3b\x1c\xbe\xb1\x8d\x72\xa9\x18\x25\xf2\x32\ +\x3a\x4d\x95\xc3\x3c\xc4\x98\xea\x2c\xaf\xf6\x30\xa6\xfa\x1c\x66\ +\xfe\xcc\x8d\xcf\xd3\x5d\x79\x89\xae\xbd\x44\xbd\x6e\x50\x37\x14\ +\xb2\x85\x36\x76\xb6\xc6\x7e\xf2\x01\x77\xb6\x15\x26\x83\x6d\xa6\ +\x6a\x9d\xfe\x60\x80\x91\x65\xec\xbd\x99\xf3\xc6\x5f\xff\x21\x6a\ +\xf8\x3a\x6b\xa9\x4f\x67\xc1\xe3\xb3\x3f\xb4\xc6\x17\xfe\xe9\x97\ +\x59\x79\xee\x29\x06\x93\x6d\x1e\xef\xe8\x4c\xa3\x13\xe2\x72\xb7\ +\x71\x26\x7e\x66\x3a\x56\x09\xf5\x31\x2d\xb5\xc9\xd8\x8f\xa9\xd5\ +\x04\x3e\x48\xfd\x84\x7a\x2d\xc6\xf7\x35\xac\x9a\x2f\x77\xb4\x69\ +\x0c\xd1\xf5\x36\x75\x37\xa1\x6b\x59\x84\xb9\x8e\x55\xc9\x44\xd9\ +\x24\x91\x1f\x43\x2f\xa1\x55\xac\x9f\x5d\x4d\x14\x8c\xc6\x21\x8e\ +\xd9\x64\xd8\xee\xa3\x9b\x8b\xf8\x9e\x4a\xcf\x88\x51\xce\x7c\x2c\ +\x25\xe1\x99\x4f\xac\xb0\x70\xe3\x32\x2d\xd7\x66\xd5\x5d\xa6\x96\ +\xe5\xc4\x9a\x82\x12\x65\xc5\x32\x4a\xa8\xe5\x35\xd4\x58\xa1\x5e\ +\xc1\xec\xbe\x3a\xa6\x96\x8b\x00\xcc\x8c\x29\x09\x31\x6a\xdc\x25\ +\x1f\x3c\xa6\xd6\x71\x38\xeb\xeb\x9c\xa9\x27\xb4\x8c\x04\xd7\x76\ +\x19\x4d\x5b\x44\xe9\x09\x79\x6a\x52\xaf\x6b\x04\xe9\x04\x63\x9c\ +\x41\x79\x5f\x15\xef\x8d\xa1\xe6\xa4\xa9\x81\x5f\x5f\xe0\xcd\x6f\ +\x7e\x93\xe1\xe8\x84\x49\xbd\xc6\xc2\xd9\x19\x43\xd3\xc2\xd5\x14\ +\xf2\xec\x21\x6b\xaa\xcb\xc6\x33\x9b\xb4\xad\x0e\x51\xae\x12\xe5\ +\x85\x47\x45\x9c\xc9\x8c\xfc\x6b\xff\xe7\x1f\xa1\x0b\x6b\x53\x87\ +\x04\x5f\x98\xc1\x61\x61\x11\xcc\x74\x0b\xa6\x45\x1c\xce\xb2\x68\ +\x35\xb3\x96\xc1\x1a\x57\x38\xd7\x27\x57\xe6\xd6\xdc\x72\x9b\xb0\ +\x92\xad\x6b\xa1\x32\x6f\x08\x57\xb9\x1d\x4c\x32\xd6\xcc\x33\x0e\ +\x22\x91\x05\x1a\x87\x75\x0e\x82\xeb\x5c\xbd\xa2\xf3\xe7\xcf\x7d\ +\x89\x65\x7e\x67\xae\x80\x7b\x76\xbd\xc1\x23\x3f\x99\x7b\xee\xda\ +\xba\xce\x4f\x7e\xfc\x0b\x2c\x2d\xff\x27\x5c\xaa\x5f\x2d\x76\x74\ +\x44\xf2\x0a\xd0\x6f\x4c\x66\x45\xdd\x51\x4a\xef\xf6\xdb\x2c\x6f\ +\x74\x08\xba\x4b\x40\x1f\xbb\xb6\xce\x07\xbf\xb7\xc7\xdf\xd5\xff\ +\x3f\xae\x6f\xbe\x0e\xc0\x47\x3e\xb3\xc6\x27\xd7\x6e\xb1\xf1\x8f\ +\x3f\xc3\x6b\xee\x21\xb7\x4f\x74\xde\x7a\x73\x0b\xc3\x9f\xce\xb1\ +\x0f\x25\xe6\x05\x9b\xb1\x1f\x93\xd8\x21\x2d\xa7\x49\x4a\x8b\xa6\ +\x33\x94\x99\x57\x64\xab\x56\xf1\xae\x74\x8a\x63\xff\x43\xdf\xcf\ +\x72\xa2\xba\xf4\xb5\x98\x36\x2f\x09\xaa\xad\x07\x70\x0f\x75\x22\ +\x0c\x59\x0e\xfd\x14\x9a\xb0\xdc\x8c\x59\x6e\x5f\xe6\xc6\x66\xca\ +\x38\x99\x5c\xd0\xc7\x34\xe2\x0c\xb4\xf3\x97\xed\x1c\x37\x6b\xe0\ +\xa9\xb9\x94\xbd\x8a\x0c\xdd\x07\x57\x11\x8d\x92\xc6\x18\xb5\x1f\ +\x33\xb6\x6c\x8c\x54\xa3\x49\x0f\x34\x87\x51\x01\x21\x12\x54\x90\ +\xf3\x95\x36\x78\xa1\xc8\xca\xde\x94\xc6\xba\x45\x6f\x5f\x70\xd8\ +\x49\xfb\x13\xac\xd6\x1e\xb0\xdd\xee\x4a\x38\xa1\xa8\xd7\x39\xcc\ +\x61\xc2\x31\x70\x4d\xb2\x1a\x1d\x35\x95\x7c\x71\x3f\x2b\xd6\x1d\ +\xa4\x1d\x13\xc2\x14\xbd\xf0\xee\x4d\xa2\x10\xaf\xd2\xc9\xd1\x41\ +\x42\x0c\x2b\x8c\x88\x2d\xeb\x42\x73\xc4\xac\x48\xfa\xce\x5f\x00\ +\x8d\x8a\xb2\x38\x0b\x15\x72\x2b\x90\x01\x3f\xb3\x69\x61\x7e\x2b\ +\x53\xc9\x48\x98\x11\x07\x91\xc9\x42\x9e\x31\x6d\x5d\x63\xaf\xbf\ +\xca\x20\xfb\x0a\xbb\xf7\xbf\xc4\xf2\xc2\xd7\xe7\x0a\xb8\xf2\x76\ +\x6d\x5d\xa7\x15\xfc\xfc\x5c\x97\xaf\x96\x3f\xc5\x7a\x7d\x79\x26\ +\x12\x2a\x30\x77\x33\xea\x73\x82\xc9\x60\xef\x69\xe0\x51\x65\x6a\ +\xb8\x4f\x3c\x8a\x88\x2e\xf5\x78\x6a\xba\xce\x71\xba\xc8\x71\x00\ +\x3b\x77\xf7\x50\x6a\x8b\xfc\x7e\xff\x80\x1f\x68\x6f\xd3\xe8\xde\ +\xa2\xd7\x9a\x70\x39\x5c\x27\x5e\x8d\x78\xf7\xf0\x08\x86\xa2\x62\ +\x6e\x34\x0d\x81\xd7\xba\xcb\x6c\x5c\xb6\x8a\x89\x66\x97\x2c\x39\ +\xa6\xa5\xb5\x80\xd6\x6c\xbe\xc7\x2d\x27\x34\x2c\x7a\x59\x9f\x5e\ +\x56\xdc\x1f\x86\xe0\x96\xcf\x9b\x52\xbd\x56\x8a\xee\x71\x2c\x76\ +\x26\x43\xae\xec\xc0\x6e\x6e\x90\x4f\x4f\x39\xf4\x73\x8e\x07\x42\ +\x73\xac\x3a\x1a\xbd\x6c\x84\xa2\x5e\xe7\xd9\x4f\x6a\xb8\x8b\x9f\ +\x20\x88\x54\xc2\x48\xc1\xcd\x14\xbc\x22\x38\x7d\x03\xdc\xac\x0c\ +\xdc\x2e\xd0\x17\x81\x1b\x08\xad\x76\x29\xa4\x8f\x0a\xd5\x9b\xa2\ +\xb9\x15\xe8\x98\x57\xc4\x43\x8a\xa4\xe6\x02\xb7\x81\x4e\x4e\x80\ +\x8d\x4d\x3a\x5f\xd4\xb9\x35\xe1\x0c\xd4\x12\x05\x7b\x4b\xbf\xc7\ +\xe1\x14\x36\x07\x3d\xb6\xdb\x5d\x09\x2d\x56\x95\x84\x3a\xcb\x73\ +\xf8\xba\xaa\x88\x93\x3c\xb1\xc4\xc3\x61\xb9\xdb\xcd\x22\x26\xc0\ +\x28\xd4\xfe\xfd\x0a\xbd\x16\x5a\x79\x91\x27\xac\x8b\x58\xf7\x5c\ +\xe6\x45\x1a\x70\xcf\xa8\x38\xd5\xca\x49\x8b\x6c\x3f\x1b\x37\x14\ +\x5b\x4a\xcb\x5d\xce\x16\x30\x54\x72\x3a\x39\x1c\x44\x26\x6d\xa3\ +\x41\x3f\xde\x23\xed\x9f\xd1\x79\x76\x8b\x6f\xfe\xfb\x5b\xc0\x7d\ +\xd8\xb9\xf5\xa1\x3f\xff\x6a\x7d\x13\x96\xf7\x99\x2a\x2f\x73\xb0\ +\x7d\x9d\xcb\x9b\x2f\x17\xeb\xc8\x84\x6b\x8c\x19\xaa\x58\x56\x46\ +\x88\x45\x3b\xe8\xd3\xd2\xef\xd1\x2b\xc4\xef\xdd\xd6\xec\x77\x0b\ +\x8e\x2c\x76\xd4\x90\x5e\x76\x57\x9c\x14\x2b\x21\xad\x74\x91\xe5\ +\xe9\x1e\xaf\xeb\x21\xda\xc0\xe0\x8a\xb9\xcf\x6e\xb4\x3e\x87\x83\ +\xc7\xea\x94\x06\x06\x5a\x73\x80\x9b\xb7\x00\x4b\x4e\x63\x64\xfe\ +\x06\xe4\x23\x32\xa5\x89\x8a\x06\x6e\x5f\x06\xf0\xe9\xc8\x60\xb1\ +\x09\xbd\x61\x48\xcf\x35\xc1\x0d\x81\x0e\xbd\x61\xbf\xb8\x2f\xfc\ +\x28\x4a\xac\xbc\x73\x10\x62\x34\x4d\x0e\xfd\x81\xb4\xae\x3a\x1d\ +\x19\xa8\xce\xa8\xe0\x89\xfa\xe0\xc1\x83\xef\x7f\x8b\xef\xbf\x96\ +\xb3\xfe\xdc\x2a\xa1\x16\xe1\x45\x0a\x0e\x2e\x69\x60\x11\xdb\x01\ +\x35\xb3\x26\x0b\xd2\x5e\x69\x09\x30\x84\x86\x65\x62\x4e\x8b\xeb\ +\xa4\x9a\x42\xa4\xc9\x29\x0e\x80\x78\x1c\xa2\x07\x11\x8d\xc5\x18\ +\xa8\x31\xa2\x4b\x93\x1e\x8a\xe6\x62\x07\x82\x6e\x0b\x52\xe4\x5e\ +\xbb\x32\x0b\xe3\xd6\x04\xbb\x30\xec\x33\x5c\xd0\x61\x4f\x04\x6d\ +\x99\x89\x6b\x8f\x4f\x99\x5e\x5a\x64\xd8\xaa\xcb\x4c\x0c\x42\x04\ +\xe4\x5d\x18\x58\x05\x3d\x2e\x38\x62\x2a\x05\x9d\x4b\xe1\xda\x13\ +\x2a\xd2\x97\xb8\xea\x00\x64\x86\x11\x69\x31\xce\x54\xce\xdc\x95\ +\xa3\x97\xd5\xcc\x6b\x5e\x10\xd2\x17\x99\xbb\x42\xbd\x95\x59\x58\ +\x2c\x83\x34\x2f\x64\xe2\x49\x98\xd1\xa1\xc5\x59\x32\xa0\x71\x78\ +\x51\xee\x57\x7a\x50\x7c\xec\xc5\x7b\xb3\xe6\xc6\xf2\x3e\xba\xfa\ +\x1c\x64\x70\xf5\x0a\xe8\xfb\xc7\xec\x2c\x42\x27\x6b\x62\x60\x13\ +\x11\x11\x45\x30\x3a\x13\xfb\x9a\xcb\xc2\x62\xb9\x0d\xc7\x03\x53\ +\x8e\xfe\xe0\x85\xf4\xdc\x70\x2e\xa8\x03\xee\x32\x5c\x09\x79\xf6\ +\xbe\xc1\x6e\xbe\x8b\xb8\x0e\xec\x72\xa4\x39\x28\x99\x37\x33\x27\ +\x18\x29\x33\xff\x5b\x99\x41\x2d\x7a\x4e\xa9\x81\x1d\x81\x27\x5a\ +\xc9\xbd\x61\x48\x8f\x10\xd5\x0d\x39\x1d\x35\x51\xdd\x10\xbc\x7e\ +\x91\xa9\xfb\x32\x53\x0b\xa8\xd1\xa7\x97\xcd\x8a\xbe\xe3\x81\x08\ +\xd4\x4c\x69\x16\xe3\xff\x5a\x45\x38\xdf\xa1\xdb\x8a\xd8\x39\x08\ +\xf9\xf3\xbf\xf9\x36\x3f\x6a\x5e\xe5\xfa\x3f\x5a\x27\x39\x55\x21\ +\x4c\x50\xcc\x84\x1a\x35\x99\x60\xb2\x50\x41\x35\x2d\xb2\x28\xa4\ +\x99\x29\xa4\xc0\x59\x18\xd0\xb0\x4c\xb4\xb3\x29\x69\x23\x23\xee\ +\x87\x0c\x06\x43\x74\xdb\x22\x09\x42\x74\x3b\x11\x41\xab\x19\x40\ +\x4f\x76\xf8\x02\x3b\xc7\xf6\xa6\x42\x5e\x6f\xe7\xd8\x81\x22\x8a\ +\x3f\xb7\x2e\xf6\xdc\xad\x2b\x0c\x4e\x12\x5a\x67\x09\x3b\xa7\x1e\ +\x87\x8b\xae\xcc\xc4\xab\x97\x16\x39\x9c\x66\x7c\x62\x28\x32\x71\ +\xd9\xae\xee\x67\x1a\x64\x33\x83\x96\x8e\x9a\x8a\x41\x51\xbd\x17\ +\x93\x48\x6d\xc4\x19\x16\x0b\xf8\x76\x42\xde\x13\x15\xb4\x62\xb7\ +\x30\x80\x04\xd0\x7b\x3a\xd8\x7d\x30\xad\x8a\x34\x33\x42\x43\x41\ +\xa1\x47\x8e\x2d\x7c\x2b\xe4\x88\x87\x78\x2d\xaa\x9c\x24\x5a\xa8\ +\x88\x0d\x9e\xf9\x03\x31\xbb\x67\xad\x41\xa8\x14\x1c\x74\x3e\x6f\ +\xce\x9d\x2e\xa0\xe1\x61\x53\xc3\xd4\x23\xf4\xd6\x97\xf9\xa8\xf1\ +\x87\xbc\xfb\x5e\x4c\x76\x6b\x85\x5b\x9f\xbb\x83\xe5\xd7\x65\x20\ +\x03\x12\x4a\x04\xf9\x1f\xf0\xb5\xdb\xaf\x70\x6d\x5d\xe7\x36\xd0\ +\x7a\xf8\xf3\x5c\xbd\xa2\x73\xeb\xca\x75\xe2\xa8\x83\x12\x29\x1c\ +\x1f\x1c\xb2\x35\xd9\xa6\x3f\xd1\x67\x01\x51\x09\x96\x7e\x43\x81\ +\x0c\xd4\xd1\x80\x56\xbb\x45\x3f\x53\xe8\xa8\x39\xc1\x3d\x8b\xbf\ +\x56\x4c\x5c\x67\xa6\x9e\xf3\xfd\x90\x3c\xc9\x19\xfb\x31\x8d\xac\ +\x86\xd6\x14\x13\x25\xc3\x74\x48\xcb\x6b\x51\xb2\x6c\xc2\x33\xad\ +\xf4\x93\x80\x5e\x16\x16\x41\xda\x11\x01\xab\xcc\x9a\x1c\xaa\x37\ +\x2a\x68\xb6\xd2\x87\xa2\x2f\x7f\xb7\xed\x91\xd0\x1a\x7b\x8a\x09\ +\x0a\xb8\x8e\x46\x5c\x06\xa4\x53\x99\x84\x2e\x9d\x84\x0e\x42\xee\ +\xbe\xf2\x75\x5e\xfc\xe4\x2f\xf2\xec\xb3\x26\x7b\x87\x42\x28\x5f\ +\x62\x5d\x5f\x1d\x93\x9b\xf6\x1c\xb4\xd3\x81\xba\x69\x15\xd0\xc3\ +\x42\x07\x14\x26\xb4\x25\xdd\x53\xa3\xd3\xe9\x08\x3e\xd9\x9b\xca\ +\x00\x1e\xa1\x08\x28\x61\xe7\x42\xce\x99\x4e\x44\x16\x4e\x27\x82\ +\xb9\xb0\x61\x95\x7a\x11\x55\xf3\x98\x18\xa0\xf6\xf8\x14\xda\x5d\ +\x69\xb2\xdd\x51\x53\x19\xc8\xe5\xfd\xea\x94\x88\xf6\x5f\xfc\xf4\ +\x8f\xfc\x4a\x42\x88\x81\x4d\x42\x48\x42\x08\xf1\x04\x8b\x05\x01\ +\x29\x8c\x0c\x35\xd0\x89\xe3\x3e\x06\x36\xaa\x91\xe1\x27\x09\xd3\ +\x24\xa1\x96\x24\x78\x7a\x4c\x8e\x41\x14\x25\x4c\xf4\x98\x29\x31\ +\x71\x94\x00\x06\x89\xfc\x35\x21\x4b\x14\xb2\x44\x41\xb1\x72\x32\ +\x0c\xe2\xe4\x4d\x3e\xd8\xff\x36\x0b\xcd\x65\x74\xe3\x92\x1c\x63\ +\xb2\x30\x88\x8d\x9c\x3a\x53\xb4\x54\xc1\xa6\x46\x6a\x66\x4c\x26\ +\x3e\x63\xe5\x1b\xdc\x7b\xfb\x98\x93\x93\x4c\xec\x55\xde\xb9\x44\ +\xf3\xd6\x21\x9f\xfb\xd8\x98\xab\xfa\xbf\xe0\xa5\xa7\x7f\x90\xcd\ +\xa7\x9f\x26\x0d\x56\x89\xf9\x80\x7b\x47\x5b\x0c\xbc\x8c\xc3\x3c\ +\x64\x2f\x7b\x83\x3b\xfd\xef\xb0\xa8\x83\x37\x9e\xd2\x4e\x1b\x0c\ +\xec\x2d\xfa\xdf\x07\x6d\x1a\x31\x6d\xa7\xc4\x6c\x31\xad\x5f\x47\ +\x09\x85\x88\x3d\x19\x9b\xb4\xea\x09\x66\x6c\xc2\x14\xa6\xd1\x90\ +\x49\x34\x21\x74\x2d\xd2\x30\x91\x8f\x83\xc8\x44\x53\x75\xb2\x2c\ +\x21\x9e\x66\xc4\x4a\x4a\xbd\x36\x2b\x77\x4d\xd5\x24\xac\x25\x58\ +\x8a\x81\xd1\x34\x71\x4c\xa8\x4f\x15\xc2\x5a\x42\x57\xb5\x08\x73\ +\xb7\xc8\xb8\x1d\x16\xcc\x29\xe1\x28\x41\x71\x6d\xb2\xb8\x86\x52\ +\x1b\x02\x1d\xfc\xe9\x84\xfa\x24\xa1\x6f\x4c\x48\xc6\x85\xb6\x42\ +\xb1\xa9\xa1\x11\xda\x01\xc9\x38\x27\xd7\x03\x42\xc5\xc0\x3a\x57\ +\x2a\x8b\xe9\x14\x97\xb7\xb6\x1f\x92\x3c\x7a\xc4\xf2\xd3\x4b\x58\ +\x96\x42\x10\x66\xc4\x7e\xc8\xd4\xc8\x69\xc4\x19\x5a\xc3\xc0\x0c\ +\xc7\xd4\x95\x3a\x53\x45\x4c\x87\x5b\x53\xc1\x17\x5b\x53\x15\xcd\ +\xca\x31\xb3\x4b\x58\x16\x58\x96\x85\x65\x59\x34\xc9\x31\x62\x85\ +\xc0\xce\x71\xe2\x99\xd6\xc2\x88\x15\x62\x03\x8c\x71\x46\x6c\x40\ +\x9c\xa7\xd8\x81\x78\x0e\x6c\x54\x4b\x25\x1f\x2b\xdc\x79\xff\xfb\ +\x78\x8f\xdf\x66\x52\xaf\xb1\x39\xe8\x31\x34\x2d\x86\xa6\xc5\x8a\ +\xbe\xc5\xd2\xd4\x61\xe3\x99\x4d\x14\x12\xf2\x22\x60\xa3\x5c\xa5\ +\xa3\xa6\x44\xb9\x4a\x96\x25\xfc\xd6\x57\xfe\x10\xd5\x62\x01\xd7\ +\x6e\x11\xd9\x09\xae\xdd\x62\x59\xe9\xe0\xda\x2d\x74\x3b\x41\xb7\ +\x13\xc1\x5c\x74\x0d\xc2\x5c\x7c\x0e\xa6\x45\x6e\xe6\x58\x1d\x13\ +\xc5\xcc\x31\x8a\x49\x00\xdd\xb4\x30\xb0\x31\xb0\xd1\xcd\x99\xfa\ +\x21\x89\x42\x4c\xc0\x8c\x42\xcc\x28\x44\x09\xed\x19\x9e\x4e\x5f\ +\xe3\xde\xce\xc3\x62\x0a\x44\x29\x67\x92\x69\x84\x2a\x2a\x4d\x6c\ +\x12\xd2\xa2\x7d\xed\x98\x1d\xf6\x5f\xbf\xc9\xfe\xc1\x4c\x20\x74\ +\xeb\x73\x77\x24\x0b\xf1\xc2\xa7\x9e\xe1\xd6\xe6\x3f\xe1\x52\xfd\ +\x2a\x97\xd5\x29\x07\xdb\xd7\xe7\xba\x75\x96\x5f\xc7\xf2\xeb\x7c\ +\xed\xad\x57\xf8\xc3\xdb\xff\x96\xbb\xe9\x9f\xb2\xb5\x93\x30\x3e\ +\xf5\x78\x3c\x78\xcc\xe9\xe1\xeb\xb4\x94\x17\x58\xab\x59\x2c\xb7\ +\x3b\xe4\x0b\x1b\x73\xe3\x45\xa5\x26\x42\xd5\x97\xe9\x8c\x73\x94\ +\xa6\x42\x4b\x6b\x15\x45\x1a\x9c\xa4\x21\x03\x25\x27\x76\x75\x9a\ +\xce\x6c\xec\xa0\x7c\xfd\x82\x92\xae\x69\xce\x15\x6c\x42\x1f\xd1\ +\xa7\x37\x0c\xe5\x7d\x31\xf2\xd4\x14\xe3\xfa\x45\xd6\xed\x8c\x73\ +\xc9\x4b\xcf\xae\x3e\xae\x3c\xb6\xfd\xf3\x56\x58\x45\x07\xb1\x3b\ +\xa5\xdb\xbc\xc1\xab\x8f\x8e\xf8\xcb\x5f\xfd\x0e\x4d\x7f\x97\x56\ +\xc3\x43\x35\x81\x48\xc3\x37\x1c\xa2\xc1\x94\xb1\xa1\x12\xa8\xa7\ +\xb8\x99\x82\xe6\x09\x51\x8f\xe6\x8d\x69\x92\x17\x8f\xfb\x52\xe9\ +\x56\xc2\x06\x79\xe5\xb4\x73\x9a\xe4\x0c\x0b\xab\x5a\x5b\xab\xcb\ +\x6c\x6c\x07\x8a\xe4\x8b\xed\x20\x84\x20\x61\x90\xcc\xff\x9e\xdb\ +\xed\x2e\x4a\x20\xda\xcf\x47\x89\x18\x78\x9d\x70\x4c\xab\xf4\x7e\ +\xf6\xa6\xe8\xba\x45\x3f\xd3\xe6\x70\xb1\xaa\xdb\x09\x3e\x60\x06\ +\xe2\x1f\xde\xb3\xc4\x6e\x0d\x1f\xc4\x0a\x00\x53\x00\x7a\xbb\x31\ +\x73\xc1\xb4\x2d\x21\xa0\x4f\x2c\x6b\x0e\xc5\x1a\x56\x8e\x61\xe5\ +\x98\xc5\xe5\xc8\xb4\x4c\x9c\x4e\x47\xf8\xfe\x9a\x16\xe0\xa2\x12\ +\x12\x84\x21\x77\xf3\xff\x55\xd0\x43\xca\x5d\xe2\xfc\xa0\x70\xf0\ +\x11\x05\x9e\x6e\xe6\x4c\xa3\x79\x83\xef\x99\xf1\x21\x64\xb7\x56\ +\xf8\xd8\x8b\xf7\x64\x60\x86\xce\x84\xdb\xdf\x79\x9f\xa4\x7f\x80\ +\xe7\x05\x6c\xed\x07\x24\xc3\xdf\xbb\x80\xa1\xab\x0d\x90\xaf\xbd\ +\xf5\x0a\xca\xde\x1b\x38\xcf\x37\xb8\xfe\xf2\x35\x3e\x7e\xeb\x9f\ +\x61\xac\xcc\x3b\xb2\x8b\x4b\x79\x87\x7e\x43\xa1\xad\x37\x51\xf5\ +\x65\x31\xc8\xa9\x98\x74\xd4\x1c\x4f\x99\x0d\x78\xb6\x73\x45\x52\ +\x6b\x23\xdf\x96\xcd\x8b\x52\x99\x86\x27\xa0\x83\xf4\x10\x2e\x9c\ +\xe0\x05\xb6\xed\xc8\x21\xd0\x4c\x69\xa2\xe6\x23\x7a\x03\x71\xe2\ +\xa8\xf9\x88\x38\x11\x3f\xb3\x2a\xcb\x1c\x33\x65\xcc\x14\x35\x1f\ +\x49\x51\x7e\xf5\xb9\x6a\x20\x1b\xad\xde\x9c\x1b\xfd\x9f\xbf\xfb\ +\x36\xbf\xf3\x17\xc7\x4c\xb3\x45\xda\xed\x36\x0d\x2d\x46\x89\x26\ +\xe4\x66\x9d\x1c\x1b\x3b\x5b\xc4\x57\xc7\x28\x9a\x2b\x8f\x23\x14\ +\x52\xb7\x41\x93\x99\xfa\x6d\x54\x42\xc5\x73\xc3\xa7\x33\x9e\x6e\ +\x3a\xd7\xfc\x28\x1b\x22\x81\x7d\x8e\xe2\x5b\x9c\xb1\x1d\x57\xa6\ +\x16\x87\xd3\x4c\x52\x6d\x25\x3b\x51\x16\x86\x25\x4b\x51\x1e\xc7\ +\xea\x14\xd5\x9f\xfb\x25\x74\x12\x7c\x72\x33\x27\xd4\x45\x00\xf8\ +\x51\x48\x82\x2f\x46\x7e\x0a\x86\x22\x0e\x15\x6a\x85\x68\xc7\x8f\ +\x42\x92\xa2\xfb\x53\x32\x1c\x51\x18\x11\x59\xa6\x38\x16\x18\xcb\ +\x04\x22\x33\x11\x8f\xf5\x37\x61\xbf\x25\xb3\x71\x9c\x6c\x31\xee\ +\x4f\xe4\x40\x7d\x52\x14\x7d\x7e\xb9\xfe\xd4\x6e\xa0\x16\x93\xd5\ +\xed\xa5\xcb\x7c\xfe\x7a\x3e\x17\x94\x65\xa7\xee\xfb\xde\x57\x85\ +\xca\x6d\xb2\xcd\x9d\x6c\xcc\x9d\x6c\x4c\xe8\x4c\xe4\xeb\xe5\xb1\ +\xfc\xba\x37\x1b\x62\x82\xe3\xea\x15\x9d\x5b\x2f\x7d\x94\xab\x1f\ +\x79\x99\xeb\x2f\x5f\x63\xf3\x4a\x87\xfe\xd9\x90\x87\xc3\x1e\xbb\ +\x7b\x8f\xd1\x83\x3a\x63\xa6\x85\x7d\x54\x73\x6e\xa0\xb3\x1a\x58\ +\x4f\x52\xa8\xa5\xb4\x64\xa0\xe3\x09\xe6\xe1\x78\xd0\xe7\xd4\x3b\ +\xe1\x74\x64\x14\xde\x14\x21\x78\x30\x48\x46\x0c\x92\x11\x0f\xb3\ +\xfc\xc2\x15\xa0\xbc\x2a\x9c\x0f\xe6\xf3\x8f\xdd\x3c\x92\xc1\x5f\ +\x1a\x15\x1e\x0f\x90\x8b\x69\xc8\xd7\x20\x5f\xe3\x4f\xff\xe0\x2f\ +\xf9\xf6\x6f\xfc\x11\xb6\x3f\xa4\xbe\x64\xe1\xe8\xc7\x4c\x10\xb3\ +\x86\x83\xa4\x89\x93\x35\xf0\xd5\x31\x4e\xd6\x98\x1b\xfc\x2c\xb3\ +\xac\xd0\x2f\xcc\xe4\x9a\xe5\xe3\x11\x0a\x0b\x43\x45\x66\x66\x91\ +\x79\x95\x0b\x5d\xbb\xb9\x04\x55\x14\xd6\xe3\x53\x4f\x66\xe3\xa3\ +\xc1\xae\x7c\x7d\x58\x9a\x2f\x16\x27\x85\xcc\xc2\xde\x54\x2c\x63\ +\x0c\xc6\x88\x2c\x6b\x27\x24\x81\x4e\x30\x86\xa6\x69\x63\x14\x57\ +\xe2\x50\xaf\xe3\xea\x2a\x5e\x92\x15\x60\xdf\x2d\xce\x79\x11\xbc\ +\x66\xa0\x13\xd9\x09\x49\x14\xe2\x98\x56\x31\x32\x1f\xcd\xfc\xa5\ +\x8a\x63\x64\x99\x85\xdc\x33\xb8\xf0\x47\x6c\x1d\x64\x3c\xbb\x19\ +\x10\x16\xd6\x54\x94\x36\x01\x66\x0e\x4a\x80\xe7\x5b\x50\x04\xf1\ +\xe6\x95\x0e\x3f\xf2\x85\x7f\x0e\xc0\x77\x1f\xff\xb7\xf4\xf7\xaf\ +\xd2\x79\x76\x0b\x02\x38\xd8\xbe\xce\xd5\xba\x28\xa8\xfc\x37\x5f\ +\xc2\x79\xf1\xdb\x32\x70\xcb\xe0\x2d\xb3\x77\xf9\x58\xd9\x7b\x03\ +\xae\xbc\xc4\xfd\xad\xdb\x5c\xcf\xea\xa8\xd7\x5f\xe0\xea\x15\x9d\ +\x1f\xf9\xd1\x7f\xcc\x2b\xaf\xbe\xc9\xd6\xdd\x0f\xe8\x9f\x0d\x45\ +\x23\x23\x19\x61\xf8\x17\xf9\xec\xb1\x1f\xd3\x70\x0c\x19\xc0\x0d\ +\xc7\x28\xda\xcd\x23\x5a\x6a\x53\xe8\x90\x2b\x6a\x35\x06\x14\x9c\ +\x0f\xc5\xfd\x99\xe6\xe2\xc3\x4e\x88\x32\x98\xcf\x4f\x90\x9c\x1f\ +\x7d\xea\x8d\x14\x68\x0a\x49\xa8\xa1\x97\xde\x6e\xa5\x21\xcc\x10\ +\x9a\x33\xac\xfe\xd5\x6f\x7c\x93\xb3\xe3\x01\x3f\xfc\x4f\x3b\x74\ +\x9f\xf9\x0c\xab\x78\x0c\xc7\xa0\xd5\xce\xf0\x58\x40\x89\x34\xa8\ +\x95\xfc\xb1\x22\x8e\xb8\xe4\xc5\xef\x2e\x82\x37\x9f\x0d\x96\xda\ +\x19\xcd\x00\xce\x5a\xb9\x54\x8b\x88\x39\xbd\x69\x25\x0b\xe7\xd8\ +\x41\x48\xa2\xa5\xe8\x5e\xc6\x43\xcf\x94\x9d\x5b\xc7\x1e\x41\x30\ +\x62\xa5\xbd\x51\xb4\x9f\x45\xcc\x65\xf5\x15\x49\xcd\x05\xa9\x26\ +\x1c\x86\x0a\x0f\xa3\xb1\x1f\xa3\xdb\x0d\x70\xcd\x9c\xb8\x67\x10\ +\x72\x46\x57\x59\x90\xdf\x34\x02\x5c\xbd\xe8\xa3\xbb\xe5\x1b\xea\ +\x4b\x52\x7b\xd6\x53\xf7\x67\x9a\x89\x32\x78\x2d\xb3\xb0\x29\x2c\ +\xec\x0a\x8b\xe7\x13\xcb\xe2\xe1\xce\x07\x73\x63\x43\xcf\x2c\xdd\ +\x25\x08\x3f\xc9\x25\x6b\x26\xfe\x91\xbb\xed\x2c\x18\x26\x6f\xb1\ +\x3f\xed\xb1\xe7\xef\x73\xd9\x59\xe7\xda\x62\x39\x46\xff\xbf\xc0\ +\x25\x48\xb2\x77\x79\xe5\x9b\xdf\xe0\x70\xfd\x5d\x86\x76\x03\x6f\ +\xef\xe7\xd8\xbc\xd2\xe1\xf4\x4e\x97\xe8\xa5\x43\x09\x39\x9e\x14\ +\xd0\xb1\xfb\x00\x78\x89\x9b\x57\x5f\x20\xc9\xde\x25\xcb\xde\x85\ +\xe3\x75\x92\xe5\x77\x79\xf9\xc6\x35\x2e\x5f\x56\xd9\xbd\x7f\x48\ +\x7c\x24\x9a\x19\x49\xe6\x49\xdf\x88\x93\x34\x04\x05\xda\xce\xfc\ +\xf8\xd5\x30\x1b\xc9\x8e\x9d\x10\xf9\x58\x45\x70\xb7\x24\x7b\x41\ +\xa1\xc0\x2a\x4f\x80\xea\x11\x57\xa7\x9d\x2b\x4f\xcc\xec\xd5\x00\ +\xd7\x18\x72\xa6\x34\xe7\x3f\xa7\x99\xc3\x48\x41\x6b\x0e\x88\x93\ +\x52\x70\x2f\xe6\xf8\x1a\xd4\x0a\x1e\x59\xa3\xab\x46\xdc\xdf\x8a\ +\xe8\x0d\x5f\xe7\xde\x5e\xc2\x33\x5f\xac\xf1\x23\xff\x68\x93\x56\ +\x0b\x86\x63\x17\x8d\x33\x2c\xad\x4e\x62\xd7\xc4\x30\x69\xa1\xb3\ +\xa0\x36\x7f\x12\x6b\xca\x18\xdd\x6e\x08\xc1\x50\xa0\x32\x2c\x34\ +\xc8\xb4\xcb\xc0\x16\x6c\x84\x1d\x08\xf8\xd1\x0c\x20\xb0\x2d\x6c\ +\x52\x12\xb7\xc1\x75\x37\x62\x67\x20\x78\xe2\xfb\xa7\x4d\x21\x06\ +\x7a\x7c\x8a\x52\x0b\x19\x5e\xba\x4a\xdb\x74\x60\x72\x44\xe6\xae\ +\xcc\x0d\xa3\x06\xe9\x84\xc0\xb6\x05\x13\xf4\x4b\x3f\xfb\xcf\x7e\ +\xc5\x1b\x8d\x04\x2b\x01\x18\xd8\x04\xca\x94\x2c\x31\x41\xcf\x25\ +\x84\xb0\x42\x85\x28\xca\x69\x64\x6a\x05\x50\x1b\x98\x7a\x4e\x4d\ +\x37\x98\x26\x09\x59\x92\xa0\xea\x86\x50\xc1\x85\x29\x86\x21\x9a\ +\x22\x13\x1c\x8c\x24\x2e\x06\x46\xa1\x37\x18\x93\xe6\x6f\x89\x81\ +\x46\x4b\x01\xf5\x0a\x0b\x8d\x8f\xa2\x1a\x16\x49\x92\x60\xe8\x3a\ +\x09\x70\x12\xbe\xcb\x69\xff\x5b\xbc\x7b\xff\x1b\x7c\xf0\xad\xaf\ +\xd2\x7f\xb8\x4c\xf7\xd9\x36\x37\x6e\x3c\x83\xe9\x3a\x2c\x2d\x98\ +\xb8\x8d\x26\x23\xcf\xe2\x7b\xfd\xaf\x62\x4c\x75\x06\x5e\x46\x50\ +\x7b\x0b\x3b\xbc\x45\xbd\x13\xe2\x7a\x97\x88\xcc\x99\x96\xa2\xd3\ +\x54\xe9\x34\x55\x96\xcc\x1a\x9d\xa6\xca\xdd\xd1\x84\xa3\xbb\x43\ +\xf2\xbd\x3b\x74\xd3\x4d\x9e\x6e\xe7\x9c\x3a\x1e\x5b\x3b\x09\xc3\ +\xed\xbf\x62\xab\x77\x9f\xcd\xeb\xcf\xd3\x55\x1f\x60\x2d\x5d\xa1\ +\x33\x99\x72\x96\x4d\x38\x8b\x62\xda\xb9\x82\x89\x08\xb6\xd4\x4f\ +\xa4\x3e\xc2\x54\xea\x4c\xf2\x09\x93\x7c\x82\x1e\x58\x24\x76\x88\ +\x1a\x1b\xc4\x85\xb8\x25\x6c\xf8\xa4\x89\x3a\x7b\xac\x8f\x51\x63\ +\x83\x5a\xa4\x13\x34\x0b\x48\xa6\x5c\xd4\x1e\x0f\xb3\x11\xa6\x52\ +\xc7\x44\x61\x98\x8d\xa8\x29\x2d\xf9\xf3\x4d\x14\xc1\x4d\xd7\x41\ +\xab\x0f\x49\x47\x6d\xa8\x43\x98\x8b\x40\x9e\x2a\x3a\x35\x34\xd4\ +\x7c\x04\x75\x8b\x4b\x2f\xbd\xc4\xca\xd2\x06\x7b\x3d\x9b\x93\x41\ +\xcc\x3b\x6f\xbd\xcd\x69\x3f\xc2\xe8\x8f\x68\x99\x1a\x8e\x69\xa0\ +\x28\x21\xea\x74\x04\xf9\x90\x3c\xd3\xa8\xa9\x19\xe4\x53\x5a\xb6\ +\xcb\x24\x9f\x42\x3e\x45\x49\x5c\xb2\x58\x21\x4f\x3d\x0c\xc7\xc0\ +\x4d\xeb\x4c\xa2\x29\x13\x23\x46\x51\xeb\xa8\x46\x2e\x33\xb0\x13\ +\x97\x9c\x71\x82\xde\x70\xe8\x07\xf0\x17\x6f\xec\xa2\x46\x87\x4c\ +\xea\x35\xe2\x60\x4a\x9d\x53\x06\xee\x32\x18\x4d\xae\x25\x09\x4b\ +\xb7\x56\xc9\xda\x4b\xe8\xc3\x9c\xd8\x00\x3b\x48\x08\xf4\x1a\xb6\ +\xa6\x62\xa8\x39\x5f\xf9\x77\xff\x2f\xba\x17\x0c\x99\x9c\x4e\xa5\ +\x97\x6f\x54\x92\x62\x66\x4a\x68\xe5\x24\x5e\x8e\x8e\x82\x97\x64\ +\xb8\xba\x2a\xf1\x6f\x5e\x30\x13\x11\x08\x88\x50\x39\x41\xad\x0a\ +\x87\x1c\xa3\x80\xe5\x63\x58\x14\x13\xd5\x17\x95\x59\xef\x9f\xbc\ +\xca\xd3\xee\xcf\x90\x5a\x42\x5f\x11\x02\x51\xf8\xee\xdc\xb8\xfd\ +\x9d\x2c\xc6\x9f\x86\xdc\xd2\x6f\x48\xfd\x43\x84\x82\x69\x9a\x34\ +\x2e\x4d\xf9\x78\xe7\x17\xf8\x56\xfc\xab\x32\xdb\xa6\xfa\x3d\xb4\ +\xe4\x16\xa9\x2e\xbc\x8c\x3b\xcf\x6e\xc9\x51\xa6\x6a\x46\x6e\x0f\ +\x6f\x72\xe9\x6c\x83\xef\x05\xb7\xf9\x93\xd7\xfe\x84\xf5\xb5\x80\ +\xc5\xd5\x4f\xf3\x03\xed\x98\x23\xfd\x53\x90\xbc\x22\x26\x45\x10\ +\xf2\x82\xfa\xb5\x0d\x9e\xbf\x15\xb1\xf7\x70\x91\xc1\xc9\x9e\xc8\ +\xca\x5e\x42\xec\xea\x0c\xd3\xd1\xb9\xa9\x67\x6b\xee\x98\xd8\x21\ +\x7a\x60\xc9\xc0\xae\xbe\x06\x30\x74\x86\x18\x9e\x55\x29\xde\x90\ +\x5f\xd7\x52\x9b\xe8\x81\xc5\xc0\x15\x42\xfb\x96\x2a\xb2\x3a\x88\ +\x2b\xc1\xd8\x8f\x69\x34\xcb\x8c\xde\x82\x66\x8e\x36\xe8\xd3\x5a\ +\xe8\xe0\x29\xa6\xf0\xc1\xf0\x22\x70\xe1\xb3\x9f\xdc\xe0\xa7\xff\ +\xf9\x17\x59\x59\xb9\xce\xeb\x6f\xbc\xc7\xb7\xbf\xf5\x1d\xd9\xe6\ +\x3d\x8a\x1e\xb1\xb6\xb7\x44\x6d\x51\x9c\x60\xf5\xfe\x25\xbc\xf4\ +\x14\xb7\xd8\x9b\x93\xe7\x5d\x89\x8b\xe7\xa6\x43\x4a\xec\x5b\x8e\ +\x3c\x15\x18\x39\x28\x47\x9c\x02\x24\x7f\xfc\x61\x37\xa7\xd8\x99\ +\xbd\x39\xe8\xb1\x53\x0b\x69\x5c\x11\x23\x57\xb6\x3f\xc4\xb7\x3b\ +\x12\x9a\x88\x4c\x2c\x06\x52\xc7\x7e\x8c\x6e\xb1\x00\x8b\x67\x34\ +\xbb\x39\x61\x41\x97\xc5\x04\x8c\x73\x0b\x95\x00\xdd\x55\xc8\x02\ +\x1b\x57\x9f\x15\x70\x12\x87\x15\xf8\xb6\xa4\xd9\xb0\x4c\xe2\xb0\ +\x87\x81\x2d\xb3\x77\x39\x64\x12\x87\x63\xa9\xac\xb8\xba\xa6\x72\ +\x77\x6f\x5e\xe7\xfb\x68\xf4\x06\xcf\x76\x5e\x16\xd6\x53\x51\x9f\ +\xbd\x9d\x87\x90\xbd\x26\xa7\x94\xf3\x3b\x5d\x1a\xc6\x5d\x36\xb4\ +\x44\x2e\x89\x29\x27\x4a\x26\xd6\x75\xae\x5e\xb9\xc7\x5b\xb7\x67\ +\xc1\x39\x68\xdd\xa7\x3d\x84\x6c\x6f\x83\x61\x7e\x1b\x10\x94\xcd\ +\x0f\x76\x0e\x41\x05\xbd\xf5\x65\x76\xef\x1f\xb2\xbd\xd3\x67\xff\ +\xec\x84\x7c\xe1\x29\xda\x4b\x00\x77\x39\x3d\x7c\x9d\xdf\x7f\xd3\ +\xc2\x5e\xf9\x1e\x4f\xdb\x2f\xf0\x78\x61\x97\x6b\xba\xcd\x23\x66\ +\x3a\x8d\x95\xd4\x47\x51\x73\xfa\x4d\x85\x58\xd1\x31\xbc\x84\xc4\ +\x9e\x0f\xe0\x32\x68\xcf\x07\x75\xf9\x7c\x62\x87\x44\xc9\x18\x33\ +\x98\x15\x4f\xcd\xc4\x67\x54\x70\xa2\x0d\xc7\x60\x98\x8d\xe8\xaa\ +\x39\xbd\x6c\x44\xcb\x69\x42\x2e\xd8\x8f\xc4\x1e\xd1\x75\x72\xc9\ +\x86\x94\x9f\xab\x63\x49\xec\xad\x2e\xae\x42\x51\x10\xf6\x06\x70\ +\xb3\x6b\xb1\x79\x75\x83\x9b\x57\x63\x56\xf3\x57\xb9\xd4\x35\xf9\ +\xe9\xff\xfc\x26\x2f\xbd\x20\xae\x20\x4d\x7f\x97\x83\xf4\x29\x9c\ +\xf8\x21\xf5\x7e\x8d\xc3\xd4\x66\x3a\x7d\x8d\xc9\xe3\x65\x98\x7e\ +\x1f\xd7\xfa\x2c\x63\x77\x42\x23\x10\x70\x28\x77\xbd\xb9\x40\x3e\ +\x98\x9e\xd2\xd0\xea\x2c\x0c\x15\xce\x5a\xa2\xc8\x23\x50\xd0\xed\ +\x8c\x51\xa0\x8a\xc2\x2f\x50\x19\x21\xbc\x90\x75\x6f\x3c\x6f\xc2\ +\x12\x34\x71\xd8\x67\xbb\xbd\x8e\x12\xec\x73\x10\xe9\x7c\xec\x43\ +\x02\xbe\xd4\x62\x34\x1c\x03\x35\xb2\x13\x8c\xee\x0a\x8f\x13\x93\ +\x98\x00\x2f\xc9\x48\x2c\x0b\xd5\x2e\x46\xa5\xbd\x9c\x2c\x1d\x13\ +\x13\x10\xea\x75\xf2\x8a\xb7\x5a\xc9\x0b\xcf\x04\xf5\x91\xdc\x8e\ +\x94\x05\x76\x25\x33\x8f\xe7\xf5\xc4\x8f\x6f\x80\xf6\xd9\x0b\xe3\ +\xf4\x23\x80\xfe\x84\xbd\xca\x34\x73\xa9\x5e\x7b\x27\x5e\x60\x1c\ +\x3f\xc5\xd6\x64\x1b\xf2\x07\x98\xa6\x89\x1a\x99\xc4\xb9\x4b\xbb\ +\xa3\xa3\xab\xcf\xf1\xf1\xce\x2f\xcc\xd1\x68\x83\xd6\x7d\x86\xf9\ +\x6d\xc6\xf1\x53\xf4\x77\x7b\xf4\x77\x7b\xec\xbc\xf3\x29\xf4\xb3\ +\xcf\x03\xf0\xb9\x2f\x6e\xf0\xc3\x3f\xfe\x53\xac\xff\x60\x84\x7f\ +\x75\x11\x7f\xfb\x84\xbd\xa3\x65\xf6\x8e\x96\xc9\x17\x36\x04\xe3\ +\x11\xdc\x26\xb9\x67\xf2\x60\x4b\xb8\xa5\x2c\x1d\x5a\x64\x7b\x1b\ +\xe8\xb7\x4a\xc5\xd9\xec\xb2\x9f\x6b\xae\xcc\xb4\xd5\xa0\x8d\x92\ +\xf1\xdc\xb1\xfa\xba\xa9\x37\xe4\x6b\x7a\x60\xd1\x6b\x6a\x73\x05\ +\x63\xae\xb9\xa4\xb4\xe4\xd7\x48\x35\x9c\xda\x94\x54\x5e\x62\x87\ +\x0c\x33\x51\x44\x36\x1c\x43\xaa\xe3\x4a\xe7\x21\xd7\x89\xf8\xe2\ +\xf3\x5d\xbe\xf0\xc3\x57\xf9\xf1\x1f\xba\xc9\x0f\x3d\xb3\x49\xef\ +\x24\x25\x7a\xf0\x1e\x83\xb7\xbf\x49\xd3\xdf\xa5\xe9\xef\x32\x8a\ +\x0e\x58\x2b\x46\x6f\xce\x3a\x26\xdd\xd6\x7d\xa8\x3d\x4d\xfd\xd2\ +\x31\xd4\x9e\xc6\x4b\x4f\x31\xf4\x87\x28\x69\x4f\x7c\x28\x3d\xf2\ +\xc1\x48\x4e\x4a\x37\x02\x31\x84\x7a\xd6\xca\x65\x26\x16\x0e\x9c\ +\x42\x40\x34\x42\x11\xd6\x59\xc5\xf4\x48\xe2\x36\x68\xe9\x22\x31\ +\x6c\x0e\x7a\x17\x02\xb5\x35\x9c\x08\x4c\x5c\x72\xce\x55\x9d\x72\ +\x51\xe8\x8d\xfd\x18\xbd\x0c\x4a\xc1\x40\x98\xa2\x90\xab\x24\x5c\ +\x8f\x1c\xdd\x55\x30\x42\x9b\x88\x8c\x28\x31\x71\x4d\x55\x36\x32\ +\xf4\x62\x01\x4d\x49\xaf\x59\xc5\x64\x48\x23\x0c\x67\xc5\xdd\xb9\ +\x25\x36\xc9\xfa\x32\xec\xcc\x67\xe2\xa9\x72\x17\x3d\xfc\x24\x5e\ +\x6f\xc4\x54\xb9\x3b\x17\xdc\x7b\xfd\x55\x3e\x6a\x9c\xb1\x7f\x10\ +\xa2\xec\x05\xa0\x7c\x89\x96\xe9\xd2\x32\x61\xdc\x6d\xc0\x3e\x1c\ +\x65\xef\x4a\x1a\xad\x9c\xf8\x00\xe8\x6c\x74\x19\x3f\x2c\xde\x14\ +\xe5\x05\xb2\xf0\x84\x37\xf7\x0f\x60\x1f\x94\x6b\x97\xd9\xfc\x0c\ +\x5c\xbb\xfc\xaf\xf8\x51\xe0\xfe\xf5\x4b\xec\xde\x3f\x64\xe7\xcd\ +\xb7\xe1\x6c\xc4\x78\xa1\xd8\xd9\x61\xde\xc5\x0d\x61\xb8\x2b\xe4\ +\x31\xe3\xb8\x41\x63\xb7\x07\x95\x3d\x76\x73\x7f\x9f\x1d\xd2\x55\ +\xf3\x22\x63\x86\x5c\x1a\xe5\xf4\xec\x10\x33\x68\xcc\x65\xda\xc4\ +\x0e\xe9\x8e\x52\x1e\xa3\xc8\x60\x3e\xff\x7d\x16\xf2\x9c\x5e\xa6\ +\xa0\x33\x9f\xd1\x35\x47\x48\x3c\x7b\x99\x42\xae\xb9\xf2\x44\xea\ +\x6a\x85\xfb\x66\x1e\xd1\x6a\xb7\x58\x6e\x77\xf8\xec\x8b\x2b\x34\ +\xba\xb7\x78\xea\x6a\xca\x92\x95\xb2\x6a\x6d\x30\x71\x84\x19\xcc\ +\x28\x3a\xa0\x69\x8a\xbf\xa3\x3c\xd6\xfd\x35\x70\x1e\x52\xf7\xd7\ +\x84\xef\x83\xb5\x21\x9d\x81\x0e\x0f\x76\x61\x4d\xc0\x0c\x3f\x69\ +\xd0\x70\x15\x5a\x9a\x23\xe6\xee\xda\xae\xec\xd8\x55\xa9\xb8\x79\ +\x88\xa5\x82\x2d\x5c\xe6\xf3\xbd\x5d\x86\xc9\x2d\x74\xbe\x27\x5a\ +\xce\x15\xaa\xcd\xb1\x91\x83\xaf\x92\x9d\xb0\x2b\x22\xa2\x0a\xc5\ +\xa6\x8a\x3d\x15\x02\x1a\xcc\x18\x08\xe1\x92\x13\x13\xa0\x6a\x0d\ +\x12\x2f\x97\xd0\xc1\xd5\x55\x99\xb1\xcb\x13\x20\x0e\x95\x39\xea\ +\xac\x8a\x89\xcf\x07\x30\x61\x84\x85\xc5\xd3\xee\xcf\xcc\x65\x63\ +\xd2\xd7\xe8\xab\x23\xb6\x92\x7b\x17\x3c\x23\x2e\x77\x0e\x19\xc7\ +\x4f\xd1\x51\x73\x6e\xbc\xfc\x8b\xfc\xc0\x0f\x76\x68\x2d\x6f\x62\ +\x77\x5b\x58\xbd\x43\xa2\xc1\xf7\xd9\x3d\xd8\x64\xf7\xfe\x21\xed\ +\xe1\xcd\x0b\x6f\x5c\xb9\xec\xf0\x60\x1a\xe2\x99\x07\xb8\xd1\x1a\ +\x2d\xe5\x05\xee\xbd\x9f\xf1\xf5\xff\xed\x1b\xfc\xd9\xaf\xfd\x1a\ +\xde\x1b\x7f\xc2\xd5\x2b\x3a\x9f\x7b\xee\x25\x3e\xfb\x5f\xfe\x04\ +\xf9\xc2\x06\xca\xd9\x2e\xca\xd9\x2e\xe3\xf8\x29\xa9\xab\x08\x8e\ +\xd6\x68\x18\x77\x09\x8e\xd6\xe8\x67\x83\xf9\x2e\x5c\x81\x8d\xf5\ +\xc0\x92\x59\x12\x90\x41\x0b\xf0\xb8\xca\xec\x8c\x32\x46\xba\x83\ +\xde\x54\x2f\x40\x8e\xf2\x7e\x2f\x53\xe6\xb2\x70\xa3\x60\x42\xce\ +\x14\x91\x75\x5b\x6a\xf3\x42\x01\x58\x8e\xf8\xbf\x78\xfd\x29\x3e\ +\xfb\xe2\x0a\xb7\xd6\xae\xf1\xd9\x67\xa6\x2c\x59\x29\xdd\x25\x4d\ +\x06\xb0\x0c\xd8\x22\x98\xcb\xdb\xc4\x99\x05\x76\xf9\xb9\x87\xe1\ +\x2e\x87\xe1\x2e\xab\xd6\x06\x0b\xfd\x08\x2f\x3d\xc5\xd1\xc7\x84\ +\xc6\x84\x7d\x75\xd6\xfc\x10\x7a\x11\x5f\x36\x48\x12\xe9\x87\x5c\ +\xb0\x5c\xc5\xfd\x0e\x19\xca\xe5\xf5\x0b\x5c\x71\xb5\xf9\x31\x3e\ +\x4e\x19\x44\x3e\xea\xe4\x68\x46\xd7\x79\x53\x02\x7b\xd6\x29\x1c\ +\xfb\xf1\x6c\xb8\xc2\xc0\xc6\x08\x91\x7c\xb0\xa0\x54\x14\x32\x5d\ +\x5c\x02\xa7\xf9\x02\xa6\x7e\x86\x97\x98\x72\x6a\x2e\x4a\x4c\xa6\ +\x9a\x25\x0c\xad\x8b\x13\xc1\xc0\xe6\x1f\xbc\x85\x11\x56\xc7\xa4\ +\x36\x7a\x8a\xa9\x86\x2c\xde\x3e\xd4\xec\xc4\xbb\xc1\xe6\x95\x0e\ +\x5c\xe9\x70\x79\xd1\x64\xf7\x9e\xce\xc3\x83\xef\x72\xf4\x1f\xfe\ +\x8a\x07\x8f\x63\xf6\xfc\x7d\x36\x54\xb1\xae\x76\x3b\xba\x47\xe3\ +\xb0\xce\xb5\xf5\xd9\xf8\x92\x6a\x2d\x41\x3e\xfb\x27\xa9\xd6\x12\ +\xc3\xfc\x36\x2e\x6b\x44\x97\x7a\x18\xd1\x1a\xbf\xff\xd7\xef\x63\ +\xbf\xff\x3d\x99\xbd\xd7\x6a\x1b\x1c\x54\x02\xb9\x0c\x60\xe8\x13\ +\x1c\x95\x26\xd7\x0a\xf9\x28\x97\xd8\x6c\xec\xc7\x18\x9e\xf8\x99\ +\x4d\x27\x98\x0b\x40\x3d\xb0\x04\xfe\xd5\x1b\x02\x3a\x34\x55\x49\ +\x15\x57\x03\xb7\x84\x16\xd5\xcc\xdc\x74\x82\xb9\x93\x22\x76\x05\ +\x06\xa7\x08\xe8\xaa\x3f\x45\xa9\x3f\x7e\xe6\xc5\x5b\xdc\xbc\x1a\ +\xb3\x62\x5e\x43\xff\x84\x06\xfd\x6c\x2e\x70\x27\xce\x81\xc8\xc2\ +\x8b\x6b\x73\xd9\xb8\x7a\xbf\xbe\x08\x9c\x8a\xcf\xbd\xba\xb8\x21\ +\x02\xdd\x87\xe1\x60\x93\xd5\xf6\x36\x67\x1c\x63\x27\xcb\x88\x66\ +\x6f\x5d\x62\xe3\xb2\xd0\x2b\x1f\x57\x03\xb9\x0c\xe6\x91\x12\x31\ +\xd8\x3d\x45\x1f\x7c\x4f\x06\xee\xf8\xd4\x13\x8b\xd4\x03\x91\x89\ +\xcb\xb6\xb3\xaf\x6f\x80\x2e\x54\x71\x12\x13\x17\x8c\x87\xa0\x7f\ +\x8b\x46\x46\x99\x61\xc1\xc4\x4a\x26\xb2\x63\x27\x05\x4b\xca\x19\ +\x06\x36\x53\x4d\xe0\xe5\xc4\xcb\x31\xf5\x08\x88\xf0\x12\x13\x53\ +\x17\x27\x42\x4c\x80\x11\xb9\xc4\xa6\xf7\xa1\x01\x6d\x58\x82\x2e\ +\xbf\xbc\xf9\x32\xde\xe4\x16\x27\x85\xe3\x69\x47\x7d\x30\x37\x2a\ +\xf9\x4c\x57\x61\xe7\xdd\x1a\x37\xd6\x2e\x91\x6f\xc1\xc3\x83\x88\ +\x0f\xfe\xe2\xbb\x7c\xe5\xbd\xff\x8b\xc3\xc3\x13\xb1\xbc\x25\x89\ +\xb8\xd9\xb9\xc1\xee\xc7\x1b\x6c\x04\xfb\x5c\xbd\xfe\x79\x39\xd2\ +\x2f\xab\xfe\x02\x17\x5f\xbe\x7e\xca\xde\xc3\xa7\x68\x15\x34\xed\ +\x91\xe6\x70\x79\xe3\xff\xe7\xec\x4d\x63\x24\x49\xef\x33\xbf\x5f\ +\x44\x46\x1e\x91\x77\x66\xdd\xdd\x55\xdd\x5d\xd5\xdd\xc3\x69\x0e\ +\x39\x33\xa4\x48\x91\xa2\xa4\x15\xe1\x7e\xba\x07\x00\x00\x20\x00\ +\x49\x44\x41\x54\xb5\xdc\x5d\xd0\xdc\xc5\x7a\xd7\xd2\xae\xbd\x6b\ +\x08\x82\x05\x08\x86\x77\x05\xfb\xc3\x2e\x20\xd8\x1f\x6c\xd9\x30\ +\x60\xaf\xe1\x05\x0c\xfb\x83\xf5\xc1\xb2\x56\xb0\x21\xcb\xd6\xb5\ +\xb2\x6e\xea\xe0\x50\x9a\xa1\x66\x28\x72\x86\x33\x54\x4f\xcf\x74\ +\x75\xd7\xdd\x75\x57\x9e\x11\x19\x79\xc4\xe1\x0f\x6f\xbc\x6f\xbe\ +\x11\x99\xd5\x43\x39\x1b\x8d\xc8\x23\x32\x2b\x33\xe2\x79\x9f\x78\ +\xfe\x77\x93\xa3\x9d\x32\xa5\xd5\x63\x06\xa7\x36\xc5\x55\x0f\x7f\ +\xbb\x00\x5c\x50\x2a\x1c\x53\x5b\x7b\x45\xbd\x5f\x82\xb9\x45\x15\ +\x23\xec\x63\xf6\x3a\xaa\xc0\x53\x1a\x57\x92\x1d\x74\x00\x2b\x2d\ +\x5c\x35\x19\xf6\x04\x80\xfd\x5e\x48\xc1\x2a\x31\xa9\x58\x04\xed\ +\x2e\x05\xab\xa4\x0c\xbe\x82\x25\x64\x47\xab\x9a\x11\x6c\x5c\xf4\ +\xb0\xe2\x85\x22\x19\xbf\x54\xce\xce\x74\xd3\x14\xe9\xa4\x0d\x7e\ +\xf4\xae\xc9\xb8\x3a\x61\xa5\x52\xa4\xbc\x60\xb0\xd4\x8e\xdb\xd4\ +\x2e\x65\x68\x5d\x04\x34\x97\x8e\x15\x98\x7b\x1c\x0b\x50\x3b\x24\ +\x18\x5a\x82\x39\xbf\x08\xce\xe5\xe7\xd9\xeb\x5e\x02\xf7\x58\xcb\ +\x0c\xa8\xd5\xf7\xb5\x90\x76\x48\x8d\x3e\x93\xae\x8b\x63\x2d\x02\ +\xd3\x28\x9f\x9e\x3c\xaf\x87\xa4\x1d\xd3\xe5\x56\x54\x25\x73\x23\ +\x8b\x5f\xff\x34\x56\xe7\x6d\xc5\xc4\x72\x00\xbc\x5a\x70\xac\x50\ +\xf6\xdb\x74\xc6\x0b\x74\x03\xd1\x2a\x40\x06\x56\x40\x4c\x14\xb5\ +\x26\x0c\xa8\x58\x45\xc5\xc6\x43\x62\x99\xe0\x8b\x68\x5d\xc1\x1a\ +\x32\xf4\x0b\x62\x3c\x96\x35\xc0\x2c\x46\x0a\xc0\xe3\x68\x81\x9c\ +\x71\xa5\x34\xb3\x64\x6f\x09\xe0\x34\x33\x67\xed\x88\x81\xe7\xb1\ +\xbd\xff\x6d\x95\x37\x91\x8b\x5e\x20\xc7\x0b\x31\xa3\xdc\x01\x76\ +\x78\xd0\x34\x78\xd4\x8a\x78\xd4\x8a\x28\x01\x2b\x95\x22\x4f\x98\ +\x30\x3a\x3b\xe4\x1b\xc0\xc3\xb7\xb6\xa1\x1a\x51\xb7\xaa\x74\x18\ +\xb2\xdf\x7f\x46\xf8\xb5\x33\x0e\xea\x35\xa2\xbd\x36\xeb\x5b\x6b\ +\xd0\x86\xcd\x8f\xef\xd1\xee\x0a\x66\xe5\xf0\x31\x47\x3b\x2f\x50\ +\xca\x3e\xa6\x1b\x09\x7d\x4c\xf6\x5d\xf5\x9c\x3b\x79\x81\xd5\xba\ +\xc3\xe9\x64\x43\x68\xe0\xe1\x0d\xb5\x00\x2a\xc3\x1b\x50\x78\x0c\ +\xab\x82\x8d\x9b\xb4\x69\xf5\xa6\xbd\xd4\x64\xb9\x91\xce\x96\xba\ +\x77\xc2\xaa\x9a\xe2\x31\x9e\x00\x6b\xbc\x95\x80\xcc\x5a\xa5\x19\ +\x46\xee\x59\x65\x2c\x2d\xb8\x29\xd9\xb8\x54\xce\x2a\x30\x27\x00\ +\x5c\x81\x57\xd7\x9b\x94\x56\xd6\xc9\xdf\x99\x70\xab\x52\xa4\xb9\ +\x30\xa6\x6e\x4f\x73\x28\x5a\x17\x81\x02\xef\x89\x77\x48\x73\xe9\ +\x58\xb1\xf2\x0c\x43\xc7\x6c\x5c\xb8\xfb\x71\x88\xee\xb3\xff\xf6\ +\xb7\x79\xfc\xf4\x9b\x9c\x76\x0e\x19\xb4\x87\x7c\xac\x71\xc5\x6a\ +\xed\x26\x0b\x9f\xda\xe0\xb3\x2f\xdc\x60\x52\xfb\x12\x74\x9f\x10\ +\x45\x4d\x9c\xac\x4b\x69\x12\x2a\xcf\x45\x2d\x53\x4e\xf4\x7d\x2b\ +\x87\x25\x7a\xa3\x31\xe1\xd0\x53\x4c\x3c\xe3\xa5\x28\xf6\x54\x2a\ +\xa6\x72\xd7\x55\x4a\xaa\x89\xfd\x90\xb8\x21\x62\x35\xc2\x32\x86\ +\x06\x7d\x2b\xc9\xc4\x12\xcc\xd2\xd8\x93\xcc\x3c\xf4\x45\x88\xd0\ +\xaa\x18\xe0\xc5\x63\x05\x2c\x12\xba\x57\x56\x86\x48\x00\x2b\x57\ +\x9b\x5d\x60\xe2\x0d\xd9\x3b\xff\x36\xe3\xf0\x17\xb5\x06\x7f\xaf\ +\xf3\xa0\x69\x40\xe6\x07\x79\x78\xf8\x98\x17\x6e\xbc\xc8\x6f\xbd\ +\x97\xf4\x25\x1a\x93\x15\x16\x3a\x8f\xc8\xaf\x6c\xc4\x8d\xfe\xb6\ +\xc9\x16\x3e\x8e\xeb\xef\x28\x36\x32\xad\x15\xba\x9d\x33\xc2\xd0\ +\xa0\x73\x01\x0d\x33\xa2\x7d\x58\xa5\x66\x08\x2f\xc3\x0b\x96\xcd\ +\x99\x61\x63\xae\x37\x09\x8f\x36\xe2\x16\xad\xaf\x50\x09\x2e\x98\ +\xb4\x9b\xb0\xfc\x98\x53\xa6\xc3\x17\xa5\x76\x3e\xcd\x94\xa1\xf0\ +\x98\xc1\xa9\x2d\x74\x32\x87\xb4\x43\x03\xa3\x2a\x3a\xbe\x4f\x23\ +\x72\xc5\x84\xac\xd0\xdd\x6b\x7e\x2f\xc4\x7a\xce\x88\x1f\x25\x0f\ +\x9e\x63\x24\xea\x75\x79\x69\xf6\xd5\x01\x7c\xef\x4e\x72\x42\x4c\ +\xc7\x7b\x46\xdd\x4e\x8e\x11\x10\x00\x16\xac\xbc\x66\x13\x6f\x37\ +\x12\x60\xa6\x20\x00\x5c\x28\x2d\x72\xef\xd3\x5b\x6c\x6d\xdd\xe1\ +\xbd\x6f\xdf\xe7\x7f\xfe\x7f\xdf\xe4\xcd\xf7\xff\x98\x3f\x63\x85\ +\xdb\xb6\xcb\xcb\x5f\xfd\x7d\xde\xff\xd4\x67\xf9\x7b\xff\xc9\x6d\ +\x6e\x37\x36\xd9\x6f\xef\x62\x52\x42\xd5\xed\x6b\xb9\x15\x51\xd0\ +\x27\x5b\x29\x31\xe9\xbb\x50\xc8\xa9\x5c\x62\x1d\xc8\x12\xc0\xd2\ +\x3b\x91\xf8\x8c\x81\x41\x2f\xd6\xd5\xd5\x38\x02\xa8\x34\xb1\x94\ +\x14\xb2\x3a\x5e\xea\x62\x09\x6a\x29\x2d\x0a\xd6\x90\xf1\x60\x21\ +\xd6\xc0\x02\xe8\x82\x79\xa7\x80\xb5\x3c\x4f\xb1\xb0\xa7\x97\x36\ +\x69\x33\xed\x66\x82\x1d\xad\x08\x78\x5d\x19\x78\x0f\x9a\x86\x7a\ +\x7e\xf3\xea\x2e\x23\xff\x28\xae\xd1\xbb\x10\x45\xa9\xd5\x08\xfc\ +\x1d\x35\x81\xc8\xa8\x1a\x58\x83\x3c\xa6\xb5\x42\xcd\x14\xe3\x02\ +\xfa\x40\xeb\x03\x78\x56\xdd\xa6\x61\x46\x84\xf5\x06\xf7\x1f\x5c\ +\x11\xad\xff\x0d\xb8\x03\xd9\xd8\x47\x4c\xa6\x4c\x69\x59\x48\x89\ +\xd2\xaa\xf0\x8a\x48\xe9\x50\xa9\x83\x71\x75\xc8\x20\xfe\xe2\xa5\ +\xec\x63\x06\xd8\x58\x83\xbc\xea\xb3\x56\x37\xab\x74\x2a\x11\x46\ +\xd0\x9f\x31\xca\x54\x40\x03\x21\x23\x0a\x83\x52\x02\xdc\xa5\x30\ +\x87\x6b\x8e\xe7\x02\x58\x0f\x8c\xb4\x8a\x1e\xd6\x60\x42\xb5\x3c\ +\x6d\xac\x22\x73\x29\x9a\x35\xd1\x31\xbe\xbc\x61\xb0\x5c\x10\x12\ +\x02\xa0\xb2\xb0\x4a\xeb\xea\x94\xca\xc2\x2a\x10\x70\xe1\x65\x58\ +\x9a\xc3\xca\x12\xd0\x27\x17\x87\xca\x2b\xd5\xf1\xde\xa4\xb5\x9d\ +\xe3\x07\x2f\xa1\xf0\x37\xff\x46\x9c\x45\x18\xf1\xf2\xf7\xbd\xcc\ +\xff\xd0\xa8\xf2\xcb\x2f\x2e\xf1\xf3\xff\xeb\xff\xc5\xbe\x97\xe7\ +\xd2\x2f\xb3\xf8\xf0\x3d\xdc\x7f\x7d\xce\x57\x7e\xf2\xef\x73\xeb\ +\xd3\x9f\x63\x70\x7c\x86\x1b\x64\x21\x18\x52\xce\x25\x03\x22\x7e\ +\x5c\xa3\x57\x8d\x0a\x5c\x5d\x66\xe7\x06\x3c\x9c\x41\x15\x73\x74\ +\x4e\xe9\xc5\x64\xf5\x6a\x14\xf4\x45\x7f\x65\x2d\x4f\xa3\x54\xce\ +\x92\xf9\x07\x3f\xf9\x4f\x7e\x6e\x1c\x46\xd8\xfe\x88\x61\x6c\xb0\ +\x15\xac\x21\x7e\x68\xe1\x87\x96\xba\x0f\x60\x99\x3e\x93\x20\xc2\ +\x34\x3d\x32\x64\x19\x87\x11\x56\xce\xc7\x18\x1a\x04\xd6\x04\xd3\ +\xf7\x15\x98\xf3\x7e\x0e\x3f\x0b\x96\xe7\x31\xb6\x2d\xe5\xb5\xa8\ +\xd6\x8e\xb8\xea\xbd\xc3\xe5\x35\x25\x7a\x97\x9e\x08\x45\x9f\xbc\ +\xf9\x80\xc2\xd5\x12\xd6\x55\x95\x76\x77\xcc\x5b\x57\x1d\x1e\xef\ +\xed\x91\x5d\xbc\x64\xbf\x56\x63\x6b\xa9\x45\xbf\x9f\x05\x31\x72\ +\x84\x30\xf4\xc9\x98\x16\xe3\xf1\x94\xf2\xc2\xd0\x87\x91\x48\x66\ +\x3f\xef\x44\x5c\x5c\x7a\x8c\x8f\x5b\x2c\xe4\x4f\xa8\xde\xf9\x18\ +\xb7\x22\x1f\x7f\x60\x30\xe2\x8c\x71\x7e\x8b\x5c\xe6\x4a\x80\xb9\ +\x26\x1e\x47\xf9\x3d\x26\xce\x32\xd1\xc2\x12\x86\xd7\x63\xe2\x64\ +\x69\x87\x06\x61\x36\x10\xe3\x4d\x62\x26\x68\xe4\x1c\x26\xee\x34\ +\xe0\x60\x8a\xcc\x6f\xc2\xac\x8f\x35\xb0\x19\x7b\x63\xac\xaa\xa9\ +\x1e\x97\xc2\x1c\x13\x23\x60\x62\xcc\xe6\xfd\x56\x7d\x07\xb7\x1c\ +\xf7\xe5\x9d\x64\xa9\x96\x07\x78\x91\x81\x39\xc9\xaa\xf2\x7e\xaf\ +\x6b\xd0\x2c\x4e\x01\xbc\x75\x7f\x85\x92\x55\xe2\xde\xed\xa9\x9c\ +\x19\x7b\x4e\x0c\x60\x38\x3b\x3b\x67\x7d\xc1\xe6\xc2\xcb\x50\xca\ +\x4e\x89\x65\xcd\xde\xc0\xf1\x7b\x78\x83\xe9\x73\x17\x5e\x86\xde\ +\x69\x95\x0f\xbe\x71\xc8\xd7\x7f\xe5\x6b\x5c\xee\x3f\xe1\x85\x4f\ +\xbe\x82\x5d\x76\x70\x4b\x36\x8d\xb5\x25\xb6\xee\x7f\x8c\xbf\xf3\ +\xf2\x8b\x7c\xf5\xe1\x11\x8e\x13\x50\xb7\x8a\xbc\x7d\x70\x89\xfb\ +\xf5\xd7\x29\xdc\xf4\x78\x61\xf5\x2e\x41\xc9\x20\x37\x09\x31\xcc\ +\x3c\xc8\x10\x75\x2c\x2f\x5c\xcb\xc7\xb0\xb3\xf4\x7a\x97\xbc\xf5\ +\xc6\xeb\xd8\xd6\xd4\xe8\x1c\x4f\xf2\x71\xf3\x19\x97\xd5\x5c\x8d\ +\xad\xcf\x6f\x60\x79\x6b\x8c\x30\xc8\x96\xb3\x54\x07\x06\x79\xc0\ +\x9b\x98\xe4\x81\xff\xe5\xdf\xfc\x3f\x64\x7e\xfc\x27\xfe\xf1\xcf\ +\x01\xf8\x71\x4f\x80\x8a\x9f\x25\xf2\x27\x64\xc3\x80\x6c\x18\x30\ +\xa4\x30\x03\xea\xa1\x5f\xc0\x34\x3d\xfc\xd0\x22\x34\x6a\x64\xb2\ +\x82\x89\x87\x51\x15\xc3\xe8\xe1\x4f\x6a\xe4\x0c\x1f\x7c\x8f\x71\ +\xb4\x40\xd6\xef\x91\xf7\x73\xb8\x91\xcd\x64\xb2\x42\x77\x74\xc5\ +\x52\xe1\x90\x25\xdb\x98\x01\xf3\x83\xa6\xc1\x37\x5e\xbf\x4d\xdd\ +\xbf\x03\x41\x95\xcb\xee\x05\xdf\xba\xff\x2d\x46\x2d\x9f\x83\xf3\ +\x90\x8b\x8b\x90\x4f\xfe\xad\x13\x38\xb7\xa9\x56\x26\xf4\x2e\x85\ +\x81\x13\x95\x03\xc2\x6c\x80\x39\x99\x82\xb8\x15\x4d\x28\x60\xe0\ +\x38\x19\x72\xb9\x0c\x97\x97\x13\xba\x83\x31\x4f\x9e\x9c\x72\xbe\ +\x73\x44\xb8\xde\xc3\xa8\xf6\xa8\x2c\xfc\x6d\xca\xb5\x0f\xb8\xba\ +\xda\x80\x62\x8d\x5c\xe6\x8a\x49\xb8\xc0\x24\x5c\xa0\x54\xdb\xc3\ +\xbf\x18\x08\x29\xe1\xf5\xb0\x0d\x18\x46\x06\x5c\x88\x3c\x85\x41\ +\xde\xa4\xc8\x08\xd7\xf2\x29\x18\x79\x02\xd7\xc4\x2f\x7a\x54\x46\ +\x25\x02\x5f\xdc\xcf\x05\x45\xcc\x49\x16\x73\x92\x55\xec\x7b\xdd\ +\x2d\x5f\xf5\x99\xb8\x62\x7f\xbf\xe8\xe1\xc5\xee\xb3\x4a\xbe\xa8\ +\x6a\xf7\x9a\x8d\x88\x95\x8d\x06\xeb\x0b\x59\xb6\xee\xaf\x50\x69\ +\x42\xde\x86\x72\x7e\xca\x6c\x95\x85\x55\x9c\xd3\x88\x5c\xd9\x20\ +\x5f\x2c\x33\xf0\xcd\x04\x13\x03\x38\x7e\x0f\x72\x1f\x83\xe0\x8a\ +\x0b\x2f\xc3\xf9\x91\x41\xfb\x69\xc0\x37\x8f\x8e\x79\xfb\xd1\x01\ +\x6f\x1c\xfa\xbc\xbb\x7f\xc6\xc1\xaf\x7f\x97\x85\xdb\x11\x77\x6e\ +\x3f\x80\x4c\x01\xdf\xce\x71\xab\xb1\xc8\xf7\xdf\x59\xe6\xd9\x38\ +\xc7\xc3\xed\x03\x26\x66\x95\x67\xe3\x21\xce\xce\x77\xa8\xad\x67\ +\x59\xb9\xd1\x24\x18\x16\x71\xfd\x88\xa5\x6c\x71\x9a\x6b\x91\xa9\ +\x90\xf5\x47\x50\x5c\x64\x6f\xcf\xe3\xfd\x47\x0f\x13\x20\x2e\x17\ +\x7b\x8c\x27\x79\x8c\xc0\xe5\xc1\x8b\x8b\x2c\x2d\xdf\xc2\xce\x07\ +\xe4\x02\x9b\xec\xc4\x50\xd2\x42\x26\xe4\xff\xca\x2f\xfe\xb6\x90\ +\x13\x51\x77\x84\x11\x8b\xe8\xbe\x35\x01\xf2\x6a\x78\x8b\x74\xa5\ +\x29\x39\x11\xbb\xda\x86\x7e\x41\x79\x27\x94\x7f\xcf\xf0\x70\x23\ +\x21\x37\xa4\x26\xce\x1a\x9e\xea\x4b\x11\x06\x2e\x05\x6b\x48\x2e\ +\x12\xae\xb5\x79\x3d\x84\xbf\xf1\xfa\x6d\xc2\xa3\x0d\x06\xf6\x90\ +\x62\xa3\xc0\xc5\x5a\x12\xe5\xe1\xfd\x55\xa0\xcf\x77\x27\x0b\x34\ +\x2f\x3c\x8c\xaa\xf2\xc3\x27\x7a\xa1\x4d\xfc\xa1\x9e\x6c\xa7\xf4\ +\xaa\x0c\xd3\xb6\xc2\x1e\xbb\x7f\xd8\xa3\x5e\xaf\xf1\x62\xf3\x5b\ +\x98\xf6\x06\xeb\x5b\x87\x71\x98\x3a\x96\x0e\xa7\x36\x03\x6c\xe5\ +\x33\x16\xc5\x8a\xb1\x5b\xad\x2a\x00\x95\x35\x27\xf4\x28\xd2\x2c\ +\x0f\x68\xc5\x61\x5f\x6b\x60\xcf\x00\x55\xc9\x88\x6a\xa4\xb5\x01\ +\x4d\xbe\x56\xf5\x45\x7b\x26\xb9\x0c\x65\x16\x5c\xcd\xac\xaa\xcc\ +\xb4\x5a\xa3\xc6\xab\x0f\x9a\xb1\x7c\x58\xa6\x12\x27\xf4\x49\x19\ +\x21\x6d\x08\x80\xc6\xea\x21\x76\xff\xd3\xf4\x2a\xd3\xe1\x2d\xa3\ +\xf3\x15\x11\x81\x53\xd4\xf7\x21\x17\x5e\x06\xe7\x34\x62\xfb\x78\ +\x97\x9d\xed\x33\x0e\x8e\x3d\x2e\x7b\x59\xee\xdd\xbe\x01\xc6\x31\ +\xbf\xb1\xf3\x3a\xc1\x7f\xf1\x88\x27\xff\xf1\x84\x1f\xfb\xf7\xff\ +\x19\xf5\xd2\x15\xbd\x46\x9e\x57\xbf\xf4\x2a\x3f\x7b\xe7\x36\xff\ +\x0a\x78\xf3\x6b\x7f\xcc\x62\x65\x89\x6f\x1e\xc2\x8d\x7f\xfb\x3e\ +\x4b\xb5\x7b\x34\xef\x82\xe7\x56\x38\x26\xa0\xcc\xd4\xed\xf6\xbc\ +\x9b\x33\x98\xed\x66\xd4\xce\xe6\x30\xc6\x86\x32\x12\x25\x80\xfd\ +\x81\x29\x3a\x00\xfd\xf8\x4f\xfc\xe3\x9f\x33\x62\x31\x1c\x75\x47\ +\xc8\xfb\xbe\x69\x29\x76\x96\x00\x1e\xfa\x05\xa2\x68\x02\xa5\x2c\ +\xe1\x18\xc5\xce\x7e\x68\x91\x37\xe3\x9e\x5e\x46\x8f\x0c\x59\x06\ +\x7e\x06\xd3\xf4\x18\xf8\x19\x6c\x33\x27\xf4\x75\x29\x4b\xde\xcf\ +\x51\x2d\x2d\xd1\x77\xc7\x34\x4b\x25\x96\x0a\x87\x5c\x7a\x22\x31\ +\xe7\x62\x34\x21\x30\x7b\xd8\x79\x8b\xe5\xaa\x8f\x91\xe9\x53\xae\ +\x1d\x70\x1e\x4d\x30\x96\x3d\xce\x1f\xe6\x31\x5a\x0e\xcb\x2f\x8d\ +\x59\xbe\x82\x9e\xdb\x24\xeb\x1a\x62\x1c\x97\x33\x62\x6c\x58\x62\ +\xd0\x4b\xe8\xc7\xd5\xd6\x86\x0a\x10\x74\x8c\x88\x8a\x65\x13\x86\ +\x22\xdb\xac\x64\x0c\xc9\x19\x35\x32\xa3\x2e\xdb\xad\x2e\xee\xd5\ +\x33\xce\x2e\x2d\x7c\xf7\x8a\x6c\xd9\xc7\x9d\xbc\x40\xa9\x76\xc6\ +\xc4\xc9\xaa\xad\x04\xb0\xcc\x26\x23\x0f\x93\x71\xa8\x3c\x07\x92\ +\x3d\xf5\x6d\x98\xf5\x15\x0b\x03\x2a\x73\x4d\xbf\xc9\xfd\x27\x41\ +\x49\xed\x27\xf7\xad\xe4\x8b\x8a\x7d\x0b\xb5\x02\xaf\xde\x9d\x05\ +\x30\x40\xc5\x5c\x87\x4c\x1c\xde\xcf\xb8\x8c\x3d\x07\xab\x78\x93\ +\x30\xff\x01\x21\x35\xaa\xfd\x45\xda\xe6\x90\x6a\xbd\x9f\x90\x0e\ +\x03\xdf\xe4\xc9\xde\x0e\xad\xf7\x43\x5e\x3f\x18\xd0\x3a\xbd\xa2\ +\xd5\xf5\x58\xa8\xae\xab\x16\x58\x3f\x52\x1e\xf1\xa7\xc3\x32\x7f\ +\xf0\xbb\xbf\x4d\xdd\x3b\xe6\xe3\x4b\x2f\x61\xaf\x2e\xc7\x95\x29\ +\x79\xbe\xf8\xea\x5d\x1e\x9e\x79\x3c\xdc\x3e\xe0\x46\x29\xcf\xdb\ +\x07\x97\x64\x4e\x0f\xd9\xfa\xf4\x3a\xd5\x8a\xc5\xb0\x6f\x32\xca\ +\xda\x4c\x46\x23\xf2\xd9\x12\xae\x1f\x51\xcc\x5a\x3c\x3b\x1f\xcc\ +\x30\xb1\x39\x3a\x27\xb2\x4a\x18\x81\x8b\xbd\xb4\xcc\xbd\xad\x9b\ +\x64\x73\x8b\x94\x27\x50\x30\x73\x74\x03\x87\xb1\x99\x27\x18\x3a\ +\xd4\xcc\x1c\x3f\xff\xcb\xbf\x4e\xe6\x27\xfe\xc9\xbf\xfb\x73\x12\ +\xac\x45\x2b\xc0\x37\x2d\xda\x13\x1b\x3b\x93\x34\x36\xa4\x2e\x2e\ +\x58\x43\xc2\xac\x00\x71\xc1\x1a\x62\x99\x3e\x7e\x68\x61\x9a\x1e\ +\xc3\xa8\x4a\xc1\x98\x66\xbc\x49\xdd\x6c\x9a\x53\x59\x91\x21\x4b\ +\x86\x2c\xc5\xc5\x5b\x58\x85\x1b\x94\x2a\x5f\xa2\x18\x8d\xd8\x3b\ +\x38\x22\x1b\xeb\xd9\xf6\xe2\x09\x95\x9b\x5d\x0a\x57\x4b\x84\xf9\ +\x36\xa5\x1b\x11\xed\xbf\xa8\x13\x3c\x9d\xe0\xe5\x4d\x4e\xc7\xb7\ +\x39\x0f\x8b\x94\x4f\x9e\x61\x98\x65\xaa\xe3\x0c\x8e\x61\x4c\x75\ +\xb0\x96\x77\x5b\x8d\xd3\x23\x87\x06\xe4\xc2\x80\x8e\x11\x31\x34\ +\xc0\x8b\x53\x1a\x23\x0a\x14\x8c\x3c\x8e\x93\x61\xdc\x17\xc3\x4d\ +\xba\x97\x65\x8a\x91\xd0\xc0\xd0\x60\xe2\xf8\xb4\xa8\xd2\x34\x46\ +\x78\x43\x18\x45\x23\x02\xd7\x24\x37\xb4\xf0\x4a\x42\x0f\x57\xcb\ +\x03\x5c\xcb\x57\x46\x9b\x04\xa3\xdc\x4a\x50\xa7\xf5\xef\xc8\xcc\ +\x4d\xf5\x6f\xac\x87\xa5\xec\x98\x18\x01\xb9\x5c\x46\xe9\xdf\x8f\ +\xdd\xac\xf2\xe2\x8a\x41\xa1\x94\x04\xf0\x4a\xa5\x38\x05\xb0\x26\ +\x27\x44\x5f\x0f\x01\x60\xaf\xf2\x36\x0b\x76\x59\x01\x77\xe0\x9b\ +\x38\xa7\x11\xfd\xed\x23\xbe\xf9\xc1\x84\x6f\x6f\x6f\x73\x76\xe2\ +\x31\x18\x65\x58\xa8\xae\xd3\x8a\x5a\x78\x91\x85\x87\x47\x2f\x73\ +\x83\x62\xbe\x44\x60\x65\xf9\xe3\xd7\xdf\xa0\x7f\xf2\x2e\x9f\xa8\ +\xaf\x53\xdc\x68\x60\xe6\xc6\x14\x16\x1a\x7c\xe1\x07\x3e\xc5\x07\ +\x7b\x1d\x25\x2d\xee\xf6\x73\x9c\x1d\x5c\xf0\xb9\x57\x6d\xfc\xea\ +\x3a\x13\xa7\x4f\x29\x63\xe0\xfa\x11\xa5\xcc\x84\x28\x58\xe4\xb8\ +\xf3\x98\xf7\xdf\xdf\x57\x20\x6e\x8f\x2c\x8a\xf4\x15\x88\xef\x17\ +\x2b\x6c\x7d\x7e\x83\x49\x2f\xcb\xd8\xcc\x33\x0c\x1c\x6a\x99\xb2\ +\xda\xf6\x30\xf8\xc5\x5f\xfe\x35\x61\xd8\x29\xa0\xc6\x60\x96\x00\ +\xd6\x99\x39\x01\xe6\xa0\x44\x3e\xd3\x17\x2e\xb7\x18\xc4\x96\xe9\ +\x13\x50\x24\x67\xf8\xca\xf0\x9b\x30\xc0\x36\x73\x84\x4c\x98\x04\ +\x11\x94\xb2\x0c\x87\x11\x79\x53\xe4\x26\x67\x83\x12\x76\x71\x15\ +\xb7\xd3\x66\x64\xbd\xcb\x49\xe4\xf1\xc2\x52\x01\xe7\x4a\xe4\xfc\ +\x0e\x17\x2e\xd8\x6c\xff\x30\xc1\x59\x91\x61\xc5\xa2\x91\x5b\x22\ +\x6b\x44\xac\xd7\x7a\xdc\x9b\x34\x58\xa8\xd7\x69\x56\xb3\x9c\xf5\ +\xc4\x84\x4e\x59\x71\xac\xae\x1e\x31\x13\x0f\xf2\x26\x0b\x51\x8f\ +\x88\x82\xca\xd3\xd5\xf3\x6f\xe9\x19\xe4\x2a\x22\xbf\xd7\xca\x89\ +\x96\x53\x41\x98\xc1\xf7\x0b\xe4\xd6\x1a\x18\x5e\x06\x9b\x2e\xed\ +\xd0\xa0\x33\x8e\xa8\x1b\x05\x26\xe3\x90\x5c\xc5\xa4\x60\xe4\xf1\ +\x2c\x97\x9c\x51\x23\x70\x67\x1b\x72\x55\xcb\x03\x46\xe3\xec\x5c\ +\x30\x4b\x00\xab\x4b\xbd\x99\x13\x00\x2e\x8b\x86\x78\xb9\x5c\x46\ +\x34\x18\xd4\x3c\x10\x3a\x80\x1b\xed\x2c\xb5\xe5\xd9\x4a\x13\x63\ +\xb2\x42\xa9\x7c\x48\x18\xbb\xe3\xc2\xfc\x07\xd4\xed\x9b\x5c\x78\ +\x62\x41\xf7\xaf\x4e\x19\x7b\x0e\x4f\x8e\x2e\xf8\x83\x0f\x26\x5c\ +\x3d\x3b\x54\xc9\xf2\x46\xce\xc4\x75\x1c\x0c\xad\x3b\xa5\x17\xff\ +\x5b\xc8\x2f\x12\x65\x3c\x3e\x3c\xed\x70\xfa\xfa\x1e\x2f\xdd\xbd\ +\xa4\x72\xe7\x53\x90\x29\x50\x2a\x98\xfc\xc8\x8b\x5b\x3c\x3c\xf3\ +\x38\xda\xdb\xe1\x70\x78\xc4\xc3\xc3\x1d\x16\x7d\x9f\x97\x3f\x96\ +\x21\x30\x8a\xb8\x81\x09\x85\x0c\xb9\x30\xc2\x30\x43\x4e\x5b\x59\ +\xde\x7f\xf4\x90\x61\x60\x62\x5b\x21\xc3\xc0\x64\xb1\x31\x51\x9a\ +\xb8\x76\x67\x95\xad\x1b\xeb\x80\x4d\xcd\xcc\x31\xea\x8d\x18\x65\ +\x27\x22\x57\x23\x70\xc8\x96\xb3\xfc\xc2\x2f\xfd\x7a\x72\x40\xb9\ +\x94\x0c\xea\x60\xd4\xe6\xcf\x26\x0b\x03\x57\x19\x7c\x52\x1b\x0f\ +\xfd\x02\x56\x65\x40\xbf\x2f\x06\x9a\xfb\x95\x08\xbf\x5f\x60\x48\ +\xa8\xc2\xd4\xd3\x28\x5f\xec\x53\x5d\x2a\xe1\x5e\xf4\x55\xc6\xda\ +\xc7\x6b\xa5\x44\x97\xcb\xfa\xe3\x8f\x93\x77\xaa\x2c\x2f\xc2\x32\ +\x90\xdf\xa8\x72\x70\xd7\xe3\xd6\xd8\xe6\x20\xe7\x69\x61\xe4\x21\ +\x27\x8f\x1f\xd3\xd2\x0b\x29\xe3\x5c\x5b\xbf\xe8\xb1\x94\x59\x66\ +\xe2\x0b\x40\xd7\xf5\x2a\x0a\x73\x2c\xf4\xa9\x09\xa5\x5e\x4e\xf4\ +\xbe\x95\x2d\xa8\xa4\x5b\x67\xbf\x8b\x51\x16\x85\x9b\xdd\xb0\x8b\ +\x21\x9a\xe3\xa8\x84\x1c\xd7\x99\x40\x11\xd5\x73\x4d\x0f\x4c\xf8\ +\x45\x2f\xf6\xeb\x4e\x34\x1f\x32\x73\xc3\xc9\x7a\x30\x43\xef\x9e\ +\xd9\xac\xad\x6a\x2e\xb4\x24\x03\xe7\xd7\xd6\x39\xed\xef\x26\xf4\ +\x30\x40\x79\xd5\x60\xc2\xad\xb8\xe8\x20\xa0\xe3\x91\x00\xf0\x59\ +\x7f\xc0\x93\xbd\x2c\x8f\xde\xd9\xe3\xb2\x97\x05\xb2\xaa\x57\x85\ +\x6c\x7f\x95\xbe\xb5\x08\x20\x6a\xd1\xac\xde\x05\xe0\x4f\x7a\x0f\ +\x09\x7e\xf6\x11\x3f\xf5\x9f\xdf\xe6\x85\x7f\xef\xd3\x98\x61\x83\ +\xfa\x66\x93\x7f\xf5\x5f\xff\x34\x3f\x1b\x6b\x64\x80\xff\xe9\xb7\ +\xde\xc3\x37\xd7\xf8\x77\xfe\xe9\x4b\x0c\xfc\x88\xc1\xb0\x4d\x29\ +\xae\x00\x3f\xbd\x14\x35\x7d\x8d\xbc\x20\x9e\x05\x8e\x19\xb4\x81\ +\xfc\xac\x2e\xee\x76\x66\xb5\xb4\x3f\x30\x29\x85\x39\xd1\xa0\xa0\ +\x10\x77\x29\xd6\x01\xac\x1b\x76\xe9\x9b\x7c\x4d\xdf\x5f\x82\x74\ +\x26\x6b\x29\x4e\x2a\xd2\xff\x46\xdf\x0f\xb1\x2a\x06\xa3\xa1\xc9\ +\xe9\xa3\xbd\xb9\x9d\x7d\x00\x96\x0b\xcb\xac\x2c\x79\xdc\xc8\xdc\ +\xe2\x96\x91\x65\x61\xa5\xce\xa7\x1a\x6b\x2c\xac\xd4\xd9\xba\x73\ +\x87\xd5\xfa\x06\xab\xf5\x0d\xbe\xf0\xf1\xfb\xdc\x7a\xe5\x8b\x82\ +\x59\x35\x00\xcb\x04\x99\xce\x9c\x03\x40\xcf\x10\xd1\x2f\xad\x54\ +\x48\x2f\xef\x71\x9d\x89\xf0\x05\xb7\xfa\xb4\x3a\x72\x86\xb0\xad\ +\x52\x2e\xf5\x84\x9c\x74\xee\x43\x2b\x34\xd4\xf3\xf2\xbb\xc8\xfd\ +\xf5\x72\x7e\x3d\xc2\x17\x50\x53\x00\xce\xd0\xa5\x99\x81\x17\xee\ +\xdc\xe1\xf6\x9d\x8d\xb9\x00\x06\x88\xb2\x67\x73\x25\x84\x88\xbe\ +\x8a\x34\xc1\x9d\xa3\x0b\x26\xdc\x22\xcb\x01\xce\x69\xc4\xd3\xc3\ +\x55\xde\x7b\x27\xe0\xd1\xdb\xae\x62\x5f\x09\xda\x16\x02\xc0\xb2\ +\x52\x5a\xaf\x98\x96\xe3\x80\xf7\xfb\xcf\x44\xbb\xaf\xea\x5d\x7e\ +\xe3\x38\xe2\x7f\xff\xef\xfe\x4b\xce\xfe\xf4\x37\x09\xcd\x76\x0c\ +\x44\x83\xff\xf4\xef\x7f\x9e\xca\xfa\x16\x93\xf3\x47\xb4\xda\x06\ +\x6f\x7e\xfb\x77\x79\xfb\xe1\x1f\x51\x2b\x89\xf3\x70\x15\x64\x54\ +\x3a\xa6\x32\xde\x46\x56\x3c\xa6\x41\xef\x00\x15\x5f\x55\x75\x5c\ +\xf5\xa7\x19\x72\x55\x22\xd1\x01\x48\x02\x4b\x67\x61\x19\xa1\x93\ +\xcf\xe9\x85\xa2\x05\x6b\x88\x17\xb3\x70\xdb\xec\x61\x8f\x97\x13\ +\xde\x0b\xc1\xc8\x86\xa8\x08\xa9\xcc\xd6\x87\xc9\x7d\xf2\x85\x22\ +\xfb\xdb\x87\xfc\x9f\xbf\xff\xfb\xac\x6f\xad\xd1\x58\xdb\x4b\xec\ +\xf7\x29\xe7\xa7\xb9\x71\xc3\x8f\xe3\xe7\x00\xeb\xe8\x50\x2f\xe1\ +\xc3\x2a\x1c\x0f\x05\x6b\x7f\x76\xb3\xc4\xc3\xf7\xf2\x74\x3a\xfd\ +\x44\x0e\x83\x1e\x45\x2b\x85\x39\x5c\x67\x9c\xa8\x6f\xc3\x8c\xbd\ +\x16\x3d\x43\x31\xb1\x6b\x8e\xd5\x73\x92\xad\xa5\x6b\x4c\xa6\x3d\ +\x76\xe3\x9c\x5e\x09\x4c\x09\x48\xc9\xb6\x2e\x93\x44\xf2\xbb\x04\ +\x7a\xd0\xab\x53\xad\x76\x14\x53\xcb\x1e\xc5\x72\x41\x64\xe8\x52\ +\xb1\x36\x58\x59\xcf\x70\xff\x81\xc9\x72\x21\x43\xa5\xb9\x3c\x73\ +\x1c\x25\xfb\xea\x2c\xdc\x8f\x83\x1b\x62\x2b\x98\xb8\xb9\x30\xa6\ +\x7d\x1a\x71\x3a\xf4\x79\xb2\x77\xc4\xa3\x77\x44\xfe\xee\x65\x3f\ +\xc9\xbe\x9d\x32\xd4\x1d\x68\x95\x83\x69\x87\x1f\x8d\x99\x25\xa0\ +\xc5\xa4\x54\x9b\x56\xd4\xe2\xde\x9d\x02\xaf\x75\x3d\xf8\xd9\x5f\ +\xe0\xbf\xfd\xd5\x2f\x62\xdd\x01\xb3\x7e\x87\x57\xbf\xf4\x2a\xff\ +\xa2\xd5\xe1\x5f\x03\xfd\xa3\x1d\xbe\xfa\xee\x23\xee\x7f\xf5\x92\ +\xad\xa6\xc1\xda\x9d\x09\xed\xab\x01\xbe\x96\x6f\xde\x1e\x59\x2c\ +\x70\xcc\xa9\x07\x61\x7d\x19\x73\x74\xae\xb2\xd8\x64\xa5\x48\xf6\ +\x20\x62\xd2\x98\x56\x8d\xc8\x6c\x39\x71\x25\x4e\xb1\x6a\xd4\x15\ +\x00\xd6\x99\x58\xa6\x69\x56\x2c\x53\x81\x74\x1c\x2d\x60\x8f\x97\ +\x15\x30\xa3\xee\x68\x86\x99\x93\x12\x62\xea\xae\x6b\x56\x0c\xf6\ +\xb7\x9f\xf1\xdb\xff\xe3\xaf\x13\xed\x8b\x94\x9f\xef\x73\xbe\x28\ +\xfc\xc4\x4b\x3f\xc4\x57\x8c\xaf\xb0\x56\x79\xc6\x8d\x92\x68\x9a\ +\x71\xa3\xb4\x44\x94\x3d\x53\x8f\xcb\xab\x86\xda\xae\xd4\xd7\xb9\ +\x51\xf0\x29\xd6\x33\xd3\xaa\xde\xde\xd4\x2b\x21\x80\x3b\x51\xc0\ +\x95\xcc\x3b\xf7\x75\x9d\x91\xe3\x9e\x06\xfa\xf3\x93\x8a\x85\x11\ +\xf4\x71\x9d\x89\x02\xf0\xa4\x62\xcd\x24\xff\xe8\xee\xbc\xaa\x9f\ +\xf4\xa7\xe9\x9f\x59\x33\xab\x6a\x92\x92\x5c\x34\xb5\x7a\x8d\xb5\ +\xf5\x0c\x37\x9a\x4b\x2c\x17\x96\xe7\x5e\xa1\x56\x2a\x45\xce\xfa\ +\x83\x84\x06\x6e\x2e\x8c\x13\x8c\xdc\xbf\x12\xe9\x8b\xad\xab\x1c\ +\xee\x59\xc0\x77\xde\x5f\xe0\xd1\x3b\xdb\x71\x9b\x80\x42\x42\x32\ +\xc8\xfb\x66\x39\x43\x5d\xfb\xba\x66\x39\x33\x33\x68\x32\x74\x92\ +\x97\xfa\x66\xf5\x2e\xbf\x75\x74\xc5\x6f\xff\x57\xff\x0d\x61\x4b\ +\xb0\x71\xd7\xb0\xf8\x3b\x9f\x79\x99\x97\xee\x8b\x31\xc6\xf5\x66\ +\x85\x3f\x7c\xf8\x1e\x7f\xf1\xb5\xd7\x71\xba\x17\x94\x1a\x79\xfc\ +\x14\x13\x5f\xd5\x0a\x2c\xc7\x00\xbe\xe2\x06\xd1\xf8\x52\xe5\x13\ +\x03\xf8\xd5\x56\x82\x8d\x75\xb7\xa9\x39\x88\x8d\xda\x28\x8e\x53\ +\x4b\x1d\x3c\x70\xd1\x7c\xc1\x02\x8c\x6e\x64\x53\xb0\x44\x8e\xb0\ +\xf4\xf9\xca\xa4\x1f\xa3\x26\x80\xef\xe5\xce\x95\xac\x90\x6c\xac\ +\x12\x88\x62\x1d\x7c\x75\x34\xe4\x6b\xbf\xfe\x4d\x9e\xb4\x9f\xd2\ +\x69\xf5\x59\xbe\xda\xa0\xdf\x12\x40\x2e\xec\x3e\xa0\xb2\xb0\xca\ +\xcd\xdc\x27\xe8\x55\x2e\x15\x70\xe5\xa5\xf2\x46\x69\x89\x6a\x7f\ +\x91\xcd\xcd\x90\x6a\x7f\x91\x8d\x8c\x4b\x79\xd5\x60\xd0\xd1\xb4\ +\x9c\x04\xa2\xce\xaa\x12\x60\xf1\x6b\x0a\xcc\xf1\xeb\x6a\xab\x57\ +\x1d\x6b\x60\xd4\x2b\x98\x75\xb0\xa6\x73\x79\x75\x4d\x2b\x2b\x35\ +\xa6\xd5\xce\xb3\x61\xd6\x7a\xd7\x4c\x04\x31\x5e\x5d\x6f\x72\xff\ +\x81\xc9\xe6\xed\x0c\x95\x26\xb3\x5e\x08\xe0\xa4\x7f\x73\x46\x07\ +\xb7\xae\x72\x54\x16\x56\xc9\x72\xa0\x18\xd9\x39\x8d\x78\xb2\x3f\ +\xe0\x57\xbf\xf5\x4d\xde\xfd\xe6\xeb\xb4\xba\xde\x73\xe5\x42\x2b\ +\x6e\x14\x6e\x96\xc5\xfd\xd0\x09\xa8\x94\x6d\xd5\xbf\xc2\x65\x9c\ +\x78\x7f\x2b\x2c\x80\x71\x4c\x60\x36\x79\xeb\xfd\x6d\xfe\xf2\xb7\ +\xbe\x4a\x14\xec\x51\x8b\x7c\x8c\xad\x65\xfe\xd9\x7f\xf8\x25\x2a\ +\xeb\x5b\xb8\xd6\x3a\x4f\xf6\x86\xfc\xd5\x1f\xfc\x11\x1f\xbe\xf1\ +\x94\xc6\x64\x4c\x33\x35\x0b\x7a\xa1\x3b\xe4\xbc\x73\x4e\x98\x9f\ +\x2e\x5c\x79\x95\x15\x12\xae\x89\x5b\x1c\x27\x6a\xf8\xe4\x79\x30\ +\x8b\x5a\x41\x81\x97\x3b\x57\x60\x96\xcf\xeb\x00\x34\x8b\xc9\xac\ +\xb4\xa1\x9f\x4c\xdb\xf4\xac\x7c\x82\x9d\x6d\x7f\x84\xdf\x8f\x30\ +\x33\xe2\xc3\x2a\x95\x22\x97\xdd\x5d\x7e\xed\xd7\xbe\xce\xc3\xf7\ +\xcf\xa9\x5b\x55\x32\xd5\x0e\xc5\x46\x41\x9d\x24\xa5\x83\x62\xa3\ +\x04\xa0\x57\xb9\xa4\xda\x5f\x54\x4e\xfb\xfc\x7a\x5d\x39\xed\xcf\ +\xe3\x01\x8e\x85\xb5\x9b\xac\xad\x2d\x25\x81\xa2\x81\x59\x3d\xdf\ +\x33\x66\x8c\x3f\xfd\x39\xf9\xfc\xa4\x62\x25\xc0\x6b\x0d\x6c\xb2\ +\x7d\x9f\x6e\xd8\x4b\xfc\x0d\xf9\x19\x72\x2b\xf7\x97\x8f\x9b\x66\ +\xa4\x72\x28\xa4\xa1\x29\x35\xb3\x6e\xc0\xdd\xbb\x53\x60\x65\xa3\ +\xa1\xf4\xef\x3c\xe9\x20\xc1\xbb\x56\x79\x36\xa3\x8d\x9b\x0b\x63\ +\x9c\xd3\x48\x19\x74\x4f\xf6\x76\xf8\xea\x5f\x3c\xe1\xb5\xd7\xc6\ +\x9c\x1d\xb6\x55\xa2\x50\xdf\xf1\x12\xcc\x2b\xb5\x70\xe8\x04\x4a\ +\xf7\xca\xfb\x2e\x63\xda\x61\x87\x12\x39\xd1\x71\x33\x1a\x2a\x40\ +\xeb\x40\xae\x37\x2b\xfc\xc6\x71\xc4\xff\xf1\xab\xbf\x40\xe7\xbd\ +\xdf\xc4\x98\x74\x31\x87\x23\x3e\xfd\xc2\xdd\x04\x1b\xbf\xe6\x85\ +\xfc\xe1\xd7\xdf\xe4\x6c\xf8\x94\x61\xd6\xa3\xf7\xec\x50\x8d\x1b\ +\x96\x7a\xd8\x1c\x9d\xb3\xc0\x31\x46\x6e\x91\x1b\x05\x5f\x94\x27\ +\xf5\x23\x8c\xa0\xa5\x6a\xfb\x66\xfc\xec\xad\x62\x97\xa8\x3b\xc2\ +\x5e\x88\xb0\xc7\xcb\x53\x46\xd5\xf2\x89\x65\xef\x89\x84\x11\x61\ +\x99\x4a\x72\xd8\xfe\x28\x21\x19\x6c\x7f\x84\x77\x65\x24\xbc\x19\ +\x56\xa5\x42\xbf\x3f\xe0\x77\x7f\xe3\x21\x6f\xfc\xd9\x1f\xa9\x95\ +\x5d\xab\x0b\x4b\xd5\x30\xb7\x38\xe9\x8b\x6c\x2b\xe7\x34\xa2\x57\ +\xb9\x64\x74\xbe\xa2\x00\x7c\xec\x5e\xe0\x9c\x46\x1c\xbb\x17\xec\ +\x7e\xb8\x4d\xaf\x72\xc9\xee\xae\xc9\x72\x5b\x9c\xa0\xcf\x7d\xfc\ +\x0e\x9b\xf7\xee\xd2\xac\x37\xa6\xa0\x95\xe0\x8c\x8d\xb5\x19\x03\ +\x4e\xb2\x63\x7c\x5f\x02\x50\xa6\x48\xa6\x8b\x3b\xa5\x51\x27\xb3\ +\xd4\xe6\x97\xdf\xd8\x09\xe3\xad\x15\x1a\x34\x7b\x41\x82\xdd\xa5\ +\x61\x28\xd9\x77\xb3\x29\x3c\x10\x42\x03\x2f\xcf\x30\xf0\x59\x7f\ +\x90\x00\xaf\x8c\xc8\x25\x0c\xa3\xd3\x0d\xa2\xec\x19\xce\x69\xc4\ +\x1b\xdf\x9d\xf0\xee\x5b\x67\xfc\xc9\xdb\x8f\x79\xb2\xbf\x23\x7a\ +\xbb\x55\x44\xd7\x22\xa1\x69\x05\x98\x25\x20\xa5\x84\x90\x4c\x2c\ +\x25\x84\x18\x8c\x5e\x51\xdd\x8f\x64\x27\x23\xd9\x3a\x4b\x02\xd9\ +\x2c\x67\xa8\x37\x2b\xfc\xc9\x3b\x7d\x3e\xf8\x9d\xa7\x30\x38\xa5\ +\x6a\x3a\x98\x75\x93\xff\xe0\x27\xff\x96\x62\xe3\x56\xdb\xa0\xbe\ +\xd7\xe1\xc3\x37\x9e\xd2\xe9\x74\xa8\xce\x57\x4b\x4a\x4e\x1c\x0f\ +\x2d\x3a\x43\xf1\xe5\xda\xe6\xfc\x9e\x76\xa5\x30\x87\xd9\x1c\xd4\ +\x12\xac\x0a\xd0\x2a\x26\xa7\xf8\xb8\x91\xad\x80\xac\x8a\x49\x87\ +\x1e\x52\x8a\x78\x56\x1e\x23\x6e\x3d\x65\xfb\x23\xa2\x41\x97\x62\ +\x49\x48\x12\x2f\x77\x2e\x02\x24\x83\x90\xc7\x5f\xdf\xe3\xaf\xbe\ +\xf6\x8c\x52\x39\x4b\xa5\x70\x42\xa5\x2c\x9a\xf7\xad\x54\x27\xdc\ +\x5b\x8d\x30\xb5\x6a\x62\x09\x58\xb9\x55\x49\x2b\x71\x2f\x33\xe7\ +\x34\x22\xca\x9e\xa9\x7d\x72\xfe\x19\x9b\xb7\x37\x58\x5b\x5b\xc2\ +\x35\xc7\xb8\xce\x44\x48\x84\x58\xf3\xea\xf7\x13\x97\x7e\x4d\x3f\ +\x5b\x03\x5b\x31\xb0\xd2\xb4\x31\x20\x25\x98\xf5\x8c\xb3\x52\x59\ +\x44\xda\xe4\x7f\xdd\xeb\x20\xdf\x57\x33\xab\xb4\xaa\x99\xc4\xdf\ +\x95\x8d\x4f\x64\x16\x5a\xb6\x5a\xa0\xbc\xa1\x95\x86\xb5\x66\x59\ +\x58\x6a\xe0\xb3\xfe\x60\xc6\x2b\x21\x2f\xbd\x4f\xf6\x07\x7c\xf5\ +\x2f\x9e\xf0\xe8\x9d\x6d\xfe\xf4\xaf\x5a\xd4\xad\x2a\xcd\x5b\xf5\ +\x18\xb4\x05\x35\xfd\xb4\xef\x78\x54\xca\xb6\x92\x0a\x92\x91\x75\ +\x3d\x1c\x3a\x81\x6a\xdf\x25\x81\xad\xb7\xd2\x2a\x91\xa3\xa3\x8d\ +\xa8\x5b\xac\x2c\x11\x98\x4d\xfe\xed\x6f\xbe\x46\x6b\xe7\xf7\x94\ +\xb7\xe2\x53\x5b\x9b\x8a\x8d\xb3\xcb\x0f\x78\xcd\x0b\xd9\x3e\xde\ +\x65\x10\x57\xac\x67\xed\x1b\xca\xc5\x96\xbe\xe9\x57\xe5\x46\xd8\ +\x15\x72\xa2\x1f\x89\x0c\x39\xcd\xc6\x30\x13\xec\x19\xb3\xaf\x3d\ +\x5e\x4e\x30\x6b\x18\xb8\xaa\x82\x59\x37\xde\x24\x50\x75\x46\xf6\ +\xac\x3c\x5e\x54\x13\x9a\x7a\xa9\x4b\x25\x7f\x17\xdf\xb6\x79\xeb\ +\xdd\x0f\xf9\xed\xaf\xfe\x2a\xf8\x3b\x82\x2d\xe5\x17\x6d\x2e\x61\ +\x98\x5b\x1c\x0f\x2d\x56\x0b\x9b\x73\xf5\x90\xfa\xc2\x67\x01\xdf\ +\xce\x95\x67\x72\x04\xa2\xec\x19\x3b\x3b\xaf\xf3\xe2\xca\x33\x3e\ +\xf3\xc9\x2f\x2a\x00\xea\x5a\x77\x86\x7d\xe3\x4b\x7e\xa7\x16\x26\ +\x58\x52\xa5\x48\xc6\xc0\xd6\xfd\xb8\xe9\x5c\x07\x99\x4b\x9c\x76\ +\xb1\xe9\xef\x93\x0b\x60\x5e\x32\x7b\xf3\x56\xc4\xad\x1b\x36\x9f\ +\x5b\xa8\xb3\x5c\x58\x9e\x61\xe1\x46\x3b\xab\xc0\xbb\x5a\xd8\xe4\ +\xac\x3f\x48\x1c\x23\x63\xb2\xc2\x49\xff\x26\x67\xfd\x01\x3b\x7b\ +\x7b\xec\x6c\x9f\xf1\xed\xf7\x4e\xb9\xec\x65\xb5\x63\xdc\x8e\xbd\ +\x0a\xb6\xca\xfd\x10\x3d\xe5\x82\x84\x34\x90\x60\x95\xc0\x34\xcb\ +\x19\xfc\xe2\x28\xf6\x04\xe5\x14\x78\xf5\x4e\xa1\x4d\x6d\xd0\x47\ +\x2b\x6a\x29\xc9\xf0\x07\xff\xf7\x5b\x0c\xdd\x0f\x31\x26\x5d\x72\ +\x8d\xbc\xd2\xc6\x20\xfa\x2e\x77\xbf\x66\x72\xfe\x6c\xba\x10\xcf\ +\x3b\x42\x42\xcc\xbb\x45\x91\xd0\xc2\x41\xc7\x10\x72\xa2\x62\x50\ +\xca\x4c\x12\xc6\x9d\x39\x70\x85\x31\x37\x70\x3f\xba\x34\x4e\xd6\ +\xd2\xcd\xfc\xa1\x41\x97\x81\x2b\x00\x5d\xe8\x9d\x2b\x03\x51\xea\ +\xe3\xc9\xd1\x90\xdf\xfd\xc5\xd7\x68\x1d\x74\xd4\xc1\x14\xa5\x34\ +\xb0\x79\x3b\x43\xb9\xbe\xc3\x8d\x82\xaf\x80\x7b\x3c\xb4\x58\x68\ +\xef\xf1\xe4\xd4\xe0\x78\x68\xe1\x9e\x05\x9c\x0e\x77\xe9\xd6\xf2\ +\x98\x6c\xe3\x9e\x05\xea\x79\x79\x32\x8d\xc9\x0a\xce\x69\xc4\xc7\ +\x36\x2c\x9a\xf5\x06\x43\xdf\xa5\x63\x44\x09\x46\xcd\xd0\x55\x79\ +\x14\x12\xa4\xd9\xbe\xaf\x3c\x04\x7e\xd1\x23\xdb\xf7\x67\x8c\x3c\ +\xdd\xa7\x2b\x1f\xcb\x82\xd0\x34\x0b\x57\xcb\x83\x19\xd7\x9e\x5c\ +\x00\x19\xba\x6a\x18\x8d\xac\x44\x2e\x6f\x18\xb4\x96\x7b\x09\x16\ +\x96\xff\xdb\x8d\xe9\xc2\x3a\x1d\x8a\xa0\x46\x94\x3d\x53\xc0\x3e\ +\x1e\x5a\x98\x6c\xc7\x81\x8b\x6d\xde\xfe\xc0\x4f\x30\xa9\x04\x6d\ +\xa7\x2c\x1e\xf7\x1d\x8f\x86\x59\xc7\x65\xac\x58\x57\x9e\x0f\x09\ +\x54\xf9\x7c\xdf\xf1\x54\x42\x95\x64\x61\xd9\x9d\x53\x7d\xd7\x94\ +\x3e\x5e\xac\x2c\xd1\x6a\x1b\xbc\xfe\xce\xdb\x0c\x9f\xbe\x4f\x68\ +\xb6\xa9\x45\x7e\x42\x1b\x77\x5a\x7d\xde\x31\x77\x78\xed\x8f\xff\ +\x94\xe1\xc9\xb3\xb9\x78\x6a\xe4\x7d\x4e\x9c\x78\x40\xa4\x21\xb4\ +\x70\xaf\x59\xc5\x08\x5a\x49\x16\x0e\x46\xc2\x3b\x21\x19\xb4\x58\ +\x42\x79\x17\xd2\x99\x6b\xba\xac\xb0\x2a\x15\xac\x8a\x81\x67\x09\ +\xe0\x17\x4b\x60\x23\x7a\x32\xd8\x46\x57\xf4\x31\x5e\xea\xaa\x40\ +\x47\x7f\xf4\x94\x5f\xfb\xb5\xaf\x33\x39\x7f\x44\x76\xf9\xc1\x74\ +\x15\x9b\x43\xc5\xc2\x21\xa2\xd3\xbb\x04\xa8\xdb\xda\xe6\x20\x9a\ +\x10\x85\x3b\xd4\xba\x23\xba\xb5\x7c\x82\x81\xba\xb5\xbc\x7a\x5e\ +\xf7\x27\xde\x28\x2d\x51\x7e\x39\xc3\xad\xad\x57\xf0\x82\x20\x61\ +\x60\x89\xcc\xb5\x38\x49\x29\xe8\xab\xdc\x5f\xf9\x58\x82\x52\x37\ +\xd8\x66\x18\x3a\x7e\x6c\x0d\x6c\x8c\xa0\x9f\xe8\xe2\x23\x75\xae\ +\xac\xbc\xd0\x17\x81\xde\xea\x35\x43\x97\x5a\x46\x00\xf8\xfe\x03\ +\x53\x05\x75\x94\xad\xd1\x64\x46\x13\x57\xba\xb7\x66\xdc\x6a\x67\ +\xfd\x01\x6e\x6b\x9b\xf7\xde\x09\x78\xe3\xdb\xef\xf1\x64\x6f\xa8\ +\x64\x41\xb7\xd8\x57\x8c\x1a\x99\x15\xb2\xce\x58\xe9\x5a\x09\x38\ +\xc9\xbc\xb2\x62\x5b\xea\x5c\xf9\xbc\xde\xff\x58\xb2\xb0\x5e\x4d\ +\xa2\x7f\x9e\x32\x10\xa3\xa7\x64\xaa\x1d\xbe\x75\x60\xf1\xc1\xef\ +\x3c\xc5\x74\x46\xc2\xc8\xd3\xb4\x71\x76\xf9\x01\x97\x3d\xb1\xe8\ +\x5e\xff\xf6\x37\x94\x61\x97\x0e\x7c\xac\x95\x0d\xdc\xb3\x80\xa8\ +\xd2\xc4\x08\x5a\xd0\x8d\x65\x5e\x26\x36\xa4\x8b\x39\x4a\x99\xbc\ +\xf0\x4e\xd8\x46\x97\x68\xd0\x55\x6e\xb5\xc2\x45\x2d\x61\xbc\xc9\ +\x66\x28\x6e\x24\xaa\x9a\xc3\x41\xa8\x5e\x93\x72\xa2\x15\xf9\x71\ +\xe2\xce\x94\x81\xbd\xdc\x39\xfd\xd1\x19\x5f\xff\x8d\x90\x87\xef\ +\x9f\x93\x5d\x7e\x40\xa5\x70\xa2\x19\x3c\xe2\xa0\xe4\xce\x2f\x71\ +\x5b\xdb\x6c\x1f\xef\xd2\x6f\x4d\x07\xf0\x19\xe6\xd6\xf4\x72\x11\ +\x6b\xe5\x5a\x77\x44\xc8\xfd\x84\x76\x06\xd1\x9f\xe0\x46\x69\x89\ +\x5e\xe5\x92\xd5\xae\xc9\x46\xa3\x45\x79\xb1\xa9\xdc\x57\xd2\xa3\ +\x20\x7d\xbb\x72\x4b\xaa\xf8\x72\x52\xb1\xa6\x9a\x38\x96\x14\x92\ +\x45\xab\xbe\x93\x78\x8f\x94\x11\x12\xf8\xf5\xc8\x98\x61\xef\xf4\ +\x63\x05\xe0\x8d\x86\x1a\xdf\x25\x01\x2c\x41\x2b\x59\xb8\xd1\x9e\ +\x32\x4e\x71\xfd\x32\xa1\x89\x85\xf7\x21\xab\xe4\x03\x7d\x61\xfd\ +\xcb\xa0\x85\x6c\xb6\xdd\x29\x43\xd6\x19\x33\x29\xe7\x14\xf0\x74\ +\x90\x96\xc8\x29\xb6\x95\x3a\x57\xbe\x26\x41\x9a\xbe\xf5\x8d\x02\ +\x7e\x71\xa4\x5e\x4b\xba\xec\xaa\x6c\x36\x57\xe9\x5e\xb5\x79\x6b\ +\xcf\x65\xec\xff\x99\xd2\xc6\x77\x63\x6d\x3c\x39\x7f\x84\x6b\xad\ +\x27\x5b\x2a\xd8\x70\x9a\xba\xc8\x1b\xb9\x45\x4a\x2b\x19\x8c\x7e\ +\x8b\x28\xd3\x24\xac\x76\x84\x9b\x2d\x66\xe2\xd2\x60\x3c\xf5\x13\ +\x7b\x51\x2d\xa1\x71\x8b\x25\x91\x18\x5f\xb1\x4c\xdc\xc8\x06\xca\ +\x98\x99\x92\xea\x02\x34\xf5\xaf\x65\x12\x39\x16\xc5\x12\x4a\x3e\ +\xb4\x27\x36\x95\xfc\x0a\xdd\x77\x07\x22\x86\xee\xef\x30\x29\x1c\ +\x29\x57\x4e\x8b\x80\xa6\x39\xe4\xd4\x83\x0f\xdc\x36\x67\xbd\x2c\ +\x67\x3d\xf1\xe5\xa2\x70\x87\xb3\x5e\x56\x0c\xe3\xcb\xdc\x4a\xb0\ +\x70\xb7\x96\xe7\x46\xc1\x27\xe4\x7e\xc2\x11\x0e\x28\xe3\xef\xd0\ +\x35\x58\xad\x6f\x24\x7c\xc0\xf3\xd8\x75\x5e\x70\xc2\x08\xfa\x09\ +\xc3\xad\xea\x3b\x8a\x59\x7b\x56\x99\x52\x39\xab\xc0\xac\x03\x35\ +\xad\x87\x75\x2f\x87\xee\xda\xab\x65\x6a\x34\x6b\x36\x6b\x65\x43\ +\xb9\xd2\xce\x87\xe7\x09\x63\x4e\xb2\xf0\x41\x34\x49\xb0\xae\x2e\ +\x37\x9e\xec\x65\x79\xf2\xf4\x30\x21\x1f\x24\x40\xa5\x1c\x70\x19\ +\x2b\x00\xeb\x06\x9b\x04\xb4\xce\xc6\xe9\xed\xdc\x3a\x40\x5f\x74\ +\xd6\x9c\xf8\x43\xd5\x99\x3e\xbd\x7f\xa7\x4c\x9c\x8b\x01\x27\xef\ +\xfc\x25\x7f\xf5\x97\x21\x70\x85\x31\xe9\x72\xb7\x9e\xe1\xcb\x3f\ +\xf4\x22\xcd\x4f\xff\xdd\xf8\x12\x71\x83\xb3\xb8\x6d\x47\x1a\xc0\ +\x13\xef\x38\xf1\x9c\x11\xb4\x30\x0d\x69\x0b\x39\xb8\x41\x16\xb7\ +\x38\x0d\x6c\x99\x00\x5e\x54\x53\x8d\xb5\x3d\x2b\x8f\x9b\xcf\x29\ +\xc0\xda\x9e\x8b\x59\x14\x4d\x54\xb2\x14\x09\x03\x57\x05\x33\xa4\ +\x9c\x90\x1e\x0a\x29\x45\x1a\x59\x8f\xd3\xc3\x36\x7f\xfe\x8d\xc7\ +\xe0\xef\x80\x15\x5b\xa7\xce\x98\x6e\xb1\x2f\x1c\xeb\x61\x81\x95\ +\xcc\x34\x59\x7b\x83\x67\x9c\xf5\xb2\xe4\x2f\xab\xac\xc4\x3d\x74\ +\x4b\x2b\x99\x84\x85\x7a\xa3\x20\x1a\xde\x01\x8c\x4e\x8e\x66\x13\ +\xaa\x4f\x23\x96\xdb\xed\xc4\x68\xd5\xeb\x8a\x2f\x55\xb2\x79\xec\ +\x41\x90\x2d\xa3\x74\xab\x37\x30\x9b\x33\xb9\x0f\x41\xbd\x81\x5f\ +\xf4\x12\x0b\x62\x52\xb1\x12\xbe\x66\xe9\x86\xd3\x17\x49\xa6\xda\ +\x49\x64\xa3\xe9\xf9\x21\x69\x26\xd6\x1f\xa7\x75\xf2\xee\x7e\xc0\ +\xa3\x77\xb6\x39\x39\x0a\x12\xec\x28\x99\x31\xcd\xb4\x52\x4a\x28\ +\xd7\xa1\x33\x9e\xd9\x6f\xc6\x80\x8e\x35\x70\x1a\xa4\x12\xc8\x66\ +\xd4\x4b\x68\x6f\xa9\xb9\xf5\xc5\xf2\x9a\x17\xf2\xc1\x6b\x5f\xe3\ +\xea\xd1\xd5\x54\xeb\xbe\xf2\xb2\x62\xe3\xcb\xfe\x85\xaa\x9b\xd4\ +\x6f\xa7\x9e\xf0\x58\xe8\xd8\x88\x32\xcd\x79\xe9\xf3\x74\x7a\x3e\ +\x54\x23\x21\x27\x8a\xa5\x64\x32\x4f\x18\xb8\x62\xc8\x4c\x51\x54\ +\x2d\xdb\x9e\x41\xce\xb8\x4a\xf8\x81\x7d\x1c\x8c\x5a\x1e\x8b\xa9\ +\xb7\x40\x32\xf1\x65\xa7\xc3\x77\x7e\xe7\x1b\x3c\x7c\xef\x4d\x4a\ +\xe4\x98\x14\x8e\x14\x2b\x58\x83\x7c\xac\xc3\xda\x53\xf1\x9e\x7b\ +\xc6\x21\xc2\x47\x3c\x5a\x14\xc3\x03\x6f\x64\x6e\xcd\xb8\x90\xdc\ +\xb3\x80\x4a\xf7\x16\x83\x4e\x40\xbb\x31\xa1\xd6\x1d\x71\x3a\xdc\ +\x4d\x78\x32\x0e\x83\x52\xa2\x9b\x4c\x3a\xa0\x21\xc1\xaa\x4b\x0a\ +\xf9\x5a\xda\x7d\xe6\x9a\x63\xaa\xe5\x41\xc2\x78\xd3\xc1\x2e\x19\ +\xb7\x1e\x89\xd2\xf1\x6e\xd8\x4b\x84\x91\x75\xc6\xae\xd5\x6b\x6c\ +\xd5\xfa\x8a\x81\xd3\x01\x0d\xdd\xad\x26\xef\x4b\xe0\x02\x9c\xf5\ +\xb2\xec\xee\x07\xca\xfb\xa0\x03\x71\xe2\xcf\x02\x2e\x0d\x52\xe9\ +\x69\x90\x7e\x62\x5d\x36\xcc\xc4\x00\xa2\xa4\x01\xa7\x37\xf4\x96\ +\xc6\x9d\x94\x1b\x69\xf6\x07\xa8\x2c\xde\xa6\x7b\xd5\xe6\xf5\x77\ +\xde\xc6\x3f\x79\x08\x03\x11\x02\xff\xfc\xed\x1a\xaf\xbe\xb8\x44\ +\x76\xf9\x01\xae\xb5\x4e\x7f\xb8\xc6\xa4\x37\x64\x74\x3a\x5d\x90\ +\x2b\x99\x4b\xa5\x93\xd3\x1e\x2a\x11\xb1\x2b\x53\x1a\x8c\x99\xb8\ +\x19\xea\x55\x2b\xd6\xc4\x2c\x10\x0d\xba\x2a\x60\x21\xdd\x65\x22\ +\xe1\xa7\xac\x65\x45\x15\x15\x3b\x5b\x94\x45\x07\x79\x3f\x1b\x97\ +\x33\x25\xb3\xd6\x76\x8f\x1c\x5e\x7f\xa7\x05\xd6\x56\x22\x46\xdf\ +\x8c\x5b\xde\x34\xcc\x88\x96\xd6\x01\xaa\x79\x3e\x8d\xc7\x4b\x29\ +\x71\x1c\x1c\x70\x3c\xb4\x14\x48\x4d\xb6\x39\x89\x2c\x8e\x83\x03\ +\xa2\x70\x87\x7e\x0b\x8e\x83\x03\x2a\xdd\x5b\xca\x7a\xd7\xeb\xb4\ +\xb2\x7d\x3f\xd9\xc0\x4f\x73\xaf\xc9\xfc\x07\xbd\xe2\xb8\x14\xe6\ +\xe6\x06\x30\xf4\x26\x28\x52\x2f\x4b\xc3\x50\x06\x36\xf4\x90\xb4\ +\x0c\x43\xeb\x4c\xdd\xac\xc3\x67\x1a\x3e\x85\x17\x85\x4b\x50\x4a\ +\x88\xe7\xdd\x74\x50\x9f\xf5\x84\x7c\xf8\xf6\x7b\xa7\x74\xfc\xa4\ +\x01\xe6\x32\x4e\x34\x51\xd1\x8d\x2e\xb9\x9f\xae\x7d\xe7\x01\x3d\ +\xdd\x02\x40\xba\xd2\x74\x96\x96\x7f\x23\x6b\x89\xd7\x24\x53\xeb\ +\xfe\x62\xfd\x6f\x06\x66\x93\x6f\x1d\x58\xec\xbe\xf9\x94\x8b\xc3\ +\x7d\x8c\x89\xb0\xbb\xbe\xf0\x7d\x2f\x2b\x77\x5b\xc9\x3f\x52\xa1\ +\xeb\xd0\xbb\x20\xf4\x2e\x30\x72\x8b\xb3\xdf\x33\x0e\x37\x8b\x88\ +\x9d\x43\x27\x0a\xc8\x96\xa6\xc0\x37\x3b\x97\x27\x4a\x1a\x78\x57\ +\x46\x22\xf9\xc7\xf2\x2e\x54\x98\x59\x6f\x6f\x35\x4d\x49\x9b\xad\ +\xd6\xbd\x68\x89\x1f\x5b\xbe\xd9\x67\x52\x38\xa2\xef\x78\xea\x12\ +\xd6\x8e\xbd\x03\x7d\x47\x4c\xa3\x97\xfd\xcd\x74\x17\x93\x3c\x69\ +\xf9\xcb\x2a\x6e\x6b\x9b\x7e\x4b\x18\x74\xfd\x96\xd0\xcb\x72\xa2\ +\xbc\xdc\x9e\x44\x02\xe0\x12\xcc\x1b\x19\x97\xa8\x78\x53\x01\x4e\ +\xca\x87\xeb\x72\x22\x54\x10\xc4\x1c\xcf\x78\x27\xd2\x59\x68\x3a\ +\x78\x3b\x46\xa4\xb2\xd7\xa6\x33\x9c\x67\x33\xe7\x36\x6a\x59\x56\ +\xea\x0d\xfc\xd2\xb2\x92\x0f\xd7\x25\xf6\x28\xbf\x69\x0c\xf2\xf3\ +\xe1\xb9\x02\xf0\xd9\x61\x5b\x8c\x5b\xb0\x92\xb3\x42\xd2\x63\x0f\ +\xd2\x0c\xab\xdf\xaf\x94\x87\x6a\xd6\xc8\x3c\xcd\xab\xfa\x18\xc7\ +\x21\x6a\x1d\xe4\xb2\x45\x01\x88\x76\x01\x62\xc2\xd3\x73\x16\x45\ +\x4c\x1a\x27\x1f\x3e\xc3\xcd\xf7\x08\xcd\x36\x95\x7c\x86\xc6\x0b\ +\x5b\xca\xdd\xe6\xb4\xe4\x57\x92\x00\x00\x20\x00\x49\x44\x41\x54\ +\x5a\xeb\xca\x28\x3c\xeb\x88\xf6\x62\x69\x7d\x3c\xe2\x4c\x85\x9b\ +\xaf\x8a\x13\x26\x6e\x66\x0a\xe0\x58\xd6\x9a\xe1\xc2\x92\x72\x8f\ +\xd9\x86\x08\x41\xcb\x00\x86\xcc\xfd\x95\x00\x96\x92\x43\xb2\x6f\ +\x1a\xd8\x51\x77\x44\xe0\x4e\x3d\x10\xd9\xe1\xba\xba\x94\x4d\xfc\ +\x61\x82\x0d\x4c\x6b\x05\xfa\x10\x8d\x2f\x71\xcf\x16\x18\xb4\x87\ +\x0c\xda\xe2\x00\x0e\xda\x43\x3e\x70\xdb\xf8\x07\x43\xce\x7a\x59\ +\x8e\x83\x69\x0b\xcd\x83\x9c\xc7\x59\x2f\xcb\x68\xb1\xa7\x0c\xc1\ +\x4a\xf7\x16\xfd\x9a\x60\xee\x5e\xe5\x92\xcd\xdb\x1b\x2c\x65\x92\ +\xbd\x80\x75\x60\xea\x9a\x55\x07\x72\x9a\x89\xd3\x41\x8c\x74\xe2\ +\x8f\x8c\xcc\xb9\xce\x44\x19\x80\xd5\xf2\x80\x6c\xdf\x27\x43\x97\ +\x6a\x79\x30\x63\xc8\xcd\xbb\x55\x9a\x49\xe0\x4a\x83\xcf\x3d\x5b\ +\x50\x00\x16\x33\x38\x0a\x33\xc0\x9b\x07\x64\x1d\x4c\xba\x97\xa1\ +\xef\x14\x94\xbf\xf7\x3a\xa3\x4d\xee\xa3\x0f\xd6\x91\x7f\xb7\x1e\ +\x19\xea\xb1\x7e\x25\xa8\x3b\xd3\xbf\x23\x3f\xbb\x6e\x55\xe9\x06\ +\x5d\x1e\x05\x63\xf2\x7b\x87\xca\xc0\x03\x78\xf5\xc5\xa5\x44\xa4\ +\x4f\xca\xa3\xe3\xb1\xa7\xb4\xf0\x89\x13\x71\xa3\xe0\x33\xf1\xb7\ +\xb8\x8a\x9b\xa9\x64\x5c\x93\x6c\x29\xa0\x34\xc8\x31\x71\x33\x8a\ +\xa1\x55\xc4\xce\x8b\x6a\x78\x51\x0d\xdb\xe8\xce\x00\x73\xc6\x8f\ +\x37\xb1\x67\xb6\x97\x9d\x0e\x57\x91\xc7\xee\x91\xc3\xde\x5b\xef\ +\x63\x5c\x39\x4c\x0a\x47\x31\x18\xf2\xea\x80\xe8\x07\xb0\x1b\x74\ +\x39\x71\xa2\x38\xed\xee\x4a\x01\x58\xe9\xdb\x28\x8b\x91\x7b\xa6\ +\xd8\xf9\xac\x97\xe5\xd6\xd8\xe6\xd6\xd8\x56\xde\x0c\xc3\xdc\xe2\ +\x38\x38\xc0\xe9\x6c\xb1\xd0\xde\xe3\x9d\xb7\x77\x18\x9e\x3c\x53\ +\x56\xb8\x0e\x44\x09\x60\xd1\x10\xdb\x4b\xe4\x44\x74\x6a\xa1\x8a\ +\xac\xcd\xcb\x87\x48\x34\x3d\x29\x67\xc9\x74\xda\xca\x07\xac\xbf\ +\xa7\x15\x1a\xca\x2d\x27\x73\x22\x9e\x07\xe0\xf3\xe1\x79\x42\x3a\ +\xc8\xe7\x9c\xc3\x88\xe3\xd6\x05\x8f\xf7\xf6\x12\x43\x67\xf4\x63\ +\x98\xb5\x0a\x33\xcc\x3c\x4f\xc7\xea\xa0\xee\x1b\x05\x05\x58\xf9\ +\x3f\x6b\x15\x08\xfd\xb3\x29\x90\x8d\xe7\xb3\xfd\x75\x8b\xa6\xe3\ +\xf7\x94\x7d\x61\x46\x3d\xe8\x84\x1c\xb7\xb6\xd9\xdb\x1f\x13\xb6\ +\x62\x9f\xb8\x0d\xab\x8b\x0b\x4a\x52\xe8\x89\x48\x0b\xed\x4b\xce\ +\x02\x21\x27\xa4\x0b\x72\xc8\x10\xc3\x89\x08\x4a\x71\x43\x1f\x37\ +\xa3\xe4\xc4\xc4\xcd\x4c\x2b\x3b\x8e\xc2\x9c\x02\xaf\x04\xb2\x8c\ +\xbe\x19\xb5\xfc\x0c\x90\x0b\xa5\x7d\xe5\x85\xf0\x72\xe7\x34\xb2\ +\x02\x08\x12\xc0\x0f\xdf\x7b\x93\x16\xc2\x5a\xd5\x5d\x3a\xfa\x41\ +\x50\x07\xa8\x37\xe4\xc4\x89\x70\x0e\x93\x55\x21\xd1\x58\xac\xc8\ +\xf5\xb1\x00\xb0\xf4\x58\xe8\x65\x49\x80\x1a\x15\x15\x85\x3b\x7c\ +\xcb\x13\x1e\x8e\xa7\x1f\xfe\x85\x00\x9f\xd6\x32\x55\xca\x00\x1d\ +\xc0\x7a\x80\x43\x1a\x75\xe9\xe0\xc6\x3c\x9d\x2c\xbd\x14\x7a\x25\ +\xb5\x9e\x23\x0c\x62\x08\xa3\x34\xe4\x74\xc6\xfd\x28\xf9\x20\x82\ +\x37\x0b\x7c\xe7\xa8\xc5\xd9\x61\x5b\x31\xbc\xce\xc2\xcf\x03\xae\ +\x0e\xcc\x79\x52\x43\x67\x57\xfd\x33\x03\x6a\xaa\x29\xb7\xfe\x19\ +\xe9\x5b\xa2\x03\xe7\x75\xee\xb8\xd6\x48\xc9\x8d\xc3\x68\x89\x63\ +\xf7\x82\xf6\xd9\xd4\x0b\x51\xbf\xbb\xce\xad\xaa\xa3\xc2\xd5\x7a\ +\xec\x40\xf7\x56\x1c\x0f\x2d\x2a\xd6\x31\xa6\x51\x26\xe3\x9a\x04\ +\xa5\x90\xba\x91\x21\x28\x85\xd3\x8c\xb6\x6a\x24\x40\xbc\x60\xd8\ +\xd0\xac\xce\x0f\x29\xc7\x3d\x29\xa4\xfb\xac\x3d\xb1\x95\x17\x22\ +\xea\x8e\x18\xba\xb7\xb9\xec\x08\x2b\xcd\x3f\xda\x65\xbf\xfb\x14\ +\xac\x2d\x31\x32\xab\x3c\xbb\x72\x3b\x86\x68\x3b\x25\x0f\x5c\xab\ +\x3b\x1d\x50\x28\x81\xab\xdf\x0e\xb9\xc9\x4a\x75\x32\x03\xe4\x85\ +\x4e\x9f\xdd\x7d\x41\x51\xbb\xfb\x01\xbb\xfb\x01\xcd\xf3\x2a\xee\ +\xd9\x11\x7f\xfe\xc1\x00\x3a\xbd\x19\x8d\xab\x1b\x67\x12\xd0\xcf\ +\x73\xc3\xc9\xe8\x9c\x0e\x64\x09\x6c\xf9\x79\x3a\x80\xd3\xfe\xe0\ +\xc2\x8b\x2b\x09\x0d\xac\x33\xee\xf9\xf0\x3c\x61\xe0\x45\xe3\x38\ +\x83\xef\x30\x62\x7f\xef\x50\x69\xcf\xeb\xd8\xef\xa3\x9e\xbf\x8e\ +\x34\xd2\x8b\x20\x0d\xe4\x34\x18\xaf\xfb\x7b\x92\xad\x13\x2e\x3a\ +\x2d\x53\x50\x1a\x77\x67\x87\x6d\xe5\x0e\x0d\xcd\x27\x54\xf2\x19\ +\x6e\xd7\x16\xa8\xac\x88\x41\x06\xd1\x82\x00\x49\x7f\xb8\xa6\x48\ +\x4d\x77\xa9\x4e\xfc\x2d\xea\x46\x3c\xd0\x87\x88\x4e\x14\x90\x71\ +\x4d\xc5\xc6\xae\x33\xc1\x1c\x2e\x75\xb9\x8a\x3c\x91\x37\xbc\x94\ +\x64\x63\x19\x42\x8e\xba\x23\x15\xc9\x2b\x94\xf6\x13\x09\xf4\x6b\ +\x76\x5b\xb1\xf0\xd1\x33\x0f\xe7\x59\x05\xfc\x1d\x2a\x65\x9b\xc6\ +\x42\x8d\x97\xd6\x56\x55\x7a\xa4\xd4\x55\xed\x7e\x98\x90\x14\xad\ +\xae\xa7\xdc\x6d\x3a\x90\xa3\xf1\x25\x46\xee\x19\xfe\xc1\x50\x49\ +\x0a\x29\x39\x0e\xa3\xd8\x30\x3b\x9b\xfa\x8b\x0f\x46\xe2\xfb\x77\ +\x3a\x7d\xae\x3a\x9d\xb9\x27\x54\x7a\x0f\xd2\x0c\xab\x3f\xd6\x19\ +\x3a\x1d\x8e\xd6\x47\x7a\xc9\x5c\x0b\x23\xe8\x8b\xdf\x17\x37\x38\ +\x59\xd9\x68\x70\xfb\xce\xc6\x47\x1a\x6e\xd3\xc4\xa6\x05\x8c\xdc\ +\x33\x9e\xee\x2d\x70\xe2\x44\xec\xb6\x4e\x13\xde\x9b\xff\x3f\xc0\ +\x9d\x07\xc4\xb4\x1c\x79\xee\xe7\xc5\xf3\xf0\x5c\x67\x22\x16\xaa\ +\xe6\x07\xd7\x59\x5e\x77\xf3\x51\x8d\x12\x95\x31\xcd\x46\x44\xf7\ +\xaa\xcd\x69\xf7\x19\xfe\xc9\x43\x25\x29\xac\x85\x29\x61\x3a\xcf\ +\x84\xbb\x52\x46\x73\x2f\x7b\x59\x46\xa7\x41\xc2\x4b\xd1\x89\x02\ +\x25\x25\x80\x84\xb4\x28\x95\xb3\x98\x7a\x98\x59\x32\xac\x04\xb0\ +\xfe\x9c\x64\x63\xf9\x58\x26\xd0\xb7\x4d\x21\xba\xf7\xf7\xb6\x71\ +\x76\x0f\x15\x80\xa3\x85\x32\xb7\x6f\x35\xd8\xbc\x77\x97\x5b\x5b\ +\xaf\xd0\xa9\x85\x73\xfd\xb1\x41\xaf\x1e\x5b\xa7\xc2\x6f\x7c\xe2\ +\x44\x09\x0b\xd5\x39\x8c\x38\x8c\xb2\x0c\xda\x43\xdc\xb3\x23\xdc\ +\xb3\x23\xa2\xf1\xa5\xfa\x2f\xc1\x2e\xef\x97\x56\xd6\xe7\xea\x5a\ +\xbf\xe8\x31\xa9\x58\x89\x82\xcf\x79\x60\xd6\xbf\x9f\x5f\xf4\x04\ +\x40\xb5\x1c\x60\x1d\xc0\x51\xa6\x92\xa8\x93\xcb\x54\x3b\xa2\xbc\ +\xa8\x6c\x50\x5a\xb9\x9a\x09\x64\xe8\x00\x96\xf2\x49\xdf\x9e\x9c\ +\x3c\xe6\xd1\x9e\x90\x10\x59\xab\x90\x60\xf9\xef\xe5\xfe\x5f\x07\ +\xe8\xcf\xf3\x6e\x48\x63\x57\x5e\x6d\x16\xa2\x5e\x02\x9c\xcf\xfb\ +\x6c\x5d\x8e\xf5\x8d\x02\xd4\x4d\x06\x9d\x2a\xef\xb5\x8e\xe3\x64\ +\xad\x2e\xb5\xb0\x97\x30\xee\xd2\x49\x4b\x18\xc7\x1c\xb7\xa6\xb2\ +\x22\x8c\x92\x25\x5e\x19\xad\x35\x82\xeb\x4c\x84\x9c\x58\x37\xc7\ +\x44\xdd\x91\x48\x8e\x37\xba\x1c\xc5\xa5\x3b\x92\x99\xa5\x2e\x96\ +\x00\x1e\x2e\x75\x29\x5c\xd4\x54\x9e\x84\x7f\xd2\x21\x3a\x9b\xb0\ +\xdf\x7f\x06\xd6\x16\x2b\x75\xb8\x91\x13\x27\xdb\x58\x0d\xb9\xf3\ +\xb9\x8f\xb3\x94\x7f\x89\xa3\xc9\xe5\xcc\x6a\xcf\x54\x3b\x62\xfe\ +\x71\x1f\xe5\x72\x5b\xc9\x08\x81\x2f\x45\xbe\x0e\x52\x79\x93\xcc\ +\x9d\xde\xee\x1c\x0f\xa1\x5e\x55\x1d\xd9\x75\x90\xea\x7a\x38\x3d\ +\x1c\x66\x1e\x2b\xeb\xaf\xe9\xc0\x4e\xcb\x11\xd7\x99\x90\x09\x5b\ +\x6c\x36\x57\x79\x75\xbd\xa9\x74\xb0\x1e\x85\x3b\xeb\x65\x95\xc1\ +\x26\x81\xbb\xeb\x0f\xd4\xef\xfb\xce\x51\x04\xfd\x24\xc8\xe4\x40\ +\x46\x79\x05\xd1\xef\xcf\x2b\x8f\x9a\x07\xe8\x4e\x2d\x7c\x2e\xd8\ +\xaf\x03\xa2\xaa\x02\x8f\x8d\xd5\xef\x65\x41\xe8\x59\x83\x7a\x6e\ +\xf5\x71\x4b\xe4\xba\x48\x5d\x1c\x99\xd5\x19\xe3\x4e\x37\xf0\x2e\ +\x7b\x59\x65\xd8\x95\xad\x64\x7a\xa5\x04\xb4\xdc\x2a\xc3\x4e\xca\ +\x07\xc9\xc0\x0b\x86\x9d\xd0\xc4\x51\x77\x34\x95\x1a\xb9\x73\x05\ +\x60\xc9\xc6\xbb\xfb\x87\x7c\x67\x47\xf4\x98\xbd\x6d\x8f\x30\xed\ +\x25\xb2\xab\x05\xd6\xcb\x37\xb9\x73\xcb\xe2\xde\xc7\xee\xf3\x89\ +\x1f\xbd\x49\x79\xb1\xa9\x26\xd1\xab\xd0\x6e\xac\xc3\xe4\x20\x6f\ +\xc9\xc8\xd2\xf9\x2d\xd9\x19\xe0\x2c\x58\x54\xf7\xd3\x80\x9e\xf4\ +\x86\x1c\x1c\x7b\x9c\x9c\x3c\xc6\x08\x45\x86\x59\x7a\x98\x8b\xee\ +\x61\x90\x1e\x04\xbf\xe8\xcd\x14\x73\x4a\xd6\x95\xfb\xcb\x13\xa3\ +\xfb\x8d\xf5\xc7\x55\xdf\xa1\xb6\xd0\x48\x78\x22\x96\x0b\xcb\xf4\ +\x5b\x53\xe6\x35\x72\xcf\x70\x0e\x23\x1e\xfb\xcf\xd4\x6f\xf0\xb7\ +\x0b\x9c\x38\x11\xdf\x39\x6a\xd1\x0e\x3b\x4a\x03\x77\x8c\x68\x2e\ +\xe8\x74\x20\xab\x63\x28\x2f\xf7\xa9\xd7\x75\xf9\xa6\x6f\xbf\x57\ +\x30\xa7\xf3\x4e\xbe\x17\xb6\xd7\x17\x94\x7c\x6d\xe8\xbb\xec\x74\ +\x2b\x38\xa7\x11\x9d\xa1\x43\x68\xb6\x29\xd8\x49\xe3\x4e\xea\x61\ +\x3d\xc3\x4e\x1e\xa3\xab\x8e\x99\x00\xad\x69\x94\x09\x23\x47\xe5\ +\x52\xa8\xa4\x78\xf3\xea\x82\xa3\x30\xc7\xe8\x72\xac\xbc\x14\x57\ +\x91\xa7\x74\xb0\x64\x5c\xc9\xc6\x92\x99\x0b\x17\x35\xae\x22\x8f\ +\xa3\x67\x22\xa0\x51\x29\xdb\x64\x6b\x49\x7f\xd1\xde\x81\x4f\xe0\ +\x9e\xb0\xbe\x6e\x26\x58\x2d\x1d\x7c\xe8\x39\x45\xba\x9d\xee\x8c\ +\xb8\xd7\x81\x2a\x2d\x57\xf9\x03\x0f\x8e\x85\x51\x38\xe9\x0d\x69\ +\x85\x9e\xf8\xdf\x81\x4e\xa7\xab\x66\x64\x5c\xc7\xb4\x3d\xa7\x48\ +\xd5\x77\xc4\x90\x18\x6d\x30\xcc\xdc\xf0\x73\xaa\xbf\x84\xee\x72\ +\xab\x96\x07\x50\x37\x55\x7d\x5c\x22\x68\xb3\x28\x02\x30\x6f\x39\ +\x7b\x42\x2e\x38\x11\x85\x73\x41\xcf\x8f\xfd\x67\x6a\xd1\x02\x6a\ +\xf6\x47\x1a\xb0\x3a\x30\x5d\x67\xa2\x80\x22\xbf\xe3\x44\x1b\xa1\ +\x9b\xb8\x55\x93\x8f\xd3\x2c\x9e\xce\xed\xb8\x8e\x91\xd3\x36\x41\ +\x22\xd3\xac\x6a\x24\x5d\x79\x73\x3e\x6b\x99\x88\x56\xd7\x53\xc6\ +\x9d\xe9\x8c\xa8\xe4\x33\x34\xfd\x48\x19\x77\xa5\xb8\xff\xb4\x64\ +\xe2\x79\x9e\x0f\x09\x5a\x09\x60\x5d\x62\x98\x57\x91\xc7\x45\xb3\ +\xcc\xba\x29\xa6\x8a\x1e\x85\x39\xae\x22\x8f\x75\x73\xcc\x55\xe4\ +\xa9\x5c\x08\xdb\x17\x6c\xdc\x9e\xd8\xca\xb0\x1b\x2e\x75\xf1\x2f\ +\x2b\xec\x77\x9f\x72\x11\x78\x44\x0b\x65\xf2\x9b\x1b\x64\x57\x85\ +\xe5\x6a\x0c\x9e\xc1\xce\x09\x4f\xf6\xde\xe5\xe8\x28\xa4\x5e\xab\ +\xcd\xd5\x4f\x32\xdf\xb6\x15\x1a\x74\x3b\x5d\x76\x5b\xa7\x2a\xc3\ +\x49\x02\xba\x5f\x38\x56\xf7\xd3\xc0\xdd\xef\x45\xf4\x9d\x42\xa2\ +\xc9\x89\x1c\xee\x22\x07\x1e\x02\x34\x7b\x41\x82\x8d\x75\xf0\xce\ +\xd3\xc9\x7a\x7e\xc5\xf3\xea\xea\x36\x9b\xab\x33\xa9\x95\xe7\xc3\ +\x73\x31\xfc\x1c\x31\x10\xf2\xc4\x89\x38\xeb\xb4\x69\x85\x62\xe1\ +\x15\xce\x9b\x9c\x75\xda\xb4\x43\x23\x61\xc4\xe9\x40\xd5\xb7\x7a\ +\xf1\xaa\x7e\x5f\x26\xf5\x1b\x41\x3f\x31\x0b\x5a\xff\xde\xf2\x33\ +\x25\x6b\xcf\x63\x58\xd7\x99\x90\xa1\x9b\xcc\xc0\x0b\x73\x2a\x45\ +\x75\x1e\x80\x75\x03\x7d\x26\x33\xb0\x27\x00\x1e\xd4\x1b\xca\xb8\ +\xeb\x5f\x5e\xe0\x8f\xe3\x29\x5c\x0b\x9a\xe1\xd6\xea\x27\x24\x45\ +\xdf\x28\xa8\x73\xed\xc5\x73\xf5\xc2\xc8\x49\x00\x58\x07\xb2\x59\ +\x5a\x1e\xb3\x58\xaf\x2b\x1d\xbc\x6e\x8e\x59\x30\x6c\x8e\xc2\x9c\ +\x02\xf2\x82\x61\x73\xe8\x08\x66\x96\x3e\x62\x10\xb9\xc7\xd6\x62\ +\x1f\xc3\x78\x85\x7a\x64\x28\x1d\xac\xdc\x63\xa1\xd0\xa8\x3b\xaf\ +\xef\x32\xde\x13\xef\x93\x39\xbe\xe9\x03\x23\x67\xba\x49\x40\x77\ +\x3b\x7b\x89\x93\x2e\x26\x16\x4d\x99\xab\x15\x7a\xf1\x7e\x5d\x11\ +\x12\xed\xf4\x13\x4c\x20\x87\xbb\xe8\x33\x33\xa8\x9b\x33\x2e\xb3\ +\xe7\x69\x61\xfd\xf3\xf4\xf2\x24\x7d\x9f\x5a\xa6\xa6\x1a\x5d\x8b\ +\x61\xe7\xd3\xdb\xae\x3f\xc0\x39\x8c\xe8\x46\xef\x72\xd6\x69\xd3\ +\x34\x6d\xf5\xdd\xe5\x55\xc3\xec\x25\xdd\x10\x93\x8a\x95\x60\x5e\ +\x1d\x20\x69\x2d\xac\x57\x5e\xeb\xad\x04\xe6\x85\xd8\xd3\x9f\x21\ +\x35\xaf\x9e\x52\xaa\xe7\x89\x7c\x94\xa4\x88\x7a\x11\x8d\x8a\x99\ +\x04\x70\x2c\x61\x4a\x61\x4e\x15\xe7\x36\xe3\xd4\x99\x41\xa7\xca\ +\xe8\xa8\xc3\x38\x3f\xf5\xcc\x2c\xdc\x11\x57\x93\xec\xf2\x03\x42\ +\x27\x50\xff\x2b\x91\x20\xa8\xed\xe3\x5d\x6a\xb1\xc7\xc9\x34\xca\ +\x0c\x26\xb9\x19\x4d\x0c\x60\x95\x82\x4d\x42\x5c\x16\xeb\xf5\x38\ +\x42\xb2\x0c\xdd\x11\x8b\xf5\x3a\x5e\x77\xc4\x82\x21\x18\x37\xe3\ +\xde\xc6\xc8\x7a\xb8\xe7\x39\xec\x7a\x9e\xcb\x4e\x87\x05\xc3\x66\ +\xf7\xc8\x81\xcb\x37\x68\xd6\x1b\x64\x57\x0b\x6c\x98\x02\xbc\x93\ +\xd3\x21\xc7\x63\x0f\xe3\x2a\x76\x6a\x13\x40\xa7\x07\x18\xb1\x6b\ +\xca\x9e\xd1\xaa\x3d\x0b\xd5\xa3\xb7\xe6\xd4\x68\x11\x89\xd6\xfe\ +\x15\x0f\xfa\xd0\x8a\xfb\xf1\xb7\xf0\xe8\x06\x5d\x4c\x6b\x85\xe0\ +\x9a\xcb\x98\x35\xb0\xd5\x9c\x0c\xc5\xbc\xf1\x02\xb9\xee\xf2\x38\ +\x0f\xd4\x7a\xe7\x1e\x2b\x6e\x7c\x22\x07\x2a\x6e\xd4\xb2\x09\x19\ +\x71\x73\xf2\x03\x89\x80\xc5\xd2\x38\xe2\xe0\xd8\x63\x10\xda\x89\ +\x85\xd7\x77\xa6\x2e\x2a\x11\xf1\x43\xb1\xa8\x94\x06\x7a\xc7\xa2\ +\x49\xc5\x82\x48\xb8\xf7\x6a\xe5\xaa\x72\xf5\xa9\x2b\x45\x0c\x7c\ +\xc9\x9a\x92\x9d\xb3\xf1\xa2\x70\xfb\xc9\xb4\xd1\x7a\x39\x0b\x44\ +\x33\x75\x85\x35\x6a\x22\x73\x2f\xfe\x7d\x32\x37\xba\x6e\x56\x67\ +\x02\x1e\x13\x7f\x48\xbb\x1f\xb2\x64\xd9\x94\xca\x4c\x7b\x7c\xf4\ +\x72\x64\xc2\x16\x41\x3c\x6d\x55\x04\x3d\xda\x1c\xb7\xb6\x39\x76\ +\x1f\x70\xef\xc0\xa0\xb8\x71\x48\x73\xe1\x06\x1b\x85\x35\x2a\xeb\ +\x5b\xf4\x8f\x76\xa6\x0b\xc7\x5a\x07\x7f\x87\x70\x6f\x9a\xbe\x30\ +\x98\x8c\x80\x1c\xe5\x5c\x0e\x34\xbf\xb4\x33\x8e\x87\x31\xca\x22\ +\xd0\xc4\xa5\x22\x2e\xfb\x31\x6a\x79\x8c\x5a\x9e\x52\xb0\xa9\xa2\ +\x72\xeb\x8b\x05\xa2\x18\xe4\x99\xa6\xd0\x77\x6b\x6b\x4b\xdc\xda\ +\x7a\x85\xf5\xf2\x4d\x8e\x72\x2b\xd0\x15\xcf\x1b\x57\x0e\x2d\x02\ +\x5a\x9d\x36\x74\x7a\xaa\x79\xc9\x3c\x36\x94\x9e\x04\x31\x35\xc8\ +\x26\x13\xb6\xa0\x67\x08\x3f\x72\x47\x38\xfe\xf5\xff\x00\xe1\xe5\ +\xc9\xb5\x9a\x4e\x4a\x88\x19\x63\x44\xbb\x02\xa4\x59\xa6\x66\x56\ +\x67\xa2\x79\x7e\xd1\x13\xf9\x11\x5a\xe7\x9e\x9e\x55\xa6\xea\x3b\ +\x34\x6b\xb6\x2a\x31\x4a\xdf\x8e\x5b\x17\x1c\x1c\x7b\x0a\xb8\xf2\ +\xaa\xd1\xea\x24\x93\x69\xea\xf5\x4a\xe2\x72\x4f\xcf\x50\x60\xec\ +\xd4\x42\xda\xa3\x5e\x3c\x61\xa9\xa0\xd8\x56\xce\x7b\x56\xa0\xbc\ +\xc6\xf7\x7d\x9d\x9f\x3c\x1d\x95\xd4\x0d\x6d\xf9\xfb\x24\x53\xeb\ +\x5d\x8a\xd2\x40\x96\xb9\x14\xfa\x42\x70\xcd\x31\x41\xbd\x41\xa6\ +\xd3\xa6\xd9\x10\x41\x8f\x8b\x74\x2b\xbc\xe1\xec\x31\x53\x7a\xb8\ +\x70\x42\x25\x1a\x52\x5b\x68\x88\x1c\x99\x23\x71\xa5\x2a\x66\xc7\ +\x38\xe3\xb1\x60\xe0\xb8\x54\xa9\x98\x15\x6e\x40\xeb\xf4\xd1\x1e\ +\xd6\x5a\xfd\xda\x1f\xbd\x51\xb6\x19\x65\x4a\x1a\x38\x0a\x88\x41\ +\x19\x60\x37\x61\x73\xbd\x8c\x7f\xef\xae\x72\xa7\xdd\x3c\xb5\xd8\ +\xf5\xf6\x39\x39\xb9\x50\xec\xab\x0e\x76\xcc\x2c\xe9\xc1\xdd\x69\ +\xf0\x15\xac\x52\xac\x57\xc7\xe0\x14\x81\x79\x40\x2d\xe2\x57\x3d\ +\xfc\x9e\xcb\x72\xdd\xe0\xbc\x13\x25\xe6\x24\xa7\x3f\x4f\x2d\xd0\ +\xa0\x0f\xd8\x73\x0d\x11\x31\x89\x47\x78\x23\xdc\xfe\x34\x8b\xed\ +\xaa\x62\x91\xc5\x9f\xeb\x8d\x90\x3a\x58\x67\xe0\xe3\xd6\x85\xd2\ +\xec\xf4\xa7\x9e\x17\x7d\xe6\x5d\x5d\x16\x9c\xfa\x43\xc5\x92\xa3\ +\xb6\xc3\xc6\x9d\x06\x5f\x7a\xe5\x25\x8a\xdf\x27\xaa\x59\x8e\x8e\ +\x42\xf6\xb7\xf3\x1c\x7e\xe7\x37\xa7\xa9\x9d\x65\x31\x2a\xb7\x16\ +\x7f\xcf\x6e\xd1\x83\x38\x47\xba\x1b\xf4\x00\x9b\x7a\xd7\xc4\x35\ +\xe7\x87\xd3\x67\xec\x92\x8a\x35\x3b\x82\xa1\x1a\x7d\xcf\x5e\x09\ +\xd7\x99\x88\x6c\x39\xf9\x19\x3d\x43\x68\xe1\xa0\x4b\x00\x2c\x55\ +\x60\xa7\x5b\xe1\x4b\xf2\x9c\x30\x20\xdb\xee\xb2\xba\xb8\xc0\xad\ +\xaa\xc3\x43\x92\xdd\x88\xfa\x86\xc8\xe5\x70\xcf\x8e\x38\x76\xd7\ +\x69\x70\x87\xc1\x24\x37\x35\xf0\x6a\x3e\x61\xe4\x30\x98\xe4\xc4\ +\x1c\x3b\x00\xff\xa4\x43\xef\x9c\xb9\xcd\x2c\x76\xe9\x70\x18\x5c\ +\xb0\x21\x9b\x6e\x67\x37\xb0\x16\x3d\xe8\x78\x5c\x76\x3a\xec\x1e\ +\x39\x18\xab\x21\xcd\xee\x6d\x5a\xec\xab\x6c\xa4\x76\x0c\x60\x79\ +\x59\xcb\xf6\x7d\xa8\x66\xc1\x99\x3f\x81\x3e\x7d\x19\x97\xc3\x0a\ +\xa5\x81\xa6\xef\x2b\x81\xe9\xf7\x42\xac\xaa\xc9\x79\x27\x54\xc3\ +\x0c\xf5\xf7\xa5\x01\x3c\x2f\x99\x67\x9e\x7c\x90\xd3\xea\x6b\x66\ +\x95\x6e\xb1\x47\xb6\x9f\x7c\x4f\x6d\xa1\x41\xf1\xbe\x37\x53\x62\ +\x24\x3c\x10\x17\x42\xb7\xc7\xe0\xad\xc5\x6d\x4c\x45\xc6\x5b\x72\ +\x68\xa3\x94\x00\x2a\x21\x7c\x73\x8d\x4f\xbd\x7c\x8b\xaf\xfc\xa3\ +\xaf\x50\xfa\xc4\x0b\x5c\x99\xd0\xde\x1e\xf1\x27\xfc\x1e\x3b\x4f\ +\x2d\xba\x81\x90\x13\xad\xd0\x88\x67\x47\xcb\xdc\x0d\x21\x21\xba\ +\x7a\xc6\x5e\x0c\x28\x29\x2f\x66\x7e\x73\xdc\xc2\xb6\x1b\x4e\x7f\ +\x9f\x3c\x76\x69\x43\x4d\x77\x9d\x49\x29\xa1\x8c\xc8\x9e\x41\xb5\ +\x3a\xa0\xe7\xa4\xdc\x73\x64\x45\x20\x4b\xef\x6d\x17\x8f\xb9\x5d\ +\x2a\x14\xe8\x67\x8d\x19\x26\x56\xa5\x6b\xe5\x21\xdd\x8e\xf0\x42\ +\x1d\x0f\x2d\x36\x8d\x0e\x9d\x48\xe4\x87\x86\x91\x83\xd9\xab\x63\ +\xd6\x62\x92\xab\x46\x58\x7f\xfe\xf0\x4d\x8c\xc2\x0a\x37\x2d\x8b\ +\xab\x7d\xc1\xa6\xd1\xa9\x89\xb5\xbe\x49\xe0\x3f\xa5\xd9\xbd\xcd\ +\xed\xca\x11\xa1\x1d\xb7\x0d\x9d\x1c\xb2\x7b\x64\xb1\x91\xf1\x39\ +\x0c\x2c\x02\x5f\x18\x33\xad\xda\x3e\xd1\xa9\xc9\x33\x3f\x3e\x29\ +\x12\xc0\x9a\x2b\xa8\x1b\xf4\xa0\x48\xa2\xc0\x52\x19\x53\xd2\x10\ +\xd3\xb6\x0c\x50\xc3\x0b\x67\x46\xca\x0e\x52\xef\x21\xf6\xe1\x22\ +\x64\x49\x61\x30\x7f\xe0\xb7\xc8\x62\x9b\x0f\xe0\x9a\x53\x4b\x9c\ +\x7c\xb7\x2f\x98\x59\xf7\x0f\x37\x7b\x01\xcd\xda\x0d\x3e\xbe\xb9\ +\x30\x13\x42\x96\xfe\x6a\x9d\x7d\xbb\x41\x37\x1e\x30\x8e\xda\xaa\ +\x4b\x7b\xd7\x84\x6a\x96\x97\x1e\xbc\xc0\xe6\xbd\xbb\xdc\x5d\xce\ +\x72\xeb\xde\x16\xc5\x9b\x2b\x74\xdb\x01\xa7\xef\x74\x78\xfd\x83\ +\x3f\x63\xef\xf1\x07\x64\xfb\x3e\xf5\xfa\x72\x9c\xd2\x6a\x43\x6c\ +\x68\x4a\x26\x15\xfa\xf5\xfa\xe8\xa3\xf4\x77\x2b\xad\x1d\x77\xfb\ +\x94\xbf\x6f\x26\x27\x79\x4e\xee\x35\xc0\x45\xe0\xb1\x64\xd9\xd4\ +\x25\x1b\x57\xa3\x69\x3b\x83\xf8\x73\xab\xe5\x81\xf0\xff\xc7\x00\ +\x0e\xea\x0d\x76\x5b\xa7\x1c\x07\x07\x94\xdb\xfb\x30\xfc\x24\x64\ +\xcb\x2c\xad\x5b\xc2\xcd\xf6\xfe\x1f\xd3\x1f\xae\x51\xe2\x48\x54\ +\x89\x94\x1b\x10\xe7\x9b\xd7\x52\xc9\x67\x83\x49\x8e\x62\xb5\xc3\ +\x60\x3c\x6d\x0c\x69\xad\x97\x6f\x2a\xe0\x3d\xf3\x7d\x38\x82\x68\ +\x78\x02\x1f\x3c\x8b\x13\x70\x4e\xe0\x02\x8c\x82\xf8\xa1\x37\x63\ +\x6b\x69\x37\x96\x0f\x00\xd1\xa9\xd0\x38\x47\xcf\x3c\x26\xde\x31\ +\xce\xb3\x8a\xd0\x4c\xfe\x90\x4e\xcc\x04\xf5\xc8\x48\x8c\xbc\xd5\ +\xe7\xb4\xc9\xc7\x12\xb0\x0a\x9c\x96\x60\xdd\x4c\xa6\x06\x74\xa7\ +\xcc\x1a\x3b\x0a\x74\xd0\x4b\x26\x2e\x0c\x4a\x0c\x7b\x2e\x3e\x42\ +\x52\xe8\x4c\x2c\x80\xd8\x67\xe8\x4f\xf7\x6f\xf6\x02\xa5\xc3\x25\ +\x80\xf5\x74\x4d\x6b\x20\x18\xd9\x65\x42\xd3\x8c\xa8\xdd\x91\x79\ +\x11\x57\x8a\x85\xa5\x0f\x58\x67\xe0\x80\x9a\xca\xb3\xf0\x7d\xf1\ +\x7d\xe4\x1c\x3b\xc8\xaa\xb6\xb2\x9f\xb9\xb3\xcc\xdf\xfc\xa7\xf7\ +\xb9\x63\xdd\xc7\x66\x81\xca\x4d\x8b\x63\xe0\xe8\x9b\xdf\xe5\xe7\ +\xff\xb7\xd7\x79\xba\x2d\x86\xf3\x98\xc5\x08\x3a\x02\x28\xa5\x6a\ +\x36\x31\x9c\xd1\xed\x4f\x70\x99\x02\x52\x1a\x7c\x89\x81\x90\x45\ +\x0f\xd7\x91\xe0\x1c\xcf\x18\xae\x3a\x0b\xeb\x4c\x3d\x4f\x53\x5f\ +\x04\x1e\x75\x8c\x44\x74\xcf\x35\xc7\x6a\xa8\x8e\x34\x56\xe9\x19\ +\x64\x9b\x79\x2a\xd1\x90\xee\x55\x88\x7f\x30\xe4\x24\x28\xb2\x64\ +\x3a\xc0\x22\x8d\xc1\xd4\xc5\x39\x29\x1c\x81\x13\xbb\xd8\x1c\x8f\ +\x5a\xa6\x46\xb7\xd3\xe5\x38\x38\xe0\x13\xbc\x48\x31\x9b\x67\x30\ +\x11\x3a\x58\x4a\x0b\x95\x9d\xa8\x03\x53\x6e\x29\xdf\x9c\x7b\x99\ +\x7f\xe6\xfb\x18\x83\x67\xc2\x78\x03\x38\x12\xef\x79\xe6\xfb\xd4\ +\x3b\x1e\xfb\xdd\xfd\xb8\x55\xeb\x98\x8b\xc0\x03\x63\x3a\x87\x58\ +\x9d\xd0\x39\xab\x3e\x5d\x41\xa1\xef\x53\xb0\x4a\xd0\xf7\x09\xe2\ +\xfb\xf3\xe4\x85\x3c\xf8\xe9\xc9\x9d\x72\x7f\xc9\xf4\x69\x5f\xb0\ +\xf4\x88\xe8\x60\x96\xba\xd9\x2f\x6a\x03\x15\x7b\x39\xaa\xa1\x43\ +\x2d\xd3\x88\x27\x77\x4e\x01\x7c\x30\xbc\xc9\xc8\x39\x54\x00\x6e\ +\xb5\x0d\x5c\x53\xe8\x78\x0b\x9b\xf1\xf8\x04\x62\x83\x4c\xaf\xd3\ +\x93\x03\xcc\xd7\xca\x06\x7b\x07\x3e\x66\xb8\xc3\xa0\xb3\xcd\xe9\ +\x1f\x1f\xf2\x03\xaf\xfe\x10\x00\x9f\xf8\xd1\x9b\xdc\xb6\x3f\x4b\ +\x6b\xe1\x81\xb2\xe0\xcf\xb6\xdf\xa0\x49\x53\x63\xc0\x89\x02\xae\ +\x3c\xc6\x6e\x6c\x43\xc8\xb6\x5c\xfa\xa0\x48\x1d\x74\x7a\xf0\x46\ +\x12\x86\x3c\x4e\x99\xb8\x87\xf2\xdc\x4e\x9e\xb1\x8c\x90\x19\xe9\ +\x72\xf1\xcf\xb8\xf4\xaa\x59\x91\x9f\x1c\x67\xca\x1d\x8c\xba\x30\ +\xfe\x10\xf8\x7e\x16\x32\x11\x7b\x95\x12\x5b\x95\x21\x0f\xd7\xb7\ +\xe8\xef\xed\x28\xcf\x83\xe8\xfb\x86\x60\xe3\x5e\x96\x43\xd7\xa0\ +\x52\x14\x03\x0b\x07\x13\x7d\x5e\x74\x9c\x69\x28\xe5\x43\x7a\x9b\ +\x06\xef\x4d\xcb\xe2\xa6\x65\x11\x59\x37\xb9\xa9\x3d\x0f\x10\x9d\ +\x4d\x78\x77\xe7\x21\x51\xdc\x0e\xe9\x22\xf0\x94\x1f\xd3\x2f\x82\ +\x3b\xe7\xb2\x95\x98\x7d\x9c\x9a\x44\x6f\x61\xce\x68\x59\x09\xc8\ +\xb4\xbc\x60\x30\xdf\xf8\x48\x03\x7e\xd8\x73\xa7\x2e\x37\x8d\xe9\ +\xe5\xdf\xed\x59\x82\xe5\xba\xe5\x6e\xa2\xb3\x8f\x72\xb1\x99\x4d\ +\x56\x36\xea\xca\x9d\x26\x2b\x2f\x46\xad\x29\x80\x0f\xbb\x13\x86\ +\xa1\x0b\xa1\xb6\x80\x62\x00\xcb\xef\x2a\xbd\x1d\x3d\x47\x8c\x0d\ +\x33\x72\x8b\xac\x5c\x1e\xf0\xd4\xbf\xc3\x07\xaf\x3f\x06\xe3\x98\ +\xa8\x78\x93\xfb\x9f\xff\x24\x3f\x76\xe3\x0b\x14\xbf\xfc\x05\x26\ +\x8d\x02\x17\xad\x2f\xf1\xd6\x1f\xee\xf2\x26\x30\x39\x7f\x04\x3d\ +\x03\xbf\xec\xc5\xda\xb8\x88\xcb\xac\xf4\x91\x25\x55\x69\x3b\x20\ +\x13\xb6\xf0\xcb\x99\xc4\x00\xf5\x82\x55\x12\x83\xd1\x7b\x0e\xe7\ +\xb8\xe0\x94\x66\xd2\x2b\xf5\xec\x36\xf5\x58\x6b\x40\x9e\x96\x23\ +\xea\xbd\x71\x0e\x89\xe5\x9e\xb3\xbb\x6b\xb2\xb1\x75\xc1\xc2\xc6\ +\x6d\x2a\x0b\x8b\x74\x17\xe4\x49\xd8\xc2\x2c\x9c\x28\x03\xaf\x44\ +\x8e\x7e\x27\x6e\xec\xee\x6f\x03\x9f\xc1\x1f\x58\x58\xc5\x3e\x50\ +\x49\x78\x44\x4c\x80\xae\x7f\x7f\xea\xc4\x8e\x01\x6c\xac\x86\x82\ +\x79\x57\x43\x6e\x5a\x96\x92\x0e\xfa\x56\x32\xf7\x7e\xf7\x29\xad\ +\x83\x4e\x02\xc0\x1d\x23\xa2\x66\x56\xe7\xb2\xaf\x1e\x54\x48\xaf\ +\x74\x69\xb0\xe9\x46\x9c\x6e\xa4\xe9\xa1\x64\xfd\x73\xd3\x9a\x59\ +\x37\xfe\x74\x50\xfb\xbd\x90\x28\x53\x51\x72\x42\x06\x32\xfc\xa2\ +\x97\x00\x70\xa2\x8a\x23\x14\x5d\xd1\xd7\xca\xd3\x0a\x8d\x83\xe1\ +\x4d\x8e\x5b\xc2\x88\x6b\x75\x62\x00\xfb\xee\xdc\x2b\x80\xba\x52\ +\xc4\x7f\xaf\x15\x0a\x5f\x79\xd0\xab\x73\xdc\xba\xc0\xfe\xf4\x16\ +\x3f\x7c\xcb\xe0\xc1\x8f\xdf\xe3\xc5\x1f\xfc\x22\x9b\xb7\x37\xf0\ +\x4f\x3a\x7c\xeb\xf0\x82\x77\xdf\x38\xe1\xfd\xdf\xd9\x65\xcd\xdb\ +\xe7\x1f\xfc\x0d\x93\x2f\xff\xc4\x06\xd9\xe5\x07\x1c\x4d\x2e\x89\ +\x32\x95\x44\xcf\x37\xfd\x7b\xcf\xdb\xca\xbf\x9f\x0e\xb3\xeb\x84\ +\x71\x8e\x91\x78\xec\x9a\x63\x5c\x73\x3c\x75\xb3\x69\x1d\x46\x13\ +\xb3\x4f\xb4\x9b\x1e\xf5\xd3\x0d\xbb\x9d\xae\x00\xdf\xd9\xf0\x29\ +\xe3\xe1\x15\x99\x6e\x9b\x8d\xc2\x9a\xc8\xa1\xf0\x77\x66\xab\x45\ +\xea\x26\x83\xf6\x90\x6a\x7f\x91\xfe\xa0\x8b\x55\xf4\xf1\x07\x96\ +\x62\x61\x95\x3b\x11\x9d\x9a\xd4\xd7\x3f\x4c\x80\x57\x82\xba\xcc\ +\x83\x19\x46\x4e\x3f\xb6\xd6\x37\xb9\x5d\xbb\x4b\xb6\x99\xe7\x22\ +\xf0\x44\xda\x5e\x2a\x14\x19\x65\x2a\x89\x18\xbc\x7e\x40\xf5\x01\ +\x31\xd7\x01\x53\x02\x21\x0d\x50\xc9\xdc\x12\x2c\x2a\xd4\xdc\x0b\ +\x67\x16\x8d\xee\xa9\xd0\xf5\xae\xcc\xa3\xb8\xce\x53\xe2\x3a\x13\ +\x6a\x77\xa6\xc9\x3d\x52\x03\x37\x2f\x8e\x14\x80\xaf\x3a\x9d\x04\ +\x9b\xe9\xdf\x5b\x7e\x17\x1d\x60\x7a\x7f\x8b\xb3\xc3\x36\x7b\xaf\ +\x1d\x52\x5e\x35\xf8\xe2\x67\x3e\xc7\x8f\xfe\xbd\xcf\xf2\xf2\x27\ +\x57\xb9\x73\xb3\xc8\x46\xc6\xe7\x5b\xdf\x7d\x8d\xdf\xfa\x8d\x5f\ +\xe1\xf7\x7e\xf5\xf7\x38\x0a\x73\xdc\xbb\xf3\x0a\xad\x07\x1b\x34\ +\xf2\xd5\x99\x06\xdf\xd7\x79\x5c\x12\x55\xdf\x73\x8e\xb1\x7e\x7f\ +\x99\x48\x91\x46\x22\x76\x10\xf4\xe7\xba\xe9\xd2\xcf\xa5\xcf\xab\ +\xee\x92\x6b\x75\x3d\xa2\xec\x19\x79\x56\x70\x49\x85\xb2\xad\x64\ +\xb9\x52\x89\x1c\x01\x35\xd1\xe2\xd5\xbd\x60\xa3\x34\xdf\xe5\x57\ +\x2a\x67\xb1\xee\x7f\xfe\x93\xf8\x97\x15\xac\xcf\xf7\x45\xf4\x0d\ +\x78\xf5\xee\x90\xc3\xe0\x2e\x0b\x77\x7c\x02\x1f\x16\xec\x0d\x5a\ +\xec\xc7\xa0\xfe\x50\x31\xf6\xfa\xba\xa8\xe6\x30\x56\xb2\xe2\x4b\ +\x04\x0f\x55\x56\x5a\x3d\x32\xe8\xc4\x91\x26\x79\x49\x13\xee\x9e\ +\xf9\x2e\xae\xb4\x3e\x53\x46\x9a\xef\x42\x0f\x7c\xdc\x84\x11\x37\ +\x57\x0f\xc7\xd2\x41\xee\x3b\xec\xb9\x09\xa3\x45\x07\xb2\x6e\xd0\ +\x28\x3d\x88\xa9\x5c\x4d\xcd\xfa\x40\x15\x82\x16\x57\x93\x25\x56\ +\x8f\xfd\x67\x14\xce\x9b\x74\x3b\x5d\xdc\x98\x09\x75\xf6\x95\x2c\ +\xaf\xff\x16\x7d\xe1\xd6\x23\x43\xc8\x8c\x6a\xc4\xf6\x55\x87\xee\ +\xaf\x7f\x9d\x47\xef\xdc\xa0\xfc\xca\x21\x0b\x5d\xd1\x19\xe9\x0b\ +\x1f\xbf\x4f\xb1\x9e\x61\xf3\xde\x5d\x8e\xc7\x1e\x61\x7e\x19\x3f\ +\x7c\x88\x65\xbe\xc4\x0f\x1b\x23\xde\x90\x2e\xba\x39\x2c\x7c\x5d\ +\xe4\x32\x7d\xac\xf5\xab\x97\xce\xc4\x46\x3f\x22\xdf\x28\xcf\x1c\ +\x2f\x5d\xeb\xea\xe4\x23\xc9\x44\x12\x4b\xda\xd5\x26\xd9\xbf\x06\ +\x8c\x0f\x26\xf0\xfd\x10\x19\x5d\x20\x98\x1b\xf4\x90\x92\xa2\xa9\ +\x35\x79\xba\x74\x45\xae\x85\x55\xf4\x29\x7a\x2e\x7d\x16\x89\x68\ +\x09\x4d\xbc\xba\xb1\x81\xb3\x50\xa6\x5c\x74\x58\xdd\x00\xbf\x2f\ +\xc2\x2b\x2b\xdd\x51\x9c\x00\xf4\x4a\x2c\x6b\xea\xf8\xf9\x0e\xd6\ +\xda\x2b\xec\x5a\x9a\x53\x70\x1d\xd6\xfd\xa7\xec\xaf\x6f\xb1\xfb\ +\xd6\x9f\x53\xcf\x2e\xaa\x4b\x88\x8c\x0e\xd5\xca\xc2\xdf\x0a\x95\ +\x19\x8b\x39\x7d\x5f\xd7\xc9\xc2\xa8\x22\x21\x23\xa4\x0b\x2d\xed\ +\x47\x96\x5e\x09\xaa\xe2\x3d\xfa\xeb\xe9\x13\xb6\x4c\xa4\x2e\x9b\ +\xcb\x44\xf4\x00\x33\xec\x01\x75\xc2\x4e\x87\xe5\x66\x4d\x65\xb9\ +\xd5\xea\x0d\x5e\xb0\xa6\x39\xc2\xdb\x8f\x42\x0a\xbd\x26\xbb\xad\ +\x53\x7a\x4e\x51\x7d\xae\x6e\xc0\x0d\xfd\xa9\x27\xc2\x1a\xd8\x6a\ +\xa1\xc8\xdf\xa4\x8f\xba\x2d\x58\x25\x7a\xc0\x5b\x3b\x27\x98\x4f\ +\x3e\x24\x72\x2b\x2c\x55\x44\x7f\xb2\xf5\x7b\x5f\x64\xf3\xde\x06\ +\x5f\x78\x61\x93\x93\x70\x0d\xcb\x14\x44\xf3\xf0\xfd\xf3\x99\x2b\ +\xca\x75\x41\xa3\x79\x72\x4b\x5e\xb9\xe8\xcd\x46\x36\x0b\x56\x89\ +\x11\xce\xcc\xfe\x05\xab\x94\x18\xb2\xa3\x37\x57\xd4\xf7\xd5\xff\ +\xa6\x0c\x9b\x97\xca\x62\xd0\x7a\x37\x80\x9d\xfd\x3e\x2f\x5e\x5e\ +\xd0\xb8\xb5\xc5\x62\x63\x13\xd8\x4b\xba\xd9\xfc\x23\x05\xe4\xbe\ +\x51\x50\x19\x8b\x1e\x57\x71\xe3\xca\x0a\xbd\xc8\xc3\x2a\x7a\xf8\ +\x72\x1c\xb2\x4d\x0e\x8a\x5a\x32\x45\x25\xbe\xd4\x55\x2a\xac\x02\ +\x36\x01\x1e\x19\xc2\x41\x48\x18\xe7\x57\xc8\x3c\x8b\x28\x06\xfa\ +\xf2\xc2\x57\xc8\x58\x1f\xb2\xf3\xb4\x09\x5d\xe1\x10\x97\xda\x78\ +\x52\xb1\xe8\x10\x51\x37\xab\x74\x88\x34\x46\xf6\x67\xee\xa7\xa5\ +\x86\xce\x64\xf2\x80\x4b\xb6\x4d\xb0\xb5\xe6\x52\x4b\xeb\x69\xdd\ +\x90\x93\x8f\x7b\x56\x19\x7c\x97\xaa\xef\x08\x30\x03\x8b\x66\x85\ +\x16\x90\xcb\xad\xd1\x73\x44\x7e\x44\xed\x4e\x43\x25\xb9\xef\xfa\ +\x03\xc2\xa3\x0d\xfa\x85\x77\x39\xd9\x1b\x27\xb4\xa8\x34\xe0\x74\ +\x06\x4e\xe8\xd3\xd8\xaf\x9d\xce\x8e\x2b\x55\xb3\x4c\x0c\x8b\x7a\ +\xd7\xa4\x64\xe6\xa0\x5e\xa7\xb9\x04\x9f\x7a\xe5\x05\x3e\xf1\xa9\ +\x17\x09\xef\x3c\xc3\xdc\x3b\xe5\x1b\xe7\x13\x16\x6c\x9f\xab\x27\ +\x87\xbc\xf1\xfe\x5f\x31\x39\x3f\x52\x75\xea\xfa\x15\x4e\xff\x3e\ +\xf2\x6f\xa6\x01\xac\xa2\x9a\xbd\x59\x90\x0e\x7d\x97\x51\xdb\x21\ +\xaa\x18\x62\xa1\xa7\x5e\x5b\x26\xa2\xe7\x94\x67\xe4\x42\x9a\xcd\ +\xe5\xdf\xc9\x84\x2d\x4a\xd5\xc6\x34\x5a\xd9\x11\x39\x14\xa3\xa3\ +\x0e\xd1\xfa\x39\xb9\x8d\x06\x37\x3e\x56\xe5\x3b\x1f\xc4\x55\x1c\ +\xbe\xf0\x50\xa8\x4e\x9b\x8e\xc8\x58\x3c\x1e\x5a\xdc\x02\xaa\x46\ +\xc8\x80\x3e\x90\x4c\x1d\xb0\x3c\xc6\xe4\x0b\x21\xa3\xa1\x39\xb3\ +\x55\x65\x4b\xe4\xe2\x39\x83\x7a\xf5\xab\x07\x95\x05\xb2\xb4\xa8\ +\x34\x96\xf9\xdb\x1b\x77\xf9\xb3\x3f\x3a\x10\xe1\x51\x3f\x62\xc9\ +\xb2\x55\x75\x82\x14\xfb\x75\xb3\x4a\x27\x8e\xf5\xcb\xe8\x92\x9e\ +\xb4\xa2\x07\x23\x54\x07\xf6\x5e\x88\x15\x9f\xb1\x82\x55\x52\x5e\ +\x06\xc9\x76\x09\x66\xd1\xa4\x83\x7c\x6f\xda\x9f\x2c\x13\x78\x86\ +\x18\x0a\xcc\xca\xa0\x89\x43\xca\x3d\xab\x4c\x50\x6f\xb0\x12\x37\ +\xaa\xde\xf5\x07\x2c\x9d\xd8\x7c\xe7\xe4\x31\x7d\xa7\x41\xcf\xe9\ +\xcf\x8d\x06\x8e\xc7\x27\xe4\x58\x9b\x0b\x64\xfd\x52\xde\x2d\x8a\ +\xc8\x9b\xeb\x4c\xc8\x02\xae\x29\x82\x2b\x5b\xa6\x41\xf1\xbe\x17\ +\x03\x58\x5c\x52\x9f\x9e\x4f\x78\xfd\xf7\xdf\x10\x9d\x7f\x34\xf7\ +\x98\xee\x49\xd1\x43\xe9\xba\x27\x64\x9e\x4e\x4f\x3f\x97\x5e\xf0\ +\x51\x3c\xd4\xe5\x42\x73\x02\x0c\xf5\x63\x74\x8d\x7c\x49\x2f\x08\ +\x19\xe4\xd0\x23\x7f\xd4\xc5\x39\xea\x55\x2e\x31\x96\x97\xb1\xa9\ +\xf0\xc9\xdb\x9f\xe1\x83\xca\x43\xe1\x75\xf1\x87\x98\x75\x5b\x25\ +\xc8\xcb\x71\x63\x2a\xd0\x61\x87\xf8\x03\x8b\xaa\x11\xd2\x1b\x78\ +\x58\x45\x5b\x34\x14\xb4\xc9\x61\x0e\x23\x6c\x02\xcc\x61\x3c\x93\ +\x21\xde\xe6\x0b\x61\xfc\x21\xde\x14\xb8\x6a\x2b\x9e\xb7\xb1\xf1\ +\xdb\x67\xd8\x35\x9f\x9f\xfa\x99\x2f\x51\x5f\x7c\x85\xa3\xab\x2b\ +\x2e\x02\x4f\x95\x85\x4b\x4f\x85\x9e\xef\x2a\x19\x44\x4f\xc8\x49\ +\x07\x19\x74\x9d\xab\x07\x44\xae\xab\x8f\xd3\x25\x84\xae\x9d\x75\ +\x00\x5b\x55\x53\x49\x89\x79\x9a\xb0\x67\x95\xa9\x96\x07\xdc\x6b\ +\x8a\xa6\x27\x17\x6b\x1e\x4b\x27\x36\x8f\xfd\x67\xa2\x61\x75\x47\ +\x00\xd8\x0c\x7b\x33\x97\xe1\x5c\x6e\x6d\xae\xaf\x3b\xed\x03\xd7\ +\x7f\x8f\xdc\x2f\xdb\xf7\x69\x05\x70\xf6\xa4\xc1\xd7\x77\xf6\xf8\ +\xf3\x3f\x3d\xe4\x4f\x7f\x79\x9b\x3f\xfc\xfd\xaf\xb1\xb3\xbb\xaf\ +\x0a\x5f\xe7\x75\x2c\x92\xbf\x4d\x97\x4e\xba\x36\x9f\xe7\xb9\x19\ +\xfa\xae\xea\xe1\x5c\xb0\x4a\x18\xfd\x88\x65\xa6\xc6\x53\x54\x31\ +\xbe\xa7\xec\x3e\xdd\x08\xd4\x8f\xa5\xde\x6d\xbf\x63\x88\x3e\x75\ +\x74\x42\x0e\x23\x31\xfd\xaa\x7d\xb0\xc3\x78\x78\x45\x34\x39\xa6\ +\x7a\x73\x43\x94\x2a\xf5\x0c\xfa\xc3\x35\xd5\xa4\xb0\xef\x14\x68\ +\x85\x1e\x6e\x5c\xde\x24\x3d\x13\x03\x3b\xc4\x88\xfd\x76\x71\x65\ +\x87\x97\x64\x57\x5d\x64\x0f\x0b\x78\xaa\xf1\xc6\x75\x40\x06\x8f\ +\x0c\xfe\xf1\x29\x9b\xf7\xef\xf3\x77\xff\xa3\x2f\xb2\x79\xf3\x87\ +\x45\x3a\x60\xa7\x4f\xa7\xd3\xa7\x51\x31\x67\xaa\x14\xd2\xae\x35\ +\xc9\xc6\x3a\xa8\x25\xf8\xfc\xa2\x37\xd7\xeb\x20\x73\x85\x75\xb6\ +\x9d\x77\x40\x75\x40\xeb\xde\x82\x74\xd8\xbb\xea\x3b\x54\xcb\x03\ +\x6a\xf5\x1a\xc3\xe5\x16\x17\x6b\x9e\x0a\x27\x9f\x3d\x69\x24\x72\ +\x7f\x43\xb3\x3a\xa3\x27\xa5\x6e\xd7\x7f\x83\xee\x19\xf0\x8b\xc2\ +\xaf\x2b\xaf\x4c\x52\xfb\x27\x4a\x8d\x3a\x7d\xfe\xe4\x37\xff\x8c\ +\xd7\x5e\x7b\x97\x6f\xfe\xe5\x43\x26\xad\x11\xcd\x5a\x93\x4c\xa3\ +\x96\x30\x98\x66\x02\x42\x73\xb4\x70\x9a\x69\xd3\xc7\xd0\xce\x64\ +\xd4\x6b\x51\xc5\x48\x64\x9b\x49\x80\x7b\x41\xa0\xfe\xeb\xbf\x51\ +\xff\xdb\xf3\x58\x58\x5d\x2d\xc2\x1e\xf5\xc8\x20\xca\x54\xb8\x0c\ +\xfb\x42\x1e\xc4\x6d\x78\x33\x83\x0c\x4e\x2f\x69\x34\xcb\x86\x3b\ +\x6a\x94\xc2\x9c\x61\xb0\xfe\xc0\x22\xa2\x05\xf4\xa7\x7e\x62\xfd\ +\x66\x93\xc3\x63\xac\x6d\x03\xf5\x8a\xbe\xd7\x8c\x21\xd1\xee\xe0\ +\x84\x7d\x7e\xe0\x2b\x3f\xcc\x7f\xf6\xdf\xff\x34\x5f\xfe\x47\xff\ +\x82\x8d\x57\xff\x21\xed\x51\x0f\x6b\x90\x57\x6d\xa5\x9e\x5b\xb3\ +\x15\x03\x59\x4f\x85\xd4\x99\x38\x11\x42\xd6\xc0\x9b\x8e\xc8\xa5\ +\xc1\xec\x05\xc1\x5c\xd9\x31\xb3\x30\xea\x26\xb5\x7a\x8d\xe2\xaa\ +\xc7\x0b\xd6\x4d\xda\x87\x2d\xfc\xed\x02\x1f\xb4\x3a\x84\xfe\x19\ +\xe7\x9d\x48\x81\xc4\x0c\x7b\xea\x04\xea\x27\x54\x46\xc8\xa2\x4c\ +\x25\xb9\xc8\xa4\x8f\x36\x9e\x24\xaa\x03\x41\x56\x54\xeb\x9f\xa3\ +\xb2\xcf\xcc\x31\x9d\x5a\x98\x58\xe0\xba\x54\x4a\xbf\x4f\x6f\x18\ +\x93\xf0\xfa\xa4\xae\x46\x33\xe9\xb7\xfd\x28\xc1\xbe\x12\xe0\xe9\ +\xed\xf3\x5c\x74\xf2\xb1\x5e\x64\xaa\x8f\x06\xce\xe5\xd6\xa6\x87\ +\xba\x50\x26\x73\xcb\xa4\xb1\x24\xbe\xcb\xad\xaa\x43\x76\xf9\x81\ +\xea\xdb\xa7\x7c\xce\x41\x57\xb5\x6a\x98\xbd\x55\x24\x13\xdb\x0a\ +\x98\x1e\x19\x60\xda\x0d\x5e\x00\xd8\x4e\x30\xee\x3c\x36\xb6\xc9\ +\xe1\xd9\x25\xec\xf6\x19\xe5\x41\xc8\xe6\xfd\xfb\x7c\xf9\x67\x5e\ +\xe4\x9f\xff\xcb\x1f\xe3\xe5\xcf\xfd\x24\x9d\x4e\x5f\xc9\x0b\x29\ +\x27\xae\x3a\x1d\xd5\xb3\x21\x68\x77\x71\x2e\x5b\x04\xed\x6e\xe2\ +\xc4\xea\x27\xbb\x69\x46\x89\xcb\xa5\x7e\x72\xd2\x60\xd4\x41\xdf\ +\x1e\xf5\x68\x68\x03\xaf\xf5\x13\x19\x76\x3a\x0a\x84\x4d\x33\x4a\ +\x00\xf8\xb1\xff\x8c\xca\xf0\x06\x67\x9d\x36\x51\x6f\x9a\xe4\x22\ +\x59\x47\x67\x62\x9d\x89\xa4\x91\xaa\x03\x53\xff\xbe\xf3\x6a\xd6\ +\x9e\x97\xa4\xaf\x2f\x6c\x3d\x99\x67\x1e\xdb\xa6\x0d\xdb\xb4\x4f\ +\x5d\x2e\x3a\xf9\xf7\x24\xbb\xea\xf2\xc1\x48\xcd\xe7\xf6\x82\x20\ +\x01\x60\x3d\xb2\x9a\x06\xb2\xdc\x66\xc2\x56\x02\xc8\xba\xcd\xd0\ +\x0a\x45\xbd\x5d\x67\xe8\x60\x3a\x19\x36\x1b\x9b\xd4\x3f\xb6\x7e\ +\xed\xef\xaf\x65\x6a\x2c\x74\xfa\x8c\x2e\xc7\xca\xc5\x66\x15\x7d\ +\x15\xf0\x50\x33\x3b\x04\x1c\x05\xeb\xba\x03\x83\x52\x31\x96\x11\ +\xde\x50\x03\xab\x27\x0c\x3c\x6f\xa8\xc0\xec\x69\xd3\x73\x04\x73\ +\x67\x70\x46\x2d\x9c\xab\xef\xb2\x10\xc2\xda\xcd\x02\x3f\xf5\x33\ +\x5f\x62\xe3\xd5\x7f\x48\xb6\xef\xb3\x7b\xf6\x8c\xa3\xab\x2b\x8e\ +\xae\xae\xf0\x82\x80\xd2\xfa\x02\x77\xee\xbf\xc4\xbd\xef\xfb\x24\ +\xeb\x77\x37\x71\xfb\x22\x09\xbc\xdf\x9e\xa8\xd2\x22\x79\x70\x64\ +\xbe\xb0\xae\x8b\xd3\x72\x61\x1e\x2b\xd8\x99\x4c\xe2\x79\x9d\x89\ +\xc3\x38\x09\x5e\x3e\x27\xcb\x87\x54\x75\x75\xa7\x1d\xfb\x82\x27\ +\x73\x3d\x1e\x73\xfd\xd5\x73\xca\xfd\xf5\xe8\xa0\x7e\xa5\xf9\x5e\ +\x92\xf8\xf5\x54\xcd\x79\x85\x04\x69\x37\xe2\x75\x36\x42\x3a\xfa\ +\x79\xdd\x4d\x67\x63\xa3\x1f\xcd\x00\xf8\xba\x9b\xfc\xfd\x32\x17\ +\x5c\x8f\xe2\x49\xe9\x98\xcb\xad\xd1\xed\x74\x39\x88\x26\x71\xbd\ +\xdd\x25\xad\xb0\xcb\x6a\x7d\xda\x11\x68\x5e\x4f\x8b\xc3\x28\xcb\ +\xbd\xdb\x59\x0d\xbc\xe2\xd8\x55\x8d\x30\xce\x01\xf7\xda\x60\x17\ +\x94\x7c\x28\x15\x03\xdc\xc1\x90\x52\xb1\x00\xb6\x94\x14\x36\xee\ +\x60\x88\x59\x1c\x63\xdb\x0d\x6c\xaf\x0d\x76\x43\xe4\x73\xe2\x29\ +\x30\xdb\x71\x02\x87\x07\x74\xdb\x5d\x6c\xc6\xbc\xd0\x28\xf1\xcf\ +\xff\xe5\x8f\xf1\xdd\x77\x6f\x71\xb5\x67\xe1\xf0\x88\x9b\x96\x85\ +\xb5\xbe\xc9\x67\x3f\xb1\x8e\x99\x29\x31\xa0\x8a\x37\xec\xf0\xe4\ +\xc3\x6d\xf6\xf7\xb6\xd9\x7b\xfc\x01\xbb\x3b\x07\xb4\x2f\x5b\x84\ +\x03\x71\x50\x6f\x7d\xf2\x8e\xb8\xbc\x1e\x5d\x25\x4f\x60\x2f\x19\ +\xd8\x90\xec\x5b\x69\x64\x67\x2e\xb9\x72\xff\x74\x35\x87\x9c\x66\ +\x34\x5c\x6e\x51\x19\xde\xa0\x5f\x38\x56\x35\x7d\x22\x78\x33\x99\ +\x3d\x61\xd7\xe4\x6c\xe8\x41\x81\x04\xd8\x52\xa9\xa1\xba\x57\x26\ +\xed\x39\x98\xe7\xf9\x98\x97\x0b\x3d\xcf\x38\xd5\x17\xb8\xf4\x5f\ +\x17\x72\x6b\x33\x57\x8d\x79\x0c\x9b\x96\x14\xcf\x33\xee\xae\x5b\ +\x78\xfa\x77\xd7\x93\xe4\xeb\x55\xa0\x9c\x85\x4e\xc8\xce\xf6\x19\ +\xfc\x28\x84\x3d\xb0\xcc\x88\xe5\xf6\xd4\xc5\x9b\x2d\x7c\x1c\xfc\ +\xa3\x69\x92\x7c\xec\x21\x79\xb2\x3f\x41\x14\x8f\x57\xa8\x1a\x2e\ +\x66\xad\xa1\x65\xb1\xd9\x0d\x3c\xc6\x84\x83\x21\xa5\x62\x14\x33\ +\x71\x14\x3f\x17\x0a\x30\x7b\x6d\x4a\xc5\x06\x78\x6d\x3c\x1b\xc2\ +\xc8\xa6\xa4\x71\xb0\x8d\x87\x3b\x30\xa0\x88\x02\xbd\x40\xf3\x90\ +\xb6\x9d\x61\xed\x66\x85\xd5\xfa\x97\xe1\x8b\x7d\x9a\x93\x2f\xd1\ +\x0f\xce\xc0\x8e\x2d\xea\xa1\x41\x35\x9f\x63\x62\x98\x6c\xae\x7e\ +\x19\x7e\xe4\xcb\x9c\x76\xae\x28\x5c\x79\x9c\x5e\x5e\x71\x38\x14\ +\xb5\x56\x9b\xeb\x65\x7e\xe9\x17\xdf\xe7\xe8\xe9\x2f\x51\x5e\x6c\ +\x52\xe8\x97\x12\x8c\xa3\x4b\x0a\x3b\x93\xc1\xef\x85\xea\x44\xa5\ +\xfd\xc4\x89\xbc\x64\x50\x32\xa2\x70\xde\xa4\xbf\x3c\x05\xf0\xe1\ +\xd1\x64\xd6\xf7\x0a\xd3\x54\xd0\x54\xb4\x4a\x82\x37\x51\xb0\x3a\ +\x27\x62\x26\xdf\x2b\x7d\xbb\xe9\xab\xc8\x3c\x00\x4f\xa5\x85\x3d\ +\x03\xd8\xeb\x8c\xbb\xa1\xef\xce\x05\xf0\xf3\x58\x38\x0d\x64\xf9\ +\xf8\xa3\xde\x3b\x6f\x11\x59\x55\x93\x9a\x53\x9b\xe6\x5b\x68\x79\ +\x14\x17\xdd\x27\x74\xbd\x4d\x8a\x1b\x4d\xce\xdb\x65\x95\xcd\x76\ +\xf8\x9d\xdf\x84\x7a\x45\x25\x01\xb5\x3a\x43\xa2\xf1\x25\x3b\x3b\ +\x5f\xe3\xac\x73\x9f\xd0\x5e\x65\x3d\x3a\x22\xb8\xb8\x43\x36\xb3\ +\x22\x98\x38\xe7\x0d\x71\x23\x62\xe0\x66\x00\xe1\x56\x93\xa0\x06\ +\x31\x39\xc9\x64\x0c\x76\x89\x9a\x17\x32\x2e\x16\x14\x5b\x0b\xd0\ +\xa2\xee\xd7\xbc\x90\x76\x24\x24\x89\x1b\x89\xa1\x20\xfd\xf6\x1e\ +\x50\xc6\x26\x47\xbf\xd0\x87\xe1\x90\xf6\x50\x04\x50\xcc\xa2\x09\ +\x23\xd1\x7f\x78\xc4\x3e\xe5\x7c\x93\xb5\x9b\x05\xa2\x46\x8e\xca\ +\x46\x86\xef\x2f\x2c\xd1\x8b\x2a\x74\xfc\x08\x78\x7f\x06\x54\x32\ +\x32\x96\x0e\x47\x5b\x55\x13\xbb\x97\xd4\x89\xfa\x89\x58\x26\x02\ +\x33\xa2\xa6\x55\x66\x65\xab\x05\x5a\xa7\x36\xa1\x53\xa5\xef\x1f\ +\xe2\x17\x0d\xf5\xb9\x7a\x16\x5a\x9a\x19\x25\xcb\xce\x1b\x1b\x76\ +\x2d\x60\x32\x15\xfc\x62\x7f\xc6\x68\xbd\x8e\x85\x75\x69\x31\x6f\ +\xdf\xeb\xd8\x3c\x0d\x60\xb9\xbd\x4e\x26\xa4\xd9\x57\x02\x7b\x58\ +\x71\x3f\x52\xfa\xa4\x33\xe2\x7c\x3c\x55\x3c\xaa\x1b\xcf\x27\x4e\ +\x84\x73\x1a\xc1\x4b\x50\x2a\xd6\xb9\x5d\x0b\xf9\xa3\x85\xe9\x24\ +\x57\xd5\x7d\xde\x11\x81\xb3\x13\x27\x62\x0b\x18\x74\x02\xe8\x3c\ +\xe3\xcf\xc7\x11\x6b\xb9\x7d\x8a\xf5\xb8\x5f\x45\x5b\x03\xb0\x60\ +\xde\x08\xbc\x36\x66\xd1\x14\xec\x8a\x18\xc2\x68\x93\xc3\xf6\x5c\ +\xc6\x76\x21\x96\x1d\x05\xc5\xd6\x60\x83\xd7\x26\x1c\x84\x8c\xed\ +\x82\x00\xf0\x60\x48\xc3\x40\x19\x89\xe0\xe0\xd1\xa2\xdf\x3e\xe6\ +\x6a\x60\x88\xbf\xa5\x0d\x77\xb4\x3c\x0f\xbf\xdf\xa7\x73\xb9\x4f\ +\xfb\x60\x97\x5e\xfb\x12\x77\x30\xe4\xe0\xa2\x45\xd6\xe8\xd3\xbe\ +\x10\x6e\x99\x46\xbe\x4a\xb6\xef\x27\x12\x80\xfc\x5e\x48\xa6\x51\ +\x4b\xe8\xbd\xb4\x81\x93\x28\x1f\xf3\x1d\xe1\x89\x88\x4b\x87\xa4\ +\x16\x96\xed\x00\x3a\x7e\x8f\x80\x5a\xc2\x80\x92\x4c\x28\x8b\x35\ +\x96\x90\x1f\x66\x00\x00\x19\x9b\x49\x44\x41\x54\xe7\xb9\x08\xe7\ +\x25\xc4\x3c\x4f\xeb\x5e\x67\x20\x3d\xef\x52\x7d\x1d\xeb\x5d\x07\ +\xfc\x8f\x62\xe0\xb4\x21\xa7\x3f\x27\xb7\x12\xd8\xba\xee\x7d\xde\ +\xad\xea\x3b\x33\xae\x38\x55\x84\xea\x14\x55\x4f\x89\xce\xd0\x81\ +\x81\x60\x1a\x99\xcd\xe6\x3a\x13\x5c\x6b\x3d\x31\x7b\x6f\xd2\x1b\ +\xb2\xbb\x1f\xcc\x0c\x14\x1a\x74\x82\x69\x8d\x1d\xde\x90\x30\xb2\ +\x63\xe0\xc6\xa0\x8c\x41\xe6\x61\x12\x46\x36\x0c\x86\x94\x8a\x0d\ +\xdc\x81\xec\x86\x28\xb6\x42\x82\x88\xd7\x4a\x5e\x1b\x77\x20\x58\ +\x19\x40\x2e\x10\x77\x50\xc4\x2c\x9a\x84\x83\x90\x6c\xd1\x66\x3c\ +\x20\x66\xf9\x82\x08\x67\x07\x11\x54\x6c\xcc\x81\x18\x76\x03\x65\ +\x6c\xcf\x8d\x47\x90\x4d\x6f\xfb\x95\x09\x81\x66\xad\xeb\xae\x23\ +\xe9\xd9\x98\x77\xc2\x66\x0c\xbf\x38\x72\xd4\xac\xd9\x0c\x97\x5b\ +\xb4\x4e\x81\xd3\xe9\xd8\x58\x59\xf9\xa0\x97\xb9\x8b\xf1\x60\x36\ +\xa8\xd6\xae\x3c\xb7\x4e\xf0\x3a\x69\x90\x0e\x76\xcc\x2b\xa3\x9a\ +\xc7\xa6\x32\xd7\xa1\xea\x3b\x60\x25\x93\x73\x9e\xc7\xb8\xd7\x45\ +\xe6\xa4\x67\xc2\xae\x64\x66\xa4\x83\x64\xdf\x8f\x5a\x44\xd7\xdd\ +\xf4\x48\x68\x42\x1b\xc7\x00\x6f\x75\xb3\x6c\x1f\xef\xb2\x79\x79\ +\x9f\x71\xe3\x52\xb5\x42\x00\xa8\x2f\xbe\x42\xc9\x3f\xc2\x25\x1e\ +\x96\x33\xc8\x89\xb9\x1e\xbb\x01\xd9\xd6\x9b\xec\xda\xa2\x11\xe1\ +\x51\x3c\x13\xda\x35\xc7\x98\x25\xc3\xc3\xb3\x93\x07\x52\x32\xa4\ +\x1b\xd9\x53\x76\x8e\x3d\x18\xf2\x35\x09\x54\x8f\x0c\x0d\x03\xdc\ +\xc1\x50\x0d\x6c\x74\x07\x43\x4a\x86\x17\x33\xb2\x91\x60\x64\xc9\ +\xee\xf2\x7e\xc3\x40\xcc\xc9\x1b\x08\x17\x56\x38\x28\xe2\xf7\xfb\ +\x49\x00\x7b\x31\xe8\x1e\x1d\x26\x00\x3c\x4f\x1b\xea\x27\x49\xfa\ +\x88\xf5\xe7\x97\xeb\xa2\x7f\xb0\x64\xe1\xc1\xa9\xad\x98\xb8\x1d\ +\x1a\x89\x80\x86\x3e\x3a\x37\xca\x54\x54\x85\x8a\x2c\xed\x7f\x5e\ +\x33\xc2\xeb\x4e\xb6\xfe\x9e\x66\x2f\x98\x49\x50\xba\xee\xf3\xf4\ +\xae\x45\x32\x8f\x61\xde\x71\x78\x1e\x80\x13\xf1\x80\x4c\x86\xe2\ +\xc0\x9c\x6b\xd4\x49\x00\xe7\x1b\xe5\x6b\x3d\x10\xcf\x5b\xb4\x55\ +\xdf\x99\xd9\x47\x36\x9f\x39\xc7\x80\x0a\xdc\xc8\xdc\xe2\xa2\xfb\ +\x84\xbd\xfd\x0e\xbd\x6e\x3c\x7f\x7a\xe5\x65\x2e\x46\x0f\xd5\xb0\ +\xc6\x86\x99\x5c\x48\xa6\x3d\xed\xa4\xe9\xec\x1e\x72\x7a\xf2\x50\ +\x04\x3b\xdc\xc8\xc6\xf6\xc4\x0f\x95\xdb\x34\x03\xba\x03\x43\x4d\ +\x13\x75\x23\x7b\xca\xbe\x31\xa0\xc7\x78\x94\x8a\x51\xac\x83\x05\ +\xa3\x7b\x76\x09\x3c\xf1\xe5\xc6\x76\x21\x01\x7c\x01\x74\x61\x40\ +\xb6\x23\x68\x18\xc9\xc5\x63\x66\x4a\x94\x46\xf1\xb0\x14\x3f\xcb\ +\x85\x35\x4d\xb6\xb9\x6a\xf7\xa7\x8d\xb2\xb5\x88\x5e\xfa\xe0\xea\ +\x4e\xfa\x99\x83\x5f\x11\xff\x5b\xa1\x47\x71\x75\xda\x1b\xc2\xec\ +\x75\x12\x1d\x20\x65\xc8\x54\xef\x9c\x23\x9d\xf7\x69\x00\xeb\x3e\ +\xdc\xeb\xf2\x79\xd3\xcf\x5d\x35\xea\xcf\xcd\x6b\xd0\xfd\xbb\xe9\ +\x08\x9d\x04\xf3\x3c\x59\x91\xce\xd8\xfb\x28\xe0\x49\x00\x4b\xf0\ +\x0e\x8a\x21\x51\xc5\x60\xd4\x76\xe6\x12\xc4\xbc\x85\xa1\x7f\x87\ +\x73\x66\xbd\x1a\x7a\xc2\x14\x7d\x31\xf9\xaa\xda\x5f\xa4\x13\x05\ +\xf8\x57\x1d\x98\x1c\xe2\xf0\x88\xa5\xfc\x4b\x94\xfc\xa3\x78\xe4\ +\x6e\x35\x96\x7b\x43\xd5\xe3\x2f\x6b\xdf\x10\xf2\xe3\xc5\x35\xf2\ +\xcd\x57\x66\x99\x58\x6e\x15\xdb\x1a\x1e\x66\xd1\x14\xa0\x8b\xc1\ +\x39\x05\x60\x41\x81\xdd\x8d\x6c\xc1\xb0\xb1\x96\x0e\x07\x21\x36\ +\x39\xf5\x1e\x25\x41\xe4\x56\xbe\x2f\x66\xe5\x31\xde\xdc\xc5\x03\ +\xe0\xe6\x73\x54\x02\x97\xd1\xbe\x33\x17\x30\xb2\x7a\xe3\x3a\x37\ +\x93\xbc\x2d\x13\xcd\xb4\xa2\x6a\x9a\xb6\xf2\x44\xb4\x3a\x71\xc5\ +\x45\x2f\xbc\x36\x39\x7e\x12\x57\x15\xfb\x45\xef\xb9\x1d\x23\x75\ +\xc0\xe9\x06\x67\xda\xaf\x7d\x9d\x7b\x6d\x1e\xe8\x54\x37\xcf\x54\ +\x07\xcf\xe7\xb1\xb8\xd1\x8f\x54\x15\x87\x7e\x2c\xe6\x49\x85\x74\ +\xb8\x59\x6a\xe1\x51\xdb\xf9\x6b\xc9\xa5\xe7\x2d\x98\x8e\x21\xf2\ +\x33\x64\x14\xee\xbc\xd1\x20\xec\xb6\xe9\x76\x32\xaa\xcc\x2d\x51\ +\xd9\x11\xdf\x5a\x61\x41\xb1\xf0\x02\xc7\x0a\xc8\xf2\x78\x98\xe2\ +\x12\x2e\xf4\x6f\x9a\x89\xa5\x9c\xf0\xec\x52\x82\x89\xcd\xa2\xa9\ +\x58\x56\x86\xa5\x25\xa8\xed\xd4\x84\x4a\x7b\xce\xc4\x4a\x7d\x91\ +\xc8\xbf\xa3\xd8\x38\x66\x60\x37\x9f\x53\xf7\x3d\xc6\xec\xd6\x44\ +\xe6\xff\x42\xa3\x32\xc3\x70\x69\x97\xd9\xbc\xa0\x87\x3c\x99\xb5\ +\x7a\x4d\x3b\x38\x9e\x92\x11\x19\xba\x09\x43\x4e\xea\xe1\x79\x7d\ +\x81\xf5\x46\x83\xf3\x2a\x52\x94\xd7\x42\x0b\x80\xa4\x81\x36\xa9\ +\x58\xcf\xf5\x0f\xa7\x75\x6c\xba\xb4\xe8\xa3\x64\x83\xcc\x87\x98\ +\xb7\x28\x74\x57\x5a\x7a\x2b\xaf\x5e\x12\xcc\xd7\xf9\x8a\xd3\xdf\ +\xf3\xa3\x8c\xd2\xb9\x8d\xcf\x8f\x1e\xd3\x8b\xe2\xcc\x36\xd9\xf9\ +\xc0\xdf\xa1\x53\x4e\x8e\x2e\x6b\x9a\xc3\x04\x0b\x37\xf2\x3e\xed\ +\x91\xc5\x02\xc7\x04\xf5\x86\x90\x13\x20\xc6\x79\xa5\xb5\x31\xa0\ +\x98\x55\xc8\x88\x82\x02\xae\x7c\x2c\xa5\x86\x64\x59\xe1\x53\x2e\ +\xcc\xb0\xaf\xee\x89\x50\xab\x2d\xd6\xd0\xd2\x08\xd4\x6f\xe9\xf6\ +\x5a\xd6\xd9\x1b\x62\xbf\x51\x4f\x85\x6e\xf5\x26\x29\xcf\x0b\xdf\ +\xce\x63\xe1\x04\x43\x74\xba\x2a\xa7\x61\xe8\xbb\xc9\x71\xb7\x1a\ +\xf3\xcb\x06\x7e\xb2\x86\xec\xa3\x52\x2e\xe7\x45\x14\x25\xb8\xf5\ +\xa6\xdd\xd7\xe5\xe3\xea\xb5\x85\xf3\xa2\x92\x69\x00\xeb\x3a\xf9\ +\xa3\x02\x13\x12\x9c\x69\x20\xeb\x00\x46\x15\x0b\x7c\xf4\xe7\xc9\ +\x4c\xb8\xf4\x3e\x7e\xd1\x53\x19\x6d\xd9\xbe\xaf\x16\xa1\x7b\x76\ +\xc4\xf1\xd0\xc2\xe3\x0a\xa7\x7d\x39\x53\xa6\x24\x01\x6c\x96\x7b\ +\x6a\x98\xfd\x02\xc7\x84\xf9\x65\xda\x23\x8b\x46\xde\x27\xcc\x2f\ +\x4f\x3b\xc5\x9b\x45\x13\x33\x33\xdf\xb8\xd3\x5d\x61\x52\x07\xeb\ +\xc0\x35\x8b\xa6\x02\xa3\xbc\xaf\x22\x7e\x29\xb6\xd5\xc1\x3b\x0f\ +\xc8\x92\x81\xa5\x2e\x96\xf7\xfd\x8c\x88\xce\x5c\x8c\x1e\x62\x67\ +\x32\x89\xde\x63\x7a\xd2\xcb\x75\x01\x83\x56\x35\x33\xc3\xc2\xea\ +\xb5\xce\x34\x2f\x43\x26\xec\xa4\xdb\x94\xca\x7e\x65\x52\x0f\xeb\ +\x35\x72\xe9\x44\xfe\x79\x57\x89\x79\x85\xab\xf3\xea\x04\xe7\xb1\ +\x9d\x9e\x4e\xfa\xbc\x80\x48\xc1\x2a\x71\x8e\xf1\x91\x9e\x83\x79\ +\x6e\xb4\xa8\x62\x60\x86\x3d\x06\xc5\x10\x33\xec\x29\x7b\xc2\x0b\ +\x02\x42\xb3\xfa\x91\x52\xc2\xe8\x47\x8a\xf9\xd3\x0b\x2c\x3d\xcd\ +\x55\xbf\xdd\x28\xf8\x6a\xac\x86\xaa\x7a\xf6\x77\xd4\xd4\x2d\x39\ +\x57\x0f\x44\xa5\x4b\x98\x5f\xa6\x5c\xec\x61\xac\x64\x69\x8f\x2c\ +\x95\xf2\x99\x70\xa0\x4a\x0f\x82\xd4\xc0\xf3\x40\xa7\xd8\x3a\x36\ +\xd6\xa4\x04\xf1\xec\xd2\xf4\xfd\xb1\xe1\x97\xd8\xff\x1a\x49\x91\ +\xfe\x7c\x9d\x81\xe5\x7d\xb3\x7f\xc5\xd5\x9e\xa5\x0e\x9c\xbc\xbc\ +\xcf\x6b\xa4\x9d\xbe\xcc\x59\x55\x53\xa5\x3f\xa6\x6f\x7d\xa7\x80\ +\xeb\x4c\x12\x46\x87\x04\x64\xba\x87\x82\x64\x4e\xe9\xad\x78\x9e\ +\xd7\x21\xed\x5f\x4e\x97\x52\xcd\x73\x8b\xa5\xa3\x6f\x33\x69\x94\ +\xa9\x36\x5e\x69\x40\xcb\x1c\xe7\xef\xc5\x90\x9b\xc7\xc8\xa1\x59\ +\xc5\xce\x64\x12\xa0\x95\x60\xfe\x28\x36\x5e\xaa\x3c\x5f\x13\xcf\ +\x1b\x95\x06\x60\xad\xbf\xc0\xa7\x6f\xaf\x50\xb9\x5b\xa7\x76\xe5\ +\x2b\x26\x96\x03\x1e\xd5\x64\xa7\xbe\x90\xae\xe5\x4f\x94\x60\x6b\ +\x8d\xdb\x77\xee\xf3\xd9\xcd\x12\xa5\xc5\xca\xb4\x53\xfc\x34\x20\ +\xc1\xb5\x06\x56\x1a\xe8\xd2\x28\x93\xfb\xea\x9f\xa1\xbb\xd1\xd2\ +\x9f\xad\x33\xf3\x3c\x89\x61\x66\x4a\x53\xf0\x66\x4a\x94\x8a\x05\ +\x5a\x65\xe3\xda\xa4\x98\x8f\xd2\x63\x12\xc0\xf3\x58\x78\xe2\x0f\ +\x67\xda\x01\xe8\x80\xd4\x2b\x7c\xd3\x63\x76\xe7\x31\x70\x5a\x23\ +\x26\x7a\x65\x68\xef\xb9\xce\x00\x4d\x4b\x88\x99\x56\x05\xda\x02\ +\x48\xef\x2f\x13\x6c\xce\x31\x54\xc5\xf2\xf3\x58\x78\x50\x0c\x31\ +\xfa\x11\x46\x3f\xc2\x0b\x82\x84\x14\xf8\xeb\x24\xfe\x48\x9d\x2e\ +\x17\xe2\x75\x6e\x3d\x69\x5f\xe8\xb2\xce\x3f\x7a\x8c\x1b\x8c\x58\ +\x08\x97\xa8\xde\x14\xd3\xa6\x26\xc3\xf7\x13\xb3\x0f\x27\xfe\x90\ +\xee\x55\x9b\x17\x4b\x0d\xbe\xb8\xf5\x80\x2f\x6e\x3d\x60\x73\xbd\ +\x4c\xf9\xd3\x2f\xf1\x23\x0f\x3e\x2f\x70\x62\x16\xcd\x84\xfe\xd5\ +\x19\x30\x6d\x80\x5d\xf7\xdc\x75\x9a\xf7\x3a\xf0\xce\x63\xfb\x34\ +\x90\x81\xff\xaf\xb3\xab\xeb\x71\x1c\x4b\xcb\x8f\x3f\x52\x89\xed\ +\x38\x76\x52\x55\xdd\xd5\xbd\xdd\x3d\x3d\xd5\x3b\x2b\xcd\xdc\xec\ +\x0a\x84\x84\xd0\x08\x81\x10\xdc\x00\x17\x08\xc1\x25\xab\x15\x3f\ +\x8a\x0b\x7e\x01\x3f\x61\xaf\xd1\x0a\xd0\x22\x56\xa3\xd5\xd0\x30\ +\x3d\xd3\xd3\x1f\xc5\x54\x77\x57\x25\x71\xe2\xd8\x49\x2a\x8e\xcd\ +\x85\xfd\x9e\xbc\xe7\xe4\x1c\x27\xbd\x96\x4a\x49\x1c\x97\x93\xd8\ +\x8f\x1f\x3f\xef\x37\xc6\xab\xa6\x4d\xd6\xed\x16\x0b\x3c\x97\xc0\ +\xcb\x0d\x23\xe9\xea\x66\xd1\x39\x77\x60\xd7\x43\x06\x07\xfb\x5d\ +\x3f\x67\x49\xdd\x15\x5d\xe7\x9e\x6a\x9b\xa8\xa4\xba\xd7\xa2\x96\ +\xdb\xad\x64\x74\x2a\xd5\x29\x3a\x26\xd5\xbd\x56\x93\xfb\xdb\x3e\ +\xe7\xee\xee\x1a\xf7\x50\xe1\x26\x05\x4e\xed\x61\xab\x3b\xcd\xcf\ +\x6d\xe1\x4a\xf3\x73\x5b\xf2\x11\xab\xc1\x0e\x93\xa4\x20\x1d\x4c\ +\x1e\x0c\xd3\x9d\x45\x92\x6f\xa5\x05\x34\x4d\x51\xfa\x17\x16\xa6\ +\xd3\x04\x63\xfb\x46\xe4\xc8\x74\x7a\x5f\x88\x9c\xe2\x00\x27\x82\ +\x8d\xdf\x9c\x2c\xf1\x38\xa8\x30\x18\x0d\xf0\x69\xff\x1c\xbf\xef\ +\x04\x88\x7e\x14\x34\x77\x0a\xca\x5f\x60\xac\x49\x20\xca\x2a\x0f\ +\xe5\x36\xd3\x4a\x0b\x0e\x46\x13\x7b\x9b\x24\x03\xdf\x77\xdb\x32\ +\xec\x2c\xd1\xeb\x55\xb0\xe3\x33\xbc\x7e\xd1\x95\xd8\xb0\x93\x16\ +\x72\xbe\xac\x26\x49\x9e\x32\xd4\x86\x1a\x39\xc1\x07\x0f\x9a\xdc\ +\x59\x6d\xc1\x0c\x5d\x7f\x85\xb6\x5c\x02\xae\x89\x75\x40\x36\x25\ +\xd3\xa8\x91\xb9\x36\x6f\x46\x69\x0f\x30\x77\xfb\xe8\x0e\xfb\x18\ +\x97\xd3\x83\x49\x3e\x7e\x6e\x4b\x46\x9c\xc9\xf5\x66\xb3\x8b\x9d\ +\x3f\xae\xa7\x0b\x8c\xa2\x91\xf0\x82\x1c\x23\x61\x22\x7b\x20\x6c\ +\x94\xc5\xbb\x0a\xb1\x95\xe0\xb4\x3c\xc7\xe3\x5e\x9d\x30\x9f\xdc\ +\x7e\xa5\x77\x71\xbe\xbf\xc2\xcd\xec\x5b\x54\x2b\x0b\x3d\x58\xc8\ +\xbd\xa0\x69\xba\x0d\xbd\x9c\x90\x4e\x68\x18\x1e\x05\x4e\x1d\x5b\ +\xb7\xc9\x12\x21\x17\x0c\x0c\x4e\xeb\x57\x2b\x0b\xdd\x55\x61\x4c\ +\x7b\x54\xcb\x8e\xf8\x42\x29\x96\x3a\x16\xe6\xe5\xe6\x87\xa2\x5b\ +\x5c\x4e\xb4\x01\xfc\x90\x05\xaf\xf6\x66\x30\xb5\xa0\x6d\x03\x83\ +\x29\xe0\xc0\xc1\x7c\x48\x4a\x70\x20\x7b\x8e\x23\x5e\xe7\x7e\xa9\ +\xdd\x9e\x17\x00\xf0\x7d\xd3\xc5\x62\xa5\x15\x4e\xed\xa1\xd6\x87\ +\x2d\xce\x67\x79\x02\xcc\x6b\x77\xe5\x68\xbe\xbb\x70\xd6\xf1\x05\ +\x56\x41\x0a\x6c\xde\x8a\xb0\xb3\xd4\xb8\x1b\x27\x98\x0c\x9c\x5d\ +\xd2\x10\x80\xfe\xd2\x97\x71\x74\xe8\x44\x50\x1f\x0a\x2e\x33\x38\ +\x38\xdb\xbc\x0f\x6d\x12\x43\x27\x2f\x74\xeb\x9d\x6e\xff\xa3\x4f\ +\x28\x19\x73\xe5\x20\xde\xab\xd1\x22\x6b\x57\xa7\xa5\xdb\xc0\xc3\ +\x5d\x62\xba\xd0\xb2\x09\x54\x26\x69\xa0\x93\x1c\x3a\x3d\x7d\x28\ +\xc0\x70\xcc\x05\xa8\x33\xe4\x48\x13\xab\x12\x43\xf5\x19\x5b\x41\ +\x6a\xbc\xc0\x28\xa2\x57\x85\x16\xc6\xe5\x54\x44\xea\xb4\x9a\xb8\ +\xe9\x9a\x19\x57\x16\x6e\xcb\x54\x14\x1e\x58\x8b\x0a\xae\x7d\x01\ +\x74\x1e\x0b\x26\x56\x67\x4a\x47\xf6\x00\xef\x93\x29\x7e\x58\xd5\ +\x44\xb2\xf0\x72\xf4\x4f\x4e\x76\xe3\x0e\x4c\x7e\x59\x93\xa1\xc5\ +\xb7\xe5\x52\xc3\xe4\x07\x36\x01\xd8\x24\x47\xf8\x7a\xfa\xbc\xe5\ +\x2a\x41\x55\x7d\x85\xc5\xed\x44\x5b\x11\xa1\xde\xea\x46\x76\x85\ +\x2d\x22\x0c\xed\x4a\xf4\x09\x16\xbf\xb3\x78\x2f\x9a\x9e\x1c\xcb\ +\xa0\x1c\xb8\xbc\x01\xe2\x31\xc1\x0a\x9d\x34\x30\x19\x83\xba\x10\ +\xef\xa1\x7c\x08\xca\x55\x38\xd6\xad\x46\x86\x1c\x01\x3a\x4b\x4b\ +\x01\xdc\x05\xaa\x3d\x4d\xac\x2b\xc3\x22\x29\x41\x5d\x82\xb8\x0c\ +\xe1\x79\x13\xf4\x3b\x85\x6b\x6d\x6e\x69\x35\x76\x95\xbe\x16\x9a\ +\x38\x3e\xfb\xe9\x3e\x81\xb8\x3d\xcc\x5e\x4d\x61\xe3\x05\xfc\xa5\ +\x5d\x8f\x3e\xb0\x73\xb1\x4f\x5b\x07\x56\x93\xa1\xa5\xbe\xe6\x72\ +\xc0\xe4\x6d\x38\xa4\x8f\x4d\x40\x27\xcd\xbc\x5d\xdf\xe0\x7f\x92\ +\x7b\x62\x06\xb0\xc9\x88\x53\xd7\x39\x4d\x37\x64\x92\x13\xb3\x64\ +\x86\x69\x69\xed\x0d\xe1\x3e\x74\xfb\xe7\xc0\x55\xf5\xb0\x4e\x27\ +\x9a\x7c\xb9\x52\x89\x94\xc6\x43\xa1\x0b\x39\x1f\xca\x0f\xa6\x85\ +\x3c\x12\x26\x39\xa2\xa6\x54\xf2\x10\x73\x1f\x96\xa4\x8b\x89\xa1\ +\x4d\x99\x6c\x5c\x4a\x10\x80\xb9\x51\xc8\x7d\xd5\x54\xc9\x2d\xec\ +\x86\x66\x56\x34\xff\xae\xf5\x50\x19\x08\x4d\x4c\x8d\x05\x33\xdc\ +\x21\x73\x1f\x89\x74\xcc\xe8\x74\x88\x45\x72\x89\x13\x7f\x52\xf7\ +\x27\x5e\xb9\x40\xaf\xd8\x97\x13\x2a\x58\x0f\x81\x51\x35\xd0\xd2\ +\xc2\xac\xad\x0f\x19\x7e\xba\x0b\x20\x74\x6d\x2c\xe1\x88\x68\xdd\ +\xa1\x88\x11\xdd\x7a\xa2\x38\x92\xc0\x4b\x60\xb6\xe7\x89\xdc\xb1\ +\x11\xfa\xea\x08\xde\x9c\xf0\x90\xc1\x67\xca\xf1\x35\x05\x2e\x78\ +\xd4\x4e\xa7\xc7\x8f\xc9\x44\xe3\xeb\x88\xf9\x78\xd2\x8d\x29\x3a\ +\xc7\x75\x30\xf9\x81\xe9\xf5\x02\x15\x82\xd0\x86\x9f\xdb\x22\x7b\ +\x4d\x05\x3d\x81\x76\x3d\x5d\xec\x35\x5b\xa1\xe7\x04\x50\x5e\x38\ +\x1b\xf4\x3b\x52\xab\xd7\xb9\xdb\x17\x9d\x7d\xd2\x7c\x86\xc5\xdd\ +\x9d\xd0\xc4\x70\x2f\x77\x43\xd5\x8b\x97\x08\x58\xda\x42\x55\xbe\ +\x44\x52\xc5\x20\x8d\xd8\x2f\xfd\xda\x4f\xcc\xa5\x81\xca\xc4\x3a\ +\x66\xe6\xa0\xa5\xff\x21\x16\xe7\x6c\xae\xfb\x5f\x75\x5d\x1b\x23\ +\x93\xe4\x28\x9c\x21\xc6\xaf\x5c\xdc\xac\xbf\x16\x09\xf1\x04\x34\ +\x35\xb9\x66\xd0\xcf\x05\x03\x73\xf0\x4e\x4b\x0b\xd3\xd2\x92\x58\ +\xd0\x94\xa3\xa0\x1a\x89\x26\xd9\xa1\x36\x25\x31\xe5\x2f\xe8\xa4\ +\x0f\xaf\x34\x69\xd3\xf9\xc7\x48\x14\x62\xbe\x7b\xa8\x8e\xce\x54\ +\xb3\xd2\x4a\xd4\x2e\x02\x40\xd6\x0c\x55\xcc\xd2\x12\xb9\x5f\x4a\ +\x12\x41\x65\xe3\x2a\xb4\xf6\x52\x34\xf9\x42\x17\x13\x97\x4d\x62\ +\x74\xef\xa0\x42\x1c\x87\x75\xdf\x3a\x40\x8c\x32\xd8\xe6\x1e\xe6\ +\x1f\x80\x37\xf3\x7a\xbf\x34\x8f\x5a\x32\xc6\xc7\x53\x56\xba\x5f\ +\xdf\x95\xcb\x6a\xb1\x1f\xb1\xe3\x4c\x5c\x6e\x33\xac\x9c\x07\xe2\ +\x39\x25\xe3\x98\x34\xb3\xee\x71\x2f\xf2\xe6\x1c\x17\x45\x22\x56\ +\x0f\xfc\x1e\xec\x74\xbc\xe7\x21\x20\xa0\xf1\x6e\x36\xc4\x00\x94\ +\x27\xcc\xbd\x12\xd5\xbc\x12\x65\xf7\xc7\x30\x27\x67\x60\xb5\x5a\ +\x58\xcd\xef\xd5\xb9\xcb\xa6\xeb\xb9\x36\x02\xa7\x7e\xd6\xa1\xd4\ +\x46\x1d\x90\x4d\xf2\xa3\x2d\xe4\xcc\x75\x2f\x31\x67\x1f\xb5\x1e\ +\x26\x90\xda\x7e\x65\xcc\xad\x38\x74\x17\x54\x2f\x16\x0a\xb6\xf0\ +\x1e\xcf\xd4\x5d\x7e\x53\xac\x44\xff\x89\x34\x7a\x03\x0f\xa7\x70\ +\x46\x29\x06\xf7\xea\xde\x13\x9b\x0f\xcf\x45\x90\x83\xe7\x50\x44\ +\xa7\x43\x3c\xb9\xf3\x90\xe6\x33\xf8\x4d\x94\x38\xdf\xd4\x43\x1f\ +\x6d\x1d\x5b\x12\x08\x7b\xdb\xeb\xbd\x9c\x86\x43\x40\x56\xf5\xb5\ +\x0a\xe8\x63\x16\xce\xd8\x39\x06\x58\xe0\xf9\x5e\xa4\x8e\x17\x86\ +\xf6\xdc\x40\x54\x6b\x88\x26\xe2\xe9\x8e\x8d\x3f\xc6\x0d\x26\xf9\ +\x9a\x59\x36\x9a\xc8\xd3\x50\xf4\x2c\x15\xa0\xf2\xfc\x8d\x61\x77\ +\xd0\x9a\xa8\xa3\x03\xe4\xb1\x9e\x97\x63\xa2\x94\x7b\xb2\x2d\xb4\ +\xb5\xd9\x6a\x41\x68\x0b\x19\xc1\x81\x6c\x62\x61\xdd\xf7\xe5\x7a\ +\x1a\x00\x46\xd1\x68\x3f\x9f\x98\x9a\x72\x37\x15\x1c\xd4\x7f\x22\ +\x9c\x3d\xc1\x12\xe3\x5a\xdf\x36\xde\x89\xce\xbd\xcf\xb5\x61\xfd\ +\xd9\x76\x86\xbb\x7b\x75\x7b\x57\xca\x7c\x13\x86\x9d\x0a\x3c\xdb\ +\x09\x5a\x59\x15\xa8\x13\xd5\xf9\x63\x9b\xf1\xf7\x31\x80\xe5\xa0\ +\xa7\x7d\x2f\x57\x09\x5e\xbf\xe8\x4a\x4c\xcc\x7b\xad\xf1\xdb\x96\ +\xea\x13\x8e\xe2\x08\xe9\xa2\xb7\x37\xb3\x58\x3d\x31\x6a\x6e\x00\ +\x35\x64\x59\x15\x19\x2a\x27\x6c\xad\x6d\xa3\xfe\x13\x62\xe2\x53\ +\xc3\xc4\xea\xc9\xd5\xb5\x5a\x35\x19\x74\x2a\x60\x8e\xc9\x37\x6e\ +\xf3\x31\x9b\xd2\x2e\xad\xb4\x12\x00\x0f\xac\x4c\xfc\x71\xe3\x8e\ +\xf6\x69\x0a\x65\xf3\xf0\xb4\x95\x56\x7b\x41\x96\x41\xb1\xa8\xbb\ +\xcd\xb3\xa0\x50\x69\x0f\x44\x62\x7c\xe8\x47\xf0\x86\xf5\x7b\xd6\ +\xfd\x8e\xf0\x29\xd3\xa8\x31\x00\xb0\xab\x39\x22\x27\xc2\x03\xab\ +\x80\x87\xd3\xba\x91\x20\x73\xdd\xd9\x6d\x40\xe2\x8f\x92\x5b\xad\ +\x61\xe5\x36\x76\x3e\x96\x85\x4d\xe0\x4f\xdd\xfa\x87\x79\xbd\x58\ +\x62\x61\x5d\x57\x47\xea\xde\x23\x5f\x69\x35\x1b\x17\xfe\x5a\x78\ +\x24\x4c\xc5\x97\xaa\xcb\x27\x9d\xee\x32\xd5\xac\x6d\x6a\x94\x01\ +\xc4\xda\xab\x22\x83\x33\x8c\x04\x83\xf7\xcf\x46\xe2\xe4\xea\x12\ +\x7e\xd4\x0b\xc1\xf4\x5c\x17\xbc\x38\x54\x1c\xba\xd7\xe1\xbd\x69\ +\x98\xcd\x41\x29\xb4\x71\x90\x0a\xb6\xcd\xaa\x00\x0b\x00\x55\x16\ +\x0a\x83\x8f\xef\x53\xf5\x80\x50\x24\xaf\xcd\xfb\xc1\xf3\xb8\xd5\ +\x0c\xb6\x51\x54\x03\x31\xb6\x12\x5c\xc4\x0f\x1b\x89\x53\x4f\x26\ +\xe8\x8c\xba\x3b\xe3\xae\xd1\xc3\x3f\xfb\x7c\x84\xde\x27\xcf\xe4\ +\xa8\x6b\xd3\xe3\xc3\x2e\xb7\x19\xa6\x9b\xa6\xc6\x6c\xe3\xed\x19\ +\x66\x5c\xcf\x92\x4e\x56\x0d\x3b\xf5\xaf\x8d\x6d\xdb\x0c\x3f\x75\ +\x7d\xea\x04\x48\xfe\xf7\x4a\xb0\x9b\xe9\x24\xaa\x00\x9e\x25\x33\ +\x31\x8a\xcb\x9e\x27\xda\x72\xa2\xb6\x25\x1c\x76\x44\xe1\x69\xe5\ +\x84\x98\xae\xe7\xa8\x9c\x50\xea\xe9\xa6\xea\x67\x5e\xa8\xba\xb8\ +\x9d\xec\x49\x13\xf5\xf6\x7f\x6c\x95\xb3\xca\xde\x26\xa3\xd4\xc4\ +\xcc\x54\x9d\x41\xc0\xa5\x3b\xc4\x02\x75\x24\x6e\x01\x26\x2f\xb2\ +\x50\x44\xed\x74\xee\x35\x1e\xcc\xa0\x48\x9e\x49\x37\xab\x44\x43\ +\x4c\xdc\x71\x7b\xe8\xb9\x01\xbe\x7f\xf9\xc3\xee\x77\x01\xf8\x9c\ +\x0d\x02\x4d\x92\x54\xcc\x09\x21\x36\x0e\xee\x3f\x42\xf7\xec\x44\ +\x74\x01\x02\x00\xa7\xc9\x36\xb4\x6d\x27\xc0\x13\xab\x40\xb9\xcd\ +\x30\xec\xd4\x01\x06\x02\x35\x67\x47\x4a\xc6\xf1\x31\x17\x60\xa7\ +\x6d\x49\x82\x70\x29\x62\x02\xb0\xca\xbc\x6d\xbe\xe9\x55\xba\xc1\ +\xdb\xd5\x35\xd2\xab\x97\xc2\x33\xc1\xbd\x02\x34\x89\x48\xa6\xd1\ +\x06\xd4\xe1\x2e\x47\x42\x57\xe7\xd6\x6a\x54\x4e\x37\x12\x38\x3d\ +\xc7\xc1\x76\x3a\x43\xff\x6c\x64\xd4\xcf\x1c\x58\xbc\xf7\x9b\x8e\ +\x41\x75\xfe\xed\x36\xcd\xae\x6e\xdf\x16\x1c\x31\x7d\x2e\x67\xe2\ +\xe5\x76\x0b\xdb\xaf\xa4\x47\x8a\xd6\x95\xb9\xa5\xf5\x13\x93\x57\ +\xc3\xc4\xba\x26\xf0\xaa\x9d\xe3\x37\x93\xb5\x08\xce\x90\xb7\xe1\ +\x7c\xd4\x81\xfb\xf0\x3e\x2e\x43\x16\x6e\xe6\x29\xaf\xb1\x8d\xcb\ +\xa7\x4f\x11\xfa\x35\x59\xd1\xd0\x19\xda\xa7\x5d\x6e\x33\xbc\xa9\ +\x5c\x09\x54\x34\x8c\xdc\xe4\x5d\xa0\xf7\xc7\xab\x12\xa7\x3d\x5b\ +\xcb\xae\xe3\x55\x89\xb0\xe8\x68\xe5\x84\x6e\x7b\x95\xf1\x29\x29\ +\xe9\xd5\x7f\xfc\x37\x92\xdb\xaf\x76\x1d\x21\x99\xf6\x34\xc9\x08\ +\x62\x62\x0a\x7a\xb4\xb1\x30\x6f\x61\x4a\x07\xdc\x73\x1c\x09\xc8\ +\xa2\x69\x34\x63\x5b\x1d\x38\x4d\xef\xa9\xcc\xad\x26\xc6\xb7\xe9\ +\x5a\x3e\x35\x95\xeb\xec\x63\x42\xcd\x94\xac\xce\x41\xe7\x39\x8e\ +\xa4\x63\xcb\x7c\xe7\x27\x26\xaf\x05\x07\x28\xff\xcc\xee\xb0\x2f\ +\x12\xe7\x4d\xe0\x35\x1d\x17\xd2\xaf\x99\x7d\x87\xb9\xdb\xc7\x74\ +\x36\x13\x49\x3d\x6f\x5f\xbe\x07\x92\x7a\x9f\xe1\xa3\xcb\xfa\x5c\ +\xcf\x2d\xc9\x1b\x95\x4d\x5e\x20\xcd\xeb\xe3\xef\xfa\x1e\xb6\x6c\ +\xfc\xaf\x7c\x89\x27\xbb\x94\x45\xce\xc6\xd3\x8d\x27\x01\x97\xc0\ +\x36\xec\x2c\xf7\xf4\xf3\x78\x55\x8a\xf7\x52\x77\x63\xf4\x1f\x9b\ +\xc0\x4d\xfb\x2f\x9c\x21\x7e\xfb\xd5\xaf\xa5\xf9\x14\x1c\xc8\xa6\ +\x89\xf2\xb3\xa4\x4e\xfa\x99\x34\xc7\x7e\x52\xb6\x57\x3b\x70\xc7\ +\x3f\xf5\x28\xa3\x5e\xc0\xe9\x74\x23\xf5\x2e\xd3\x55\x90\xe8\xc0\ +\xcb\x53\x13\xb9\xe1\xa8\x1a\x80\x87\x5c\x6f\x9c\xe9\x8b\x79\xa9\ +\xcd\xf1\x6d\xbb\x68\x54\x23\x8e\x83\x92\xfc\xc4\xc4\xc4\x7d\xec\ +\xb6\x25\xd7\x1b\xe5\x53\xa8\xbf\xab\xca\x42\x2d\x78\x75\xe7\xc4\ +\x24\x73\x86\x51\x84\x37\x3f\x2c\xf1\xcd\x2b\x07\xd3\x69\x82\x22\ +\x5f\x8a\xea\x8e\x7a\x0e\x78\x25\x6a\x1a\x89\xb5\xd7\xb7\x77\x28\ +\x72\x17\x45\xbe\x84\x43\x21\x6d\xf2\x13\x13\x40\xa7\xc1\x4e\x4c\ +\x8b\x75\x0a\x80\x9f\x58\xc5\x4e\x3b\x37\xa0\x27\xe0\x11\x8b\x1b\ +\x83\x26\x49\xbc\x97\x2b\xac\x3e\x17\x92\xe6\xe6\x46\x04\x39\xc8\ +\x33\xc1\xdb\x38\x71\x16\x1e\xd9\x9e\x08\x66\x94\x83\x18\xb3\x64\ +\x06\x07\xcd\x4c\xe5\x23\xb4\x30\xf7\x04\x78\x8e\x83\xc5\xed\x04\ +\x9e\xe3\x48\xae\x32\xea\xef\xa6\x7a\x1b\x54\xef\x01\xe5\x14\xd0\ +\xfe\xee\xee\xae\x85\x5f\xd4\x54\x2f\xf7\x31\x52\x47\xc7\xc2\x6a\ +\x6f\x0d\x2e\x21\xd4\xe8\x1b\x4f\xbf\x24\x16\xa6\x8b\x83\x00\x4c\ +\x2e\xb7\xe5\x76\x2b\x19\x81\x3c\xeb\x4d\x07\x50\xb5\x7b\x3c\xfd\ +\x51\x47\x20\x7e\xec\x6e\xcb\x14\x9d\x41\x0f\x0f\x7b\x05\xfc\x4e\ +\x17\xae\xef\x89\xea\x8e\x4d\xe8\x8a\x2a\x90\x4d\xe8\x8a\xfc\xe3\ +\x9a\x85\x8b\x66\x9e\xdd\x52\x61\xe2\x44\x49\x1a\x67\xaf\x87\x9d\ +\xa5\xc4\xca\xa9\xbb\xc1\x30\xeb\x4a\xa0\xa7\x6d\xc2\xa2\x23\x19\ +\x89\x7c\x5f\xd3\x8d\x07\xc4\x89\x00\x2c\xdf\xaf\x90\x2f\xcd\xb6\ +\x54\x9f\xf7\xf5\x8b\x97\xcd\x60\xee\x70\x2f\x5a\xc6\x17\x5e\xb5\ +\x6c\xcf\x13\x91\x04\xcf\x7b\x1a\xb7\x2d\x9c\x39\x97\xdb\x2d\x86\ +\xdd\x81\x30\xe2\x74\x8d\xab\xd5\xb4\x47\xee\xfe\xe2\x21\x5e\xd5\ +\xc3\xa0\xba\xca\x78\x9e\x6e\x9b\xdc\xd1\x31\x35\xff\x0e\x04\x42\ +\xd5\xe8\x35\x95\xdc\x7b\x8e\x03\xdb\xaf\xa4\x80\x07\xb9\xd5\x82\ +\xd0\x16\xc1\x11\x62\xe1\x2a\xb4\xe0\xa4\xb2\x8c\x30\x75\x16\xd2\ +\x1d\x6f\x6e\x10\xf2\xf7\x29\xf4\x3c\x9f\x6d\xb1\xcd\x3d\x89\x89\ +\xa9\x8e\x52\xf5\x19\xd7\x4c\xec\xa2\xf0\x7b\x58\xa1\xaa\x99\x98\ +\xc0\x35\xdd\x78\x78\x68\x25\xe0\xaf\x09\x58\xc3\xce\x52\x7a\x44\ +\x5c\x77\xc9\x89\xf3\x44\xda\x86\xdc\x62\x61\xd1\xc1\xb0\xb3\xac\ +\x7d\xbd\xcd\xb6\xc4\xb0\x62\x7d\x12\xe3\xb4\x67\xcb\xc0\x0f\xd6\ +\xe2\xf9\xfa\xf5\x02\xe9\xd5\x4b\x6c\x42\xb7\x9e\x13\xcd\x0e\x1e\ +\x6f\x88\x0d\xd4\x15\x0c\x43\xbb\xc2\x30\x6b\xa2\x4f\x4d\x17\x9f\ +\x0f\x49\x75\xf0\xd6\x46\x27\x9b\x9f\x60\x95\xd1\x78\x78\x5b\x6d\ +\x72\xa2\x73\xfc\x4f\xd7\x73\xb1\x4f\x62\x61\x9d\xaf\xf7\xa4\xe9\ +\x58\xa9\xfa\x94\x55\xc0\x91\x67\x86\x03\xfa\x90\x71\xa7\xcb\x6d\ +\xa0\xd7\x64\xc8\x91\x06\xe6\x79\x14\xdc\x77\x4c\xdb\x02\xc0\x26\ +\x8a\x85\x37\x42\x0d\x7a\x98\xc2\xee\xf7\xb0\x33\x04\x79\x5e\x8a\ +\x64\xc0\xe3\x05\x96\x18\xa3\xc2\x04\xd1\xb8\xc0\x93\xc1\x02\x71\ +\x1c\xd6\x4c\x3c\xdf\x7d\xf7\x7c\xba\x82\xb3\x7a\x25\xd8\xb8\xd3\ +\x74\x8c\x92\x34\xf1\xb0\xb3\xc4\x0f\x55\x2c\x58\x31\xce\x77\x80\ +\xae\x57\xb0\xc7\x86\x31\x13\x3f\x16\xeb\x38\xab\xbe\xa9\x5c\x20\ +\x89\x05\xa8\xa7\x1b\x0f\x48\x62\x90\x3b\x2f\xeb\x9e\x88\xfd\xa5\ +\x8b\x40\x7c\xe6\xb0\xb3\xac\x2f\x06\x27\xd8\x95\xab\xa4\x85\xf9\ +\xb6\xfa\x61\x04\x60\x2a\x45\x75\x48\x62\xf0\x4e\x3e\xba\xe2\x51\ +\xf5\x64\xab\xc6\x0a\x9f\x67\xa1\x03\xa0\x3a\x70\x85\x77\xa4\xe7\ +\xda\xd5\x94\x3e\xc9\x3f\xbb\xad\x9e\x8d\xbe\xab\x3b\xb0\xb5\x17\ +\x98\x2e\x24\xdd\xa6\x45\xa9\x7e\x8e\x7a\xae\x99\x32\xdd\x4c\x59\ +\x6c\xc7\x32\x30\x65\xb4\xd1\xfe\x74\xc3\x1a\x01\x20\x9d\x00\xeb\ +\xdb\x3b\x3c\xff\xb0\x5b\x77\xb3\x5d\xd6\xe3\x31\x06\x95\xe8\x38\ +\x5f\xdd\xdd\x4a\x6c\x4c\xe7\x37\x28\x4f\x60\x13\x58\xab\xd9\x5a\ +\x32\xe4\xac\xea\x3e\x86\x9d\x65\xbd\x3e\x89\xa5\x6d\xb8\x8c\xa8\ +\x66\x6b\xa1\x9b\xf9\x73\xa1\xaf\x1b\x96\xe6\xff\x43\x7a\xba\xdc\ +\x66\x98\x06\xeb\x5a\x27\x33\xd9\xb1\x4a\x37\x42\x0f\xab\xbd\x1f\ +\x82\x7e\x47\x00\x75\x75\x6f\xe7\x8f\xa5\x64\x77\x0a\x35\xeb\xe6\ +\x7c\xa8\xc6\x12\x3f\xe0\x6a\xc0\xc3\x04\x5c\x93\x1b\x8c\x33\xa6\ +\xee\x7d\xce\xda\xc7\x74\xb1\xe4\xdf\x55\xd5\xe3\x6d\x81\x91\x43\ +\x2e\xb7\xdc\x2f\xf7\x0a\x43\xb9\xeb\x4d\x8d\xf2\x05\x96\x5c\x37\ +\xa7\x76\xea\xa7\x7e\x77\x6a\xdf\x09\x7e\x81\xa8\x13\xaf\x7a\x6e\ +\x80\xb3\x51\x84\xce\xa0\x07\xcb\xbe\xc4\xf5\xba\x10\x59\x6c\x6f\ +\xe6\x7d\x9c\x3b\x1e\x36\x93\xb5\x48\x8e\x9f\xbb\x7d\x5c\x2f\x2a\ +\x91\x14\x0f\x00\x61\x3f\x93\x99\x78\xd8\x59\x0a\x56\x15\x60\x66\ +\x8c\x8b\x38\x91\xb6\x91\xc0\x1e\x75\x85\xac\x48\xfc\x58\x68\x5d\ +\xa1\x79\xe3\x64\xef\x7f\x54\x23\xb2\xdc\x66\x62\xbb\xd3\x9e\x8d\ +\xe5\x2a\x11\x7a\x58\x5d\x28\x4b\x0d\x80\x68\x41\x35\x2d\x2d\x94\ +\xc5\x7b\x6d\x29\xd2\xa1\x72\x1d\xdd\x49\xe4\x27\xf3\x10\xe0\x38\ +\x33\xf2\x7e\x0d\xa6\x6d\x0f\x75\x83\xd7\x7d\x66\xdb\x76\x1f\xb3\ +\x88\x64\xf8\x06\x98\xdc\x73\x91\xfb\x25\xfc\xdc\xde\x63\xe4\xa1\ +\xfb\xc9\x9e\xf1\xa6\x16\x26\x70\x03\xd8\x14\x45\xa4\xa1\x3c\x6e\ +\xee\xe1\xee\xee\x1a\x5b\x44\x78\x38\xaa\x5b\x53\x3d\xe8\xd6\xb9\ +\x13\xe3\xe5\x5b\x3c\xe8\x7c\x03\xb8\x97\x75\xd4\xae\x09\x74\x6c\ +\xc7\xff\xb7\xb7\x4f\x92\x13\x41\x79\x02\xdb\x8a\xba\x98\x6e\x3c\ +\xc4\x79\xb2\x0f\xe6\x38\x01\xbd\x2f\x69\x60\x0e\x76\x26\x2b\x88\ +\xd5\x25\x0d\xdd\x6c\xab\xfa\x9e\xd5\x85\x1b\x8f\xdb\xec\x7a\xcf\ +\x23\x41\x57\x31\x01\x95\x06\x25\x72\x0d\x4c\x2c\xbc\x45\xf4\xd1\ +\x27\x98\x37\x0d\x51\x83\x15\x6d\xfd\x21\xda\xc0\xac\xbb\x05\x9b\ +\x52\x37\x75\xb9\x16\x6d\x6e\xbc\x63\xbd\x18\x5a\x49\x51\x05\x70\ +\xcb\x99\x30\xe6\x72\x7f\xe7\xbe\xb3\x82\x54\x7c\x9f\x2c\x2d\x31\ +\x99\x4d\x8c\x95\xd3\x04\x4c\x7a\xce\xbd\x32\xfc\x58\xf1\xc1\xf0\ +\x94\x3b\x31\x72\x00\x7f\xd8\x83\x1f\x37\xc7\xaa\x61\xe2\xeb\xcd\ +\x4f\x10\x14\x57\x52\xd8\x79\xd3\x74\x42\x27\xfd\x4c\x72\xd1\xcd\ +\x57\x75\x16\x1b\x81\x31\xf1\x63\x09\x98\x56\xd4\x05\x92\x58\x0b\ +\x56\xf1\x3e\x03\x28\x67\x65\x6e\x1c\x56\xb3\xb5\xb4\x6f\xba\x10\ +\x54\xc6\xa6\xf5\x81\xdf\xc3\x8b\xcd\x4f\x91\x5e\xbd\x14\x09\xd5\ +\xf4\xe3\x79\x13\x14\x6a\x88\x4d\xae\x35\xce\xc2\x6a\x05\xf2\x31\ +\x27\x5f\x95\x13\x3a\xad\xa9\xb2\x3a\x4f\xb9\x34\x4d\x33\x32\x25\ +\xfb\xa8\x6c\x7b\xc8\x07\x7c\x28\xa0\xa2\x3e\xaa\x1d\x83\xd4\x8b\ +\x64\x13\xc5\x52\xa9\x3e\x00\xb8\xe5\x0c\xcf\xce\x9f\xe0\xcf\xfe\ +\xe6\x8f\xf1\x57\x7f\xfe\xb7\x78\xf6\xd9\x97\x58\xa0\xc2\x64\x36\ +\x91\x59\xb0\x39\x2f\x9b\x66\x3a\xec\x26\x74\xb5\xd3\x92\xd4\x7e\ +\x74\x52\x0e\x45\x08\x5c\x3e\x7d\x8a\xfb\x71\x1d\x4e\x06\x80\x59\ +\xf1\x19\x46\xe3\xe7\xc8\x70\x87\xce\xa8\xdb\x64\x10\xb1\xd6\x01\ +\xf8\x0c\x1e\x4e\x51\xf8\x3d\x0c\xed\xb1\x38\xd7\x76\xe2\xc7\x12\ +\xc3\x72\x46\xad\xac\xf7\x42\x22\x70\x30\x73\xff\xb1\xca\xc2\x56\ +\xd4\x15\x4c\xfc\xc4\x2a\x60\x45\x5d\xf1\xa8\x03\x3f\xbf\x28\xaa\ +\xd9\x1a\xa9\x13\xe0\xd3\xd9\x4b\xc1\xc4\xbc\x13\x4f\x14\x47\xa2\ +\x97\x30\x67\x61\xf2\x0d\xeb\x0e\xde\xa1\x5b\xab\x89\x05\x8f\xd1\ +\xc2\xdc\xd0\x3a\xc4\xfc\x87\x7a\x4d\xa8\xdf\xe1\x50\x51\xa9\xe9\ +\xbb\xea\xa6\x37\xa9\xfb\x26\xd9\xc0\x8d\x37\x4a\x8c\xbf\xff\x78\ +\x88\xbf\xff\xbd\x2f\xf1\x77\xff\xf8\x17\xf8\xcb\x5f\xfc\x09\x7e\ +\xf6\xa7\xff\x00\xfb\x49\x2c\x7d\x26\x75\xf3\x21\x37\x58\x5c\xd5\ +\xf3\x38\xa8\x6b\xa8\xea\x37\xe6\xcf\xe9\x7c\xde\x8f\x87\xb0\x51\ +\x4f\x0a\x0d\x47\x17\xf5\x36\xc9\x7f\xe1\xf5\xb2\xbb\xbb\x58\x9a\ +\x69\xb4\x3c\xf1\x68\x89\x31\xdc\x7c\x85\x69\xb9\xcb\x66\xb3\xe3\ +\x3c\x41\xe2\xc7\xd8\x66\xd7\x20\x40\xab\x8f\xfc\x56\xcf\x19\x95\ +\x18\x94\xc0\x4b\x86\xdc\x6d\x92\xe0\xdd\xed\x18\xf3\x6c\x81\xb0\ +\xe8\xe0\xa4\x77\x82\x6a\xb6\xc6\xbb\xe7\xaf\x50\xcd\xd6\x38\xef\ +\x9f\xc1\x19\x8d\xa4\x30\x36\xff\x0c\xee\x99\xa0\x36\xaa\xd6\xc0\ +\x92\x7c\xc2\x94\x27\x51\x0e\x62\xa9\x31\xb6\xea\x4b\xd6\x25\xed\ +\x10\x00\x45\xb7\x74\xc7\x39\xe8\xb3\x35\xe9\x5c\x75\x3d\x1f\x35\ +\xdb\xa6\x5f\x0f\x31\xf1\x31\x3d\x29\xd4\x46\x31\x3c\x22\x48\x39\ +\x17\x6d\xee\x3b\x49\x62\x04\xb5\x3f\xf9\xe1\xe8\x1c\xdd\x2f\xde\ +\x62\xf4\x49\x81\x3f\xf8\xf2\x8f\xf0\xf3\x5f\x7c\x81\xcb\x67\x7f\ +\x2d\xa2\x98\xab\x22\xdb\xeb\x16\x9a\x58\x95\x54\xa1\x4c\x2c\xad\ +\x66\xaf\xd1\x7a\xf2\x04\x95\xf8\xac\x66\xe0\xef\xd6\x78\xbb\x75\ +\x45\x7f\x35\xee\x52\xe5\x7e\x66\x11\x17\xa8\x0a\x8c\xec\x4a\xcc\ +\xb1\x73\x09\xa8\x63\xc3\x8f\x13\xc6\x9a\x06\xe0\xdb\xec\x1a\x56\ +\x1c\x23\x9e\x25\xb8\xad\x96\x38\x8b\x81\x69\x00\xfc\xe7\x2f\x57\ +\xf8\xfa\xdf\xfe\x19\x0f\x1e\xd4\xc2\xbd\x73\xd1\xc3\xe6\xdd\xae\ +\x3d\xe7\xa3\x1f\x79\xf8\xf4\x93\x3a\x09\xda\x7d\x10\xe3\xd3\xfe\ +\x39\x42\xab\x40\x1a\x75\x11\xbb\x8a\x5f\xd3\x09\x81\x0a\xda\x06\ +\x28\xa9\xd5\x83\x3d\x7f\x2f\xaa\x39\x26\xdb\x9d\xe1\xc7\xa7\x27\ +\x1d\x0a\x39\x93\x9c\xd0\x59\xfc\xe4\x3e\x53\xf7\x43\xfb\x56\xd7\ +\x07\x56\x86\x12\x83\xdf\xc9\xe8\x52\x0d\xa4\x43\xcf\x79\xe4\x8f\ +\x86\xb5\x8b\x01\x39\xa0\xca\x8a\x8d\xf4\x7b\xd5\x32\x25\x71\x9c\ +\xb3\x3e\x86\x91\x05\x7f\xd8\x03\x3e\x3c\x83\x5b\x14\xf0\x56\x2f\ +\xf0\xfd\xd5\x02\xb8\xfd\x55\x3d\x30\xb3\xf9\xcd\xab\x22\x03\x16\ +\x01\x3a\x00\xd0\x54\x6d\x6c\x8a\x15\x62\x58\x02\xcc\x71\xb1\xaa\ +\x47\x7e\x35\xc6\x17\xc9\x82\x78\x66\xc3\x19\x45\x78\xd0\xb4\x26\ +\xeb\x3d\x39\x87\x0b\x1f\xd1\xaf\x6a\xc9\x78\xb3\xfe\x5a\x9a\x3e\ +\x1b\x57\x96\x16\x9b\x1b\x3f\x87\x9b\x03\x98\x5b\x70\xd7\xaf\x17\ +\x18\x9f\x2d\x85\x41\x35\x06\x80\x6c\x29\x1e\x01\xe0\xdd\x6d\x08\ +\xf7\xcc\xf0\xde\xb7\x5b\xb8\xcd\xff\xdf\x26\x09\xbe\xbf\xba\xc2\ +\xbf\xfe\xcb\x3f\xc9\x9f\x78\x0d\x54\xa7\x7d\x5c\x6c\x17\x58\x2f\ +\x6f\xf0\xdd\x04\xf8\xee\xb7\xff\x2e\xde\xfe\xf1\xb3\xc7\x78\xfa\ +\xf9\x1f\xe2\xfe\xc3\x07\x58\x84\x13\x49\x73\xf6\xc3\x11\x46\x0d\ +\x4e\x46\xb6\x27\x98\x38\x5d\xf4\x10\x56\x2b\xc0\x89\x30\x99\x5a\ +\x70\x06\x89\x18\x0d\xe9\xe6\x1e\x0a\xec\x2a\x2c\x3e\x66\x0c\x80\ +\xae\x2f\x9a\xee\x42\xe0\x51\x32\xbe\xaf\xf2\x40\x5b\x2b\xb3\xc6\ +\xcd\x8c\xc6\x5c\x5b\x11\x29\x00\x9c\xc6\x31\x12\xab\xc2\x69\x15\ +\x8b\xdb\xfc\xc6\x8a\x80\xb4\x10\xc0\xad\x13\x78\x02\xac\xb1\xd8\ +\xab\x50\xf6\x1c\xa7\xc9\xfa\xab\xf0\xfc\x37\x2f\x90\x4f\x57\x78\ +\xb7\x04\xae\xaf\x6f\x90\x2e\x96\x78\xff\xfd\x35\x2c\x00\xc3\xa1\ +\xdc\x44\xe5\x34\x8e\xa5\xe4\xf5\xd8\x1d\xd4\x53\x8f\x00\xc4\x8b\ +\x7a\x02\x52\xbc\x00\xb2\xd1\x9d\x28\xf8\xcc\x46\x77\x08\xfb\x11\ +\x82\xfb\x8f\x50\x7a\x17\xb8\xd7\xe9\x22\x0f\xa2\xba\x17\xdb\xb7\ +\xdf\xd4\xd2\xc4\xbd\xc4\xa6\x77\x85\x78\x01\xc0\x3d\x81\x13\xcf\ +\xf0\x70\x74\x8e\xd2\xbb\x80\x87\x53\x78\x16\x50\x34\x8c\x8c\x41\ +\x85\xff\x07\x5b\x53\xe4\xea\xf5\xd8\xe3\x94\x00\x00\x00\x00\x49\ +\x45\x4e\x44\xae\x42\x60\x82\ +""" + +qt_resource_name = b"""\ +\x00\x09\ +\x06\xa8\xaa\x74\ +\x00\x71\ +\x00\x75\x00\x6f\x00\x74\x00\x65\x00\x2e\x00\x74\x00\x78\x00\x74\ +\x00\x0a\ +\x07\x2b\x67\xc7\ +\x00\x73\ +\x00\x61\x00\x6d\x00\x70\x00\x6c\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\ +""" + +qt_resource_struct = b"""\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x00\x18\x00\x00\x00\x00\x00\x01\x00\x00\x00\x39\ +""" + +def qInitResources(): + QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + +def qCleanupResources(): + QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data) + +qInitResources() diff --git a/sources/pyside2/tests/QtCore/sample.png b/sources/pyside2/tests/QtCore/sample.png new file mode 100644 index 000000000..60450f0dc Binary files /dev/null and b/sources/pyside2/tests/QtCore/sample.png differ diff --git a/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py b/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py new file mode 100644 index 000000000..b8b7e1cac --- /dev/null +++ b/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py @@ -0,0 +1,41 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + + +class SetPropOnCtorTest(unittest.TestCase): + def testIt(self): + obj = QEventTransition(targetStates = [QState()]) + self.assertEqual(len(obj.targetStates()), 1); + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/staticMetaObject_test.py b/sources/pyside2/tests/QtCore/staticMetaObject_test.py new file mode 100644 index 000000000..88e87f1bb --- /dev/null +++ b/sources/pyside2/tests/QtCore/staticMetaObject_test.py @@ -0,0 +1,51 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, Slot, QMetaObject + +class MyObject(QObject): + @Slot(int, str) + def slot1(self, a, b): + pass + +class testAttribute(unittest.TestCase): + def testBug896(self): + mo = MyObject.staticMetaObject + self.assertTrue(isinstance(mo, QMetaObject)) + self.assertEqual(mo.className(), 'MyObject') + self.assertTrue(mo.indexOfSlot('slot1(int,QString)') > -1) + + def testDuplicateSlot(self): + mo = MyObject.staticMetaObject + self.assertEqual(mo.indexOfSignal('destroyed(void)'), -1) + self.assertTrue(mo.indexOfSignal('destroyed()') > -1) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/static_method_test.py b/sources/pyside2/tests/QtCore/static_method_test.py new file mode 100644 index 000000000..736feaea4 --- /dev/null +++ b/sources/pyside2/tests/QtCore/static_method_test.py @@ -0,0 +1,84 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for overloads involving static and non-static versions of a method.''' + +import os +import unittest + +from PySide2.QtCore import QFile + +class StaticNonStaticMethodsTest(unittest.TestCase): + '''Test cases for overloads involving static and non-static versions of a method.''' + + def setUp(self): + filename = 'somefile%d.txt' % os.getpid() + self.existing_filename = os.path.join(os.path.curdir, filename) + self.delete_file = False + if not os.path.exists(self.existing_filename): + f = open(self.existing_filename, 'w') + for line in range(10): + f.write('sbrubbles\n') + f.close() + self.delete_file = True + + self.non_existing_filename = os.path.join(os.path.curdir, 'inexistingfile.txt') + i = 0 + while os.path.exists(self.non_existing_filename): + i += 1 + filename = 'inexistingfile-%d.txt' % i + self.non_existing_filename = os.path.join(os.path.curdir, filename) + + def tearDown(self): + if self.delete_file: + os.remove(self.existing_filename) + + def testCallingStaticMethodWithClass(self): + '''Call static method using class.''' + self.assertTrue(QFile.exists(self.existing_filename)) + self.assertFalse(QFile.exists(self.non_existing_filename)) + + def testCallingStaticMethodWithInstance(self): + '''Call static method using instance of class.''' + f = QFile(self.non_existing_filename) + self.assertTrue(f.exists(self.existing_filename)) + self.assertFalse(f.exists(self.non_existing_filename)) + + def testCallingInstanceMethod(self): + '''Call instance method.''' + f1 = QFile(self.non_existing_filename) + self.assertFalse(f1.exists()) + f2 = QFile(self.existing_filename) + self.assertTrue(f2.exists()) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/static_protected_methods_test.py b/sources/pyside2/tests/QtCore/static_protected_methods_test.py new file mode 100644 index 000000000..c6339b1fe --- /dev/null +++ b/sources/pyside2/tests/QtCore/static_protected_methods_test.py @@ -0,0 +1,59 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for static protected methods''' + +import unittest, time + +from PySide2.QtCore import QThread + +class Test (QThread): + def run(self): + start = time.time() + self.sleep(1) + self.time_elapsed = time.time() - start + +class QStaticProtectedCall(unittest.TestCase): + '''Test case for static protected method call''' + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPathSeparator(self): + thread = Test() + thread.start() + self.assertTrue(thread.wait(2000)) + self.assertTrue(thread.time_elapsed <= 1.1) # tolarance of 100ms + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/thread_signals_test.py b/sources/pyside2/tests/QtCore/thread_signals_test.py new file mode 100644 index 000000000..351c6f5d7 --- /dev/null +++ b/sources/pyside2/tests/QtCore/thread_signals_test.py @@ -0,0 +1,61 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test case for QObject.signalsBlocked() and blockSignal()''' + +import unittest +import os +from tempfile import mkstemp + +from PySide2.QtCore import QObject, SIGNAL, QFile, QThread, QTimer, Qt +from helper import UsesQCoreApplication + +class MyThread(QThread): + + def run(self): + self.emit(SIGNAL("test(const QString&)"), "INdT - PySide"); + +class TestThreadSignal(UsesQCoreApplication): + + __called__ = True + def _callback(self, msg): + self.assertEqual(msg, "INdT - PySide") + self.__called__ = True + self.app.quit() + + def testThread(self): + t = MyThread() + QObject.connect(t, SIGNAL("test(const QString&)"), self._callback); + t.start() + + self.app.exec_() + t.wait() + self.assertTrue(self.__called__); + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/tr_noop_test.py b/sources/pyside2/tests/QtCore/tr_noop_test.py new file mode 100644 index 000000000..6c37cfe23 --- /dev/null +++ b/sources/pyside2/tests/QtCore/tr_noop_test.py @@ -0,0 +1,76 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import sys +from PySide2.QtCore import QT_TR_NOOP, QT_TR_NOOP_UTF8 +from PySide2.QtCore import QT_TRANSLATE_NOOP, QT_TRANSLATE_NOOP3, QT_TRANSLATE_NOOP_UTF8 + +class QtTrNoopTest(unittest.TestCase): + + def setUp(self): + self.txt = 'Cthulhu fhtag!' + + def tearDown(self): + del self.txt + + def testQtTrNoop(self): + refcnt = sys.getrefcount(self.txt) + result = QT_TR_NOOP(self.txt) + self.assertEqual(result, self.txt) + self.assertEqual(sys.getrefcount(result), refcnt + 1) + + def testQtTrNoopUtf8(self): + refcnt = sys.getrefcount(self.txt) + result = QT_TR_NOOP_UTF8(self.txt) + self.assertEqual(result, self.txt) + self.assertEqual(sys.getrefcount(result), refcnt + 1) + + def testQtTranslateNoop(self): + refcnt = sys.getrefcount(self.txt) + result = QT_TRANSLATE_NOOP(None, self.txt) + self.assertEqual(result, self.txt) + self.assertEqual(sys.getrefcount(result), refcnt + 1) + + def testQtTranslateNoopUtf8(self): + refcnt = sys.getrefcount(self.txt) + result = QT_TRANSLATE_NOOP_UTF8(self.txt) + self.assertEqual(result, self.txt) + self.assertEqual(sys.getrefcount(result), refcnt + 1) + + def testQtTranslateNoop3(self): + refcnt = sys.getrefcount(self.txt) + result = QT_TRANSLATE_NOOP3(None, self.txt, None) + self.assertEqual(result, self.txt) + self.assertEqual(sys.getrefcount(result), refcnt + 1) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/translation_test.py b/sources/pyside2/tests/QtCore/translation_test.py new file mode 100644 index 000000000..338571271 --- /dev/null +++ b/sources/pyside2/tests/QtCore/translation_test.py @@ -0,0 +1,85 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests to test QTranslator and translation in general.''' + +import os +import unittest +import py3kcompat as py3k +from PySide2.QtCore import QObject, QTranslator, QCoreApplication + +from helper import UsesQCoreApplication + +class TranslationTest(UsesQCoreApplication): + '''Test case for Qt translation facilities.''' + + def setUp(self): + super(TranslationTest, self).setUp() + self.trdir = os.path.join(os.path.dirname(__file__), 'translations') + + def testLatin(self): + #Set string value to Latin + translator = QTranslator() + translator.load(os.path.join(self.trdir, 'trans_latin.qm')) + self.app.installTranslator(translator) + + obj = QObject() + obj.setObjectName(obj.tr('Hello World!')) + self.assertEqual(obj.objectName(), py3k.unicode_('Orbis, te saluto!')) + + def testRussian(self): + #Set string value to Russian + translator = QTranslator() + translator.load(os.path.join(self.trdir, 'trans_russian.qm')) + self.app.installTranslator(translator) + + obj = QObject() + obj.setObjectName(obj.tr('Hello World!')) + self.assertEqual(obj.objectName(), py3k.unicode_('привет мир!')) + + def testUtf8(self): + translator = QTranslator() + translator.load(os.path.join(self.trdir, 'trans_russian.qm')) + self.app.installTranslator(translator) + + obj = QObject() + obj.setObjectName(obj.tr('Hello World!')) + self.assertEqual(obj.objectName(), py3k.unicode_('привет мир!')) + + def testTranslateWithNoneDisambiguation(self): + value = 'String here' + obj = QCoreApplication.translate('context', value, None) + self.assertTrue(isinstance(obj, py3k.unicode)) + self.assertEqual(obj, value) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/translations/trans_latin.qm b/sources/pyside2/tests/QtCore/translations/trans_latin.qm new file mode 100644 index 000000000..efdbee8c7 Binary files /dev/null and b/sources/pyside2/tests/QtCore/translations/trans_latin.qm differ diff --git a/sources/pyside2/tests/QtCore/translations/trans_latin.ts b/sources/pyside2/tests/QtCore/translations/trans_latin.ts new file mode 100644 index 000000000..b9fcf41be --- /dev/null +++ b/sources/pyside2/tests/QtCore/translations/trans_latin.ts @@ -0,0 +1,11 @@ + + + + + QObject + + Hello World! + Orbis, te saluto! + + + diff --git a/sources/pyside2/tests/QtCore/translations/trans_russian.qm b/sources/pyside2/tests/QtCore/translations/trans_russian.qm new file mode 100644 index 000000000..5f16552a7 Binary files /dev/null and b/sources/pyside2/tests/QtCore/translations/trans_russian.qm differ diff --git a/sources/pyside2/tests/QtCore/translations/trans_russian.ts b/sources/pyside2/tests/QtCore/translations/trans_russian.ts new file mode 100644 index 000000000..d1ba49bd2 --- /dev/null +++ b/sources/pyside2/tests/QtCore/translations/trans_russian.ts @@ -0,0 +1,11 @@ + + + + + QObject + + Hello World! + привет мир! + + + diff --git a/sources/pyside2/tests/QtCore/unaryoperator_test.py b/sources/pyside2/tests/QtCore/unaryoperator_test.py new file mode 100644 index 000000000..7e9897b7f --- /dev/null +++ b/sources/pyside2/tests/QtCore/unaryoperator_test.py @@ -0,0 +1,67 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Tests the presence of unary operator __neg__ on the QPoint class''' + +import unittest + +from PySide2.QtCore import QPoint + +class NegUnaryOperatorTest(unittest.TestCase): + '''Tests the presence of unary operator __neg__ on the QPoint class''' + + def setUp(self): + #Acquire resources + self.x, self.y = 10, 20 + self.neg_x, self.neg_y = -self.x, -self.y + self.qpoint = QPoint(self.x, self.y) + + def tearDown(self): + #Release resources + del self.qpoint + del self.x + del self.y + del self.neg_x + del self.neg_y + + def testNegUnaryOperator(self): + #Test __neg__ unary operator on QPoint class + __neg__method_exists = True + try: + neg_qpoint = -self.qpoint + except: + __neg__method_exists = False + + self.assertTrue(__neg__method_exists) + self.assertEqual(self.qpoint, -neg_qpoint) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/unicode_test.py b/sources/pyside2/tests/QtCore/unicode_test.py new file mode 100644 index 000000000..bf431c918 --- /dev/null +++ b/sources/pyside2/tests/QtCore/unicode_test.py @@ -0,0 +1,62 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QString conversion to/from Python Unicode''' + +import unittest +import py3kcompat as py3k + +from PySide2.QtCore import QObject + +class UnicodeConversion(unittest.TestCase): + '''Test case for QString to/from Python Unicode conversion''' + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSetRegularStringRetrieveUnicode(self): + #Set regular Python string retrieve unicode + obj = QObject() + obj.setObjectName('test') + self.assertEqual(obj.objectName(), py3k.unicode_('test')) + + def testSetUnicodeRetrieveUnicode(self): + #Set Python unicode string and retrieve unicode + obj = QObject() + obj.setObjectName(py3k.unicode_('ümlaut')) + self.assertEqual(obj.objectName(), py3k.unicode_('ümlaut')) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtCore/versioninfo_test.py b/sources/pyside2/tests/QtCore/versioninfo_test.py new file mode 100644 index 000000000..47e90bab1 --- /dev/null +++ b/sources/pyside2/tests/QtCore/versioninfo_test.py @@ -0,0 +1,48 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import PySide2 + +class TestVersionInfo(unittest.TestCase): + def testIt(self): + + v = PySide2.__version_info__ + self.assertEqual(type(v), tuple) + self.assertEqual(len(v), 5) + self.assertEqual(type(v[0]), int) + self.assertEqual(type(v[1]), int) + self.assertEqual(type(v[2]), int) + self.assertEqual(type(v[3]), str) + self.assertEqual(type(v[4]), int) + + self.assertEqual(type(PySide2.__version__), str) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtDesigner/CMakeLists.txt b/sources/pyside2/tests/QtDesigner/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtDesigner/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtDesigner/this_module_loads_test.py b/sources/pyside2/tests/QtDesigner/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtDesigner/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtGui/CMakeLists.txt b/sources/pyside2/tests/QtGui/CMakeLists.txt new file mode 100644 index 000000000..63cf3c35f --- /dev/null +++ b/sources/pyside2/tests/QtGui/CMakeLists.txt @@ -0,0 +1,47 @@ +#Keep this in alphabetical sort + +PYSIDE_TEST(bug_300_test.py) +PYSIDE_TEST(bug_367.py) +PYSIDE_TEST(bug_480.py) +PYSIDE_TEST(bug_500.py) +PYSIDE_TEST(bug_606.py) +PYSIDE_TEST(bug_617.py) +PYSIDE_TEST(bug_652.py) +PYSIDE_TEST(bug_660.py) +PYSIDE_TEST(bug_716.py) +PYSIDE_TEST(bug_740.py) +PYSIDE_TEST(bug_743.py) +PYSIDE_TEST(bug_991.py) +PYSIDE_TEST(bug_1091.py) +PYSIDE_TEST(bug_PYSIDE-41.py) +PYSIDE_TEST(bug_PYSIDE-344.py) +PYSIDE_TEST(deepcopy_test.py) +PYSIDE_TEST(float_to_int_implicit_conversion_test.py) +PYSIDE_TEST(pyside_reload_test.py) +PYSIDE_TEST(qcolor_test.py) +PYSIDE_TEST(qcolor_reduce_test.py) +PYSIDE_TEST(qcursor_test.py) +PYSIDE_TEST(qdatastream_gui_operators_test.py) +PYSIDE_TEST(qdesktopservices_test.py) +PYSIDE_TEST(qfontmetrics_test.py) +PYSIDE_TEST(qicon_test.py) +PYSIDE_TEST(qitemselection_test.py) +PYSIDE_TEST(qmatrix_test.py) +PYSIDE_TEST(qopenglbuffer_test.py) +PYSIDE_TEST(qpainter_test.py) +PYSIDE_TEST(qpdfwriter_test.py) +PYSIDE_TEST(qpixelformat_test.py) +PYSIDE_TEST(qpixmap_test.py) +PYSIDE_TEST(qpixmapcache_test.py) +PYSIDE_TEST(qpolygonf_test.py) +PYSIDE_TEST(qkeysequence_test.py) +PYSIDE_TEST(qradialgradient_test.py) +PYSIDE_TEST(qrasterwindow_test.py) +PYSIDE_TEST(qregion_test.py) +PYSIDE_TEST(qstylehints_test.py) +PYSIDE_TEST(qtextdocument_undoredo_test.py) +PYSIDE_TEST(qtextdocumentwriter_test.py) +PYSIDE_TEST(qtextline_test.py) +PYSIDE_TEST(qtransform_test.py) +PYSIDE_TEST(repr_test.py) +PYSIDE_TEST(timed_app_test.py) diff --git a/sources/pyside2/tests/QtGui/bug_1091.py b/sources/pyside2/tests/QtGui/bug_1091.py new file mode 100644 index 000000000..4fbdfe89f --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_1091.py @@ -0,0 +1,40 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' unit test for BUG #1091 ''' + +import unittest +from PySide2 import QtGui + +class QPainterTestCase(unittest.TestCase): + def testIt(self): + self.assertTrue("PixmapFragment" in dir(QtGui.QPainter)) + self.assertTrue("drawPixmapFragments" in dir(QtGui.QPainter)) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_300_test.py b/sources/pyside2/tests/QtGui/bug_300_test.py new file mode 100644 index 000000000..1ab71569a --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_300_test.py @@ -0,0 +1,45 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtGui import QStringListModel +from PySide2.QtCore import QModelIndex +import unittest + +class TestQAbstractItemModelSignals(unittest.TestCase): + def sigCallback(self, index, r, c): + self._called = True + + def testSignals(self): + self._called = False + m = QStringListModel() + m.rowsAboutToBeInserted[QModelIndex,int,int].connect(self.sigCallback) + m.insertRows(0, 3) + self.assertTrue(self._called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_367.py b/sources/pyside2/tests/QtGui/bug_367.py new file mode 100644 index 000000000..375412b95 --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_367.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 367: http://bugs.openbossa.org/show_bug.cgi?id=367''' + +import sys +import unittest +from helper import UsesQApplication +from PySide2 import QtCore,QtGui + +class BugTest(UsesQApplication): + def testCase(self): + model = QtGui.QStandardItemModel() + parentItem = model.invisibleRootItem() + for i in range(10): + item = QtGui.QStandardItem() + rcount = sys.getrefcount(item) + parentItem.appendRow(item) + self.assertEqual(rcount+1, sys.getrefcount(item)) + parentItem = item + + self.assertTrue(True) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_480.py b/sources/pyside2/tests/QtGui/bug_480.py new file mode 100644 index 000000000..75524841f --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_480.py @@ -0,0 +1,53 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2 import QtWidgets + +class BuggyWidget(QtWidgets.QWidget): + def setup(self): + self.verticalLayout = QtWidgets.QVBoxLayout(self) + self.gridLayout = QtWidgets.QGridLayout() + self.lbl = QtWidgets.QLabel(self) + self.gridLayout.addWidget(self.lbl, 0, 1, 1, 1) + + # this cause a segfault during the ownership transfer + self.verticalLayout.addLayout(self.gridLayout) + +class LayoutTransferOwnerShip(unittest.TestCase): + def testBug(self): + app = QtWidgets.QApplication([]) + w = BuggyWidget() + w.setup() + w.show() + self.assertTrue(True) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/bug_500.py b/sources/pyside2/tests/QtGui/bug_500.py new file mode 100644 index 000000000..b6f941633 --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_500.py @@ -0,0 +1,43 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import * +from PySide2.QtPrintSupport import * +from helper import UsesQApplication + +class NeverDiesTest(UsesQApplication): + + def testIt(self): + QPrintDialog() + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_606.py b/sources/pyside2/tests/QtGui/bug_606.py new file mode 100644 index 000000000..99dc6e95d --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_606.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import PySide2 +from PySide2.QtGui import QVector2D, QVector3D, QVector4D +from PySide2.QtGui import QColor + +class testCases(unittest.TestCase): + def testQVector2DToTuple(self): + vec = QVector2D(1, 2) + self.assertEqual((1, 2), vec.toTuple()) + + def testQVector3DToTuple(self): + vec = QVector3D(1, 2, 3) + self.assertEqual((1, 2, 3), vec.toTuple()) + + def testQVector4DToTuple(self): + vec = QVector4D(1, 2, 3, 4) + self.assertEqual((1, 2, 3, 4), vec.toTuple()) + + def testQColorToTuple(self): + c = QColor(0, 0, 255) + c.setRgb(1, 2, 3) + self.assertEqual((1, 2, 3, 255), c.toTuple()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_617.py b/sources/pyside2/tests/QtGui/bug_617.py new file mode 100644 index 000000000..35239ef46 --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_617.py @@ -0,0 +1,49 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import QEvent +from PySide2.QtGui import QColor +import unittest + +class MyEvent(QEvent): + def __init__(self): + QEvent.__init__(self, QEvent.Type(999)) + + +class Bug617(unittest.TestCase): + def testRepr(self): + c = QColor.fromRgb(1, 2, 3, 4) + s = c.spec() + self.assertEqual(repr(s), repr(QColor.Rgb)) + + def testOutOfBounds(self): + e = MyEvent() + self.assertEqual(repr(e.type()), 'PySide2.QtCore.QEvent.Type(999)') + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_652.py b/sources/pyside2/tests/QtGui/bug_652.py new file mode 100644 index 000000000..4f7089659 --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_652.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtGui import * + +class MyData(QTextBlockUserData): + def __init__(self, data): + QTextBlockUserData.__init__(self) + self.data = data + + def getMyNiceData(self): + return self.data + +class TestBug652(unittest.TestCase): + """Segfault when using QTextBlock::setUserData due to missing ownership transfer""" + def testIt(self): + td = QTextDocument() + tc = QTextCursor(td) + tc.insertText("Hello world") + heyHo = "hey ho!" + tc.block().setUserData(MyData(heyHo)) + self.assertEqual(type(tc.block().userData()), MyData) + self.assertEqual(tc.block().userData().getMyNiceData(), heyHo) + + del tc + tc = QTextCursor(td) + blk = tc.block() + self.assertEqual(type(blk.userData()), MyData) + self.assertEqual(blk.userData().getMyNiceData(), heyHo) + +if __name__ == "__main__": + unittest.main() \ No newline at end of file diff --git a/sources/pyside2/tests/QtGui/bug_660.py b/sources/pyside2/tests/QtGui/bug_660.py new file mode 100644 index 000000000..5dbb9e4e9 --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_660.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import py3kcompat as py3k +from PySide2.QtGui import QStandardItemModel, QStandardItem + +class MyItemModel(QStandardItemModel): + def __init__(self,parent=None): + super(MyItemModel,self).__init__(parent) + self.appendRow([QStandardItem('Item 1'),]) + + def mimeTypes(self): + mtypes = super(MyItemModel,self).mimeTypes() + mtypes.append(py3k.unicode_('application/my-form')) + return mtypes + + def mimeData(self,indexes): + self.__mimedata = super(MyItemModel,self).mimeData(indexes) + self.__mimedata.setData(py3k.unicode_('application/my-form'), 'hi') + return self.__mimedata + +class TestBug660(unittest.TestCase): + '''QMimeData type deleted prematurely when overriding mime-type in QStandardItemModel drag and drop''' + def testIt(self): + model = MyItemModel() + model.mimeData([model.index(0, 0)]) # if it doesn't raise an exception it's all right! + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_716.py b/sources/pyside2/tests/QtGui/bug_716.py new file mode 100644 index 000000000..49a329bc2 --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_716.py @@ -0,0 +1,37 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import Qt, QPersistentModelIndex +from PySide2.QtGui import QStringListModel + +if __name__ == '__main__': + stringListModel = QStringListModel(['one', 'two']) + idx = stringListModel.index(1, 0) + persistentModelIndex = QPersistentModelIndex(idx) + stringListModel.data(persistentModelIndex, Qt.DisplayRole) + diff --git a/sources/pyside2/tests/QtGui/bug_740.py b/sources/pyside2/tests/QtGui/bug_740.py new file mode 100644 index 000000000..a77abc118 --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_740.py @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import py3kcompat as py3k +from helper import UsesQApplication +from PySide2.QtCore import QSize +from PySide2.QtGui import QBitmap, QImage + +class TestQBitmap(UsesQApplication): + def testFromDataMethod(self): + dataBits = py3k.b('\x38\x28\x38\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\xfe\xfe\x7c\x7c\x38\x38\x10\x10') + bim = QBitmap.fromData(QSize(8, 48), dataBits, QImage.Format_Mono) # missing function + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_743.py b/sources/pyside2/tests/QtGui/bug_743.py new file mode 100644 index 000000000..d2339921f --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_743.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QMatrix4x4 + +class TestQMatrix(unittest.TestCase): + def testOperator(self): + m = QMatrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) + v = 1 + for x in range(4): + for y in range(4): + self.assertEqual(m[x,y], v) + v += 1 + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/bug_991.py b/sources/pyside2/tests/QtGui/bug_991.py new file mode 100644 index 000000000..034efb350 --- /dev/null +++ b/sources/pyside2/tests/QtGui/bug_991.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject +from PySide2.QtGui import QPen, QBrush + +class TestBug991 (unittest.TestCase): + def testReprFunction(self): + reprPen = repr(QPen()) + self.assertTrue(reprPen.startswith("> QPixmap''' + + def setUp(self): + super(QPixmapQDatastream, self).setUp() + self.source_pixmap = QPixmap(100, 100) + self.source_pixmap.fill(Qt.red) + self.output_pixmap = QPixmap() + self.buffer = QByteArray() + self.read_stream = QDataStream(self.buffer, QIODevice.ReadOnly) + self.write_stream = QDataStream(self.buffer, QIODevice.WriteOnly) + + def testStream(self): + self.write_stream << self.source_pixmap + + self.read_stream >> self.output_pixmap + + image = self.output_pixmap.toImage() + pixel = image.pixel(10,10) + self.assertEqual(pixel, QColor(Qt.red).rgba()) + self.assertEqual(self.source_pixmap.toImage(), self.output_pixmap.toImage()) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qdesktopservices_test.py b/sources/pyside2/tests/QtGui/qdesktopservices_test.py new file mode 100644 index 000000000..edeb32a08 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qdesktopservices_test.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QDesktopServices''' + +import unittest + +from PySide2.QtGui import QDesktopServices +from PySide2.QtCore import QUrl + +class QDesktopServicesTest(unittest.TestCase): + def testOpenUrl(self): + # At the bare minimum check that they return false for invalid url's + url = QUrl() + self.assertEqual(QDesktopServices.openUrl(url), False) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qfontmetrics_test.py b/sources/pyside2/tests/QtGui/qfontmetrics_test.py new file mode 100644 index 000000000..140fc1321 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qfontmetrics_test.py @@ -0,0 +1,226 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Tests for inject codes and modifications on QFontMetrics + and QFontMetricsF''' + +import unittest +from PySide2.QtGui import QFont, QFontMetrics, QFontMetricsF +from PySide2.QtCore import QRect, QRectF, Qt, QSize, QSizeF +from helper import UsesQApplication + + +class QFontMetricsTest(UsesQApplication): + '''Base class for QFontMetrics tests''' + + def setUp(self): + super(QFontMetricsTest, self).setUp() + self.font = QFont() + self.metrics = QFontMetrics(self.font) + + def tearDown(self): + del self.metrics + del self.font + super(QFontMetricsTest, self).tearDown() + + +class BoundingRectTest(QFontMetricsTest): + '''Tests for QFontMetrics.boundingRect inject code''' + + def testIntDefault(self): + '''QFontMetrics.boundingRect(int, int, int, int, ...) - default args''' + rect = self.metrics.boundingRect(0, 0, 0, 0, + Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT') + self.assertTrue(isinstance(rect, QRect)) + + def testIntWithArg(self): + '''QFontMetrics.boundingRect(int, int, int, int, ...) - single arg''' + rect = self.metrics.boundingRect(0, 0, 0, 0, + Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 2) + self.assertTrue(isinstance(rect, QRect)) + + def testIntWithFull(self): + '''QFontMetrics.boundingRect(int, int, int, int, ...) - all argss''' + rect = self.metrics.boundingRect(0, 0, 0, 0, + Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 20, [1, 2, 3, 4, 5]) + self.assertTrue(isinstance(rect, QRect)) + + def testIntTypeError(self): + '''QFontMetrics.boundingRect(int, int, int, int, ...) - type error''' + self.assertRaises(TypeError, self.metrics.boundingRect, 0, 0, 0, 0, + Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 20, ['aaaa', 'ase']) + + def testQRectDefault(self): + '''QFontMetrics.boundingRect(QRect, ...) - default args''' + arg = QRect(0, 0, 100, 200) + rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT') + self.assertTrue(isinstance(rect, QRect)) + + def testQRectWithArg(self): + '''QFontMetrics.boundingRect(QRect, ...) - only tabstops''' + arg = QRect(0, 0, 100, 200) + rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 2) + self.assertTrue(isinstance(rect, QRect)) + + def testQRectWithFull(self): + '''QFontMetrics.boundingRect(QRect, ...) - all arguments''' + arg = QRect(0, 0, 100, 200) + rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 20, + [1, 2, 3, 4, 5]) + self.assertTrue(isinstance(rect, QRect)) + + def testQRectTypeError(self): + '''QFontMetrics.boundingRect(QRect, ...) - type error''' + arg = QRect(0, 0, 100, 200) + self.assertRaises(TypeError, self.metrics.boundingRect, arg, + Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 20, ['aaaa', 'ase']) + + +class SizeTest(QFontMetricsTest): + '''Tests for QFontMetrics.size inject code''' + + def testDefault(self): + '''QFontMetrics.size - default arguments''' + size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine, + 'PySide by INdT') + self.assertTrue(isinstance(size, QSize)) + + def testWithTabStops(self): + '''QFontMetrics.size - only tabstops''' + size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine, + 'PySide by INdT', 2) + self.assertTrue(isinstance(size, QSize)) + + def testFull(self): + '''QFontMetrics.size - all arguments''' + size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine, + 'PySide by INdT', 2, [1, 2, 3, 4]) + self.assertTrue(isinstance(size, QSize)) + + def testTypeError(self): + '''QFontMetrics.size - type error''' + self.assertRaises(TypeError, self.metrics.size, + Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 20, ['aaaa', 'ase']) + + +class QFontMetricsFTest(UsesQApplication): + '''Base class for QFontMetrics tests''' + + def setUp(self): + super(QFontMetricsFTest, self).setUp() + self.font = QFont() + self.metrics = QFontMetricsF(self.font) + + def tearDown(self): + del self.metrics + del self.font + super(QFontMetricsFTest, self).tearDown() + + +class FBoundingRectTest(QFontMetricsFTest): + '''Tests for QFontMetricsF.boundingRect inject code''' + + def testQRectDefault(self): + '''QFontMetricsF.boundingRect(QRectF, ...) - default args''' + arg = QRectF(0, 0, 100, 200) + rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT') + self.assertTrue(isinstance(rect, QRectF)) + + def testQRectWithArg(self): + '''QFontMetricsF.boundingRect(QRectF, ...) - only tabstops''' + arg = QRectF(0, 0, 100, 200) + rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 2) + self.assertTrue(isinstance(rect, QRectF)) + + def testQRectWithFull(self): + '''QFontMetricsF.boundingRect(QRectF, ...) - all arguments''' + arg = QRectF(0, 0, 100, 200) + rect = self.metrics.boundingRect(arg, Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 20, + [1, 2, 3, 4, 5]) + self.assertTrue(isinstance(rect, QRectF)) + + def testQRectTypeError(self): + '''QFontMetricsF.boundingRect(QRectF, ...) - type error''' + arg = QRectF(0, 0, 100, 200) + self.assertRaises(TypeError, self.metrics.boundingRect, arg, + Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 20, ['aaaa', 'ase']) + + +class FSizeTest(QFontMetricsFTest): + '''Tests for QFontMetricsF.size inject code''' + + def testDefault(self): + '''QFontMetricsF.size - default arguments''' + size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine, + 'PySide by INdT') + self.assertTrue(isinstance(size, QSizeF)) + + def testWithTabStops(self): + '''QFontMetricsF.size - only tabstops''' + size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine, + 'PySide by INdT', 2) + self.assertTrue(isinstance(size, QSizeF)) + + def testFull(self): + '''QFontMetricsF.size - all arguments''' + size = self.metrics.size(Qt.TextExpandTabs | Qt.TextSingleLine, + 'PySide by INdT', 2, [1, 2, 3, 4]) + self.assertTrue(isinstance(size, QSizeF)) + + def testTypeError(self): + '''QFontMetricsF.size - type error''' + self.assertRaises(TypeError, self.metrics.size, + Qt.TextExpandTabs | Qt.AlignLeft, + 'PySide by INdT', 20, ['aaaa', 'ase']) + + +class QCharTest(QFontMetricsFTest): + + def testBoundingRect(self): + retCh = self.metrics.boundingRectChar('a') + self.assertEqual(type(retCh), QRectF) + + def testWith(self): + retCh = self.metrics.widthChar('a') + self.assertTrue(retCh > 0) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qicon_test.py b/sources/pyside2/tests/QtGui/qicon_test.py new file mode 100644 index 000000000..2a56b455c --- /dev/null +++ b/sources/pyside2/tests/QtGui/qicon_test.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import TimedQApplication +from PySide2.QtGui import QIcon + + +class QIconCtorWithNoneTest(TimedQApplication): + '''Test made by seblin, see Bug #944: http://bugs.pyside.org/show_bug.cgi?id=944''' + + def testQIconCtorWithNone(self): + icon = QIcon(None) + pixmap = icon.pixmap(48, 48) + self.app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qitemselection_test.py b/sources/pyside2/tests/QtGui/qitemselection_test.py new file mode 100644 index 000000000..d8f2ab230 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qitemselection_test.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import UsesQApplication +from PySide2.QtCore import QItemSelection +from PySide2.QtGui import QStandardItemModel + +class QItemSelectionTest(UsesQApplication): + def testLen(self): + model = QStandardItemModel(2, 2) + model.insertRow(0) + model.insertRow(1) + model.insertColumn(0) + model.insertColumn(1) + selection = QItemSelection(model.index(0,0), model.index(1,1)) + self.assertEqual(len(selection), 1) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/qkeysequence_test.py b/sources/pyside2/tests/QtGui/qkeysequence_test.py new file mode 100644 index 000000000..3e62a4632 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qkeysequence_test.py @@ -0,0 +1,48 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import Qt +from PySide2.QtGui import QKeySequence + +from helper import UsesQApplication + +class QKeySequenceTest(UsesQApplication): + + def testGetItemOperator(self): + # bug #774 + ks = QKeySequence(Qt.SHIFT, Qt.CTRL, Qt.Key_P, Qt.Key_R) + self.assertEqual(ks[0], Qt.SHIFT) + self.assertEqual(ks[1], Qt.CTRL) + self.assertEqual(ks[2], Qt.Key_P) + self.assertEqual(ks[3], Qt.Key_R) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qmatrix_test.py b/sources/pyside2/tests/QtGui/qmatrix_test.py new file mode 100644 index 000000000..944b052cc --- /dev/null +++ b/sources/pyside2/tests/QtGui/qmatrix_test.py @@ -0,0 +1,86 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QPoint +from PySide2.QtGui import QMatrix, QMatrix4x4 + + +def qpointTimesQMatrix(point, matrix): + '''As seen in "QPoint QMatrix::map(const QPoint &p) const" C++ implementation.''' + return QPoint(matrix.m11() * point.x() + matrix.m21() * point.y() + matrix.dx(), + matrix.m12() * point.x() + matrix.m22() * point.y() + matrix.dy()) + +class QMatrixTest(unittest.TestCase): + + def testMatrix(self): + matrix = QMatrix(11, 12, 21, 22, 100, 200) + point = QPoint(3, 3) + self.assertEqual(point * matrix, qpointTimesQMatrix(point, matrix)) + + def testMatrixWithWrongType(self): + matrix = QMatrix(11, 12, 21, 22, 100, 200) + point = QPoint(3, 3) + self.assertRaises(TypeError, matrix.__mul__, point) + + def testMatrix4x4(self): + self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 3.0]) + self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 'I', + 4.0, 5.0, 6.0, 7.0, + 8.0, 9.0, 'N', 11.0, + 12.0, 'd', 14.0, 'T']) + + my_data = [0.0, 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0, 7.0, + 8.0, 9.0, 10.0, 11.0, + 12.0, 13.0, 14.0, 15.0] + my_datac = [0.0, 4.0, 8.0, 12.0, + 1.0, 5.0, 9.0, 13.0, + 2.0, 6.0, 10.0, 14.0, + 3.0, 7.0, 11.0, 15.0] + + m = QMatrix4x4(my_data) + d = m.data() + self.assertTrue(my_datac, d) + + d = m.copyDataTo() + self.assertTrue(my_data == list(d)) + + def testMatrixMapping(self): + m = QMatrix(1.0, 2.0, 1.0, 3.0, 100.0, 200.0) + res = m.map(5, 5) + self.assertAlmostEqual(res[0], 5 * 1.0 + 5 * 1.0 + 100.0) + self.assertAlmostEqual(res[1], 5 * 2.0 + 5 * 3.0 + 200.0) + res = m.map(5.0, 5.0) + self.assertAlmostEqual(res[0], 5.0 * 1.0 + 5.0 * 1.0 + 100.0) + self.assertAlmostEqual(res[1], 5.0 * 2.0 + 5.0 * 3.0 + 200.0) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/qopenglbuffer_test.py b/sources/pyside2/tests/QtGui/qopenglbuffer_test.py new file mode 100644 index 000000000..cae789ac4 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qopenglbuffer_test.py @@ -0,0 +1,93 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QOpenGLBuffer''' + +import unittest +import ctypes +import sys + +from helper import UsesQApplication +from PySide2.QtGui import QOpenGLBuffer +from PySide2 import QtGui + +def createSurface(surfaceClass): + if surfaceClass == QtGui.QSurface.Window: + window = QtGui.QWindow() + window.setSurfaceType(QtGui.QWindow.OpenGLSurface) + window.setGeometry(0, 0, 10, 10) + window.create() + return window + elif surfaceClass == QtGui.QSurface.Offscreen: + # Create a window and get the format from that. For example, if an EGL + # implementation provides 565 and 888 configs for PBUFFER_BIT but only + # 888 for WINDOW_BIT, we may end up with a pbuffer surface that is + # incompatible with the context since it could choose the 565 while the + # window and the context uses a config with 888. + format = QtGui.QSurfaceFormat + if format.redBufferSize() == -1: + window = QtGui.QWindow() + window.setSurfaceType(QtGui.QWindow.OpenGLSurface) + window.setGeometry(0, 0, 10, 10) + window.create() + format = window.format() + offscreenSurface = QtGui.QOffscreenSurface() + offscreenSurface.setFormat(format) + offscreenSurface.create() + return offscreenSurface + return 0 + +class QOpenGLBuffer(UsesQApplication): + def testBufferCreate(self): + surface = createSurface(QtGui.QSurface.Window) + ctx = QtGui.QOpenGLContext() + ctx.create() + ctx.makeCurrent(surface) + + buf = QtGui.QOpenGLBuffer() + + self.assertTrue(not buf.isCreated()) + + self.assertTrue(buf.create()) + self.assertTrue(buf.isCreated()) + + self.assertEqual(buf.type(), QtGui.QOpenGLBuffer.VertexBuffer) + + buf.bind() + buf.allocate(128) + self.assertEqual(buf.size(), 128) + + buf.release() + + buf.destroy() + self.assertTrue(not buf.isCreated()) + + ctx.doneCurrent() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qpainter_test.py b/sources/pyside2/tests/QtGui/qpainter_test.py new file mode 100644 index 000000000..7cecede51 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qpainter_test.py @@ -0,0 +1,111 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QPainter, QLinearGradient +from PySide2.QtCore import QLine, QLineF, QPoint, QPointF, QRect, QRectF, Qt + +class QPainterDrawText(unittest.TestCase): + + def setUp(self): + self.painter = QPainter() + self.text = 'teste!' + + def tearDown(self): + del self.text + del self.painter + + def testDrawText(self): + # bug #254 + rect = self.painter.drawText(100, 100, 100, 100, + Qt.AlignCenter | Qt.TextWordWrap, + self.text) + self.assertTrue(isinstance(rect, QRect)) + + def testDrawTextWithRect(self): + # bug #225 + rect = QRect(100, 100, 100, 100) + newRect = self.painter.drawText(rect, Qt.AlignCenter | Qt.TextWordWrap, + self.text) + + self.assertTrue(isinstance(newRect, QRect)) + + def testDrawTextWithRectF(self): + '''QPainter.drawText(QRectF, ... ,QRectF*) inject code''' + rect = QRectF(100, 52.3, 100, 100) + newRect = self.painter.drawText(rect, Qt.AlignCenter | Qt.TextWordWrap, + self.text) + + self.assertTrue(isinstance(newRect, QRectF)) + + def testDrawOverloads(self): + '''Calls QPainter.drawLines overloads, if something is + wrong Exception and chaos ensues. Bug #395''' + self.painter.drawLines([QLine(QPoint(0,0), QPoint(1,1))]) + self.painter.drawLines([QPoint(0,0), QPoint(1,1)]) + self.painter.drawLines([QPointF(0,0), QPointF(1,1)]) + self.painter.drawLines([QLineF(QPointF(0,0), QPointF(1,1))]) + self.painter.drawPoints([QPoint(0,0), QPoint(1,1)]) + self.painter.drawPoints([QPointF(0,0), QPointF(1,1)]) + self.painter.drawConvexPolygon([QPointF(10.0, 80.0), + QPointF(20.0, 10.0), + QPointF(80.0, 30.0), + QPointF(90.0, 70.0)]) + self.painter.drawConvexPolygon([QPoint(10.0, 80.0), + QPoint(20.0, 10.0), + QPoint(80.0, 30.0), + QPoint(90.0, 70.0)]) + self.painter.drawPolygon([QPointF(10.0, 80.0), + QPointF(20.0, 10.0), + QPointF(80.0, 30.0), + QPointF(90.0, 70.0)]) + self.painter.drawPolygon([QPoint(10.0, 80.0), + QPoint(20.0, 10.0), + QPoint(80.0, 30.0), + QPoint(90.0, 70.0)]) + self.painter.drawPolyline([QPointF(10.0, 80.0), + QPointF(20.0, 10.0), + QPointF(80.0, 30.0), + QPointF(90.0, 70.0)]) + self.painter.drawPolyline([QPoint(10.0, 80.0), + QPoint(20.0, 10.0), + QPoint(80.0, 30.0), + QPoint(90.0, 70.0)]) + +class SetBrushWithOtherArgs(unittest.TestCase): + '''Using qpainter.setBrush with args other than QBrush''' + + def testSetBrushGradient(self): + painter = QPainter() + gradient = QLinearGradient(0, 0, 0, 0) + painter.setBrush(gradient) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/qpdfwriter_test.py b/sources/pyside2/tests/QtGui/qpdfwriter_test.py new file mode 100644 index 000000000..f97c85b39 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qpdfwriter_test.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from helper import UsesQApplication +from PySide2.QtGui import QPageLayout, QPageSize, QPdfWriter, QTextDocument +from PySide2.QtCore import QDir, QMarginsF, QTemporaryFile + +class QPdfWriterTest(UsesQApplication): + + def testWrite(self): + temporaryFile = QTemporaryFile(QDir.tempPath() + "/pdfwriter_test_XXXXXX.pdf") + self.assertTrue(temporaryFile.open()) + pdfWriter = QPdfWriter(temporaryFile) + pdfWriter.setPageLayout(QPageLayout(QPageSize(QPageSize.A4), QPageLayout.Portrait, QMarginsF(10, 10, 10, 10))) + doc = QTextDocument("Some text") + doc.print_(pdfWriter) + temporaryFile.close() + self.assertTrue(temporaryFile.size() > 0) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qpixelformat_test.py b/sources/pyside2/tests/QtGui/qpixelformat_test.py new file mode 100644 index 000000000..c7f14ff24 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qpixelformat_test.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit test for QPixelFormat''' + +import unittest + +from helper import UsesQApplication +from PySide2.QtCore import QSize, Qt +from PySide2.QtGui import QColor, QImage, QPixelFormat + +class QPixelFormatTest(UsesQApplication): + def test(self): + image = QImage(QSize(200, 200), QImage.Format_ARGB32) + image.fill(QColor(Qt.red)) + pixelFormat = image.pixelFormat() + print(pixelFormat.greenSize()) + self.assertEqual(pixelFormat.alphaSize(), 8) + self.assertEqual(pixelFormat.redSize(), 8) + self.assertEqual(pixelFormat.greenSize(), 8) + self.assertEqual(pixelFormat.blueSize(), 8) + self.assertEqual(pixelFormat.bitsPerPixel(), 32) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qpixmap_test.py b/sources/pyside2/tests/QtGui/qpixmap_test.py new file mode 100644 index 000000000..b637f4d13 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qpixmap_test.py @@ -0,0 +1,85 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import os +from helper import UsesQApplication +from PySide2.QtGui import * +from PySide2.QtCore import * + +class QPixmapTest(UsesQApplication): + def testQVariantConstructor(self): + obj = QObject() + pixmap = QPixmap() + obj.setProperty('foo', pixmap) + self.assertEqual(type(obj.property('foo')), QPixmap) + + def testQSizeConstructor(self): + pixmap = QPixmap(QSize(10,20)) + self.assertTrue(pixmap.size().height(), 20) + + def testQStringConstructor(self): + pixmap = QPixmap("Testing!") + + def testQPixmapLoadFromDataWithQFile(self): + f = QFile(os.path.join(os.path.dirname(__file__), 'sample.png')) + self.assertTrue(f.open(QIODevice.ReadOnly)) + data = f.read(f.size()) + f.close() + pixmap = QPixmap() + self.assertTrue(pixmap.loadFromData(data)) + + def testQPixmapLoadFromDataWithPython(self): + data = open(os.path.join(os.path.dirname(__file__),'sample.png'),'rb').read() + pixmap = QPixmap() + self.assertTrue(pixmap.loadFromData(data)) + + +class QPixmapToImage(UsesQApplication): + + def testFilledImage(self): + '''QPixmap.fill + toImage + image.pixel''' + pixmap = QPixmap(100, 200) + pixmap.fill(Qt.red) # Default Qt.white + + self.assertEqual(pixmap.height(), 200) + self.assertEqual(pixmap.width(), 100) + + image = pixmap.toImage() + + self.assertEqual(image.height(), 200) + self.assertEqual(image.width(), 100) + + pixel = image.pixel(10,10) + self.assertEqual(pixel, QColor(Qt.red).rgba()) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/qpixmapcache_test.py b/sources/pyside2/tests/QtGui/qpixmapcache_test.py new file mode 100644 index 000000000..83e26411d --- /dev/null +++ b/sources/pyside2/tests/QtGui/qpixmapcache_test.py @@ -0,0 +1,72 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from helper import UsesQApplication +from PySide2.QtGui import QPixmapCache, QPixmap + + +class QPixmapCacheTest(UsesQApplication): + + def testWithString(self): + pm1 = QPixmap() + ok = QPixmapCache.find('img', pm1) + self.assertFalse(ok) + + self.assertEqual(QPixmapCache.find('img'), None) + + pm2 = QPixmap() + ok = QPixmapCache.insert('img', pm2) + self.assertTrue(ok) + + pm3 = QPixmap() + ok = QPixmapCache.find('img', pm3) + self.assertTrue(ok) + b1 = QPixmapCache.find('img').toImage().bits() + b2 = pm3.toImage().bits() + self.assertEqual(QPixmapCache.find('img').toImage().bits(), pm3.toImage().bits()) + + def testWithKey(self): + pm1 = QPixmap() + ok = QPixmapCache.find(QPixmapCache.Key(), pm1) + self.assertFalse(ok) + + self.assertEqual(QPixmapCache.find(QPixmapCache.Key()), None) + + pm2 = QPixmap() + key = QPixmapCache.insert(pm2) + + pm3 = QPixmap() + ok = QPixmapCache.find(key, pm3) + self.assertTrue(ok) + + self.assertEqual(QPixmapCache.find(key).toImage().bits(), pm3.toImage().bits()) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/qpolygonf_test.py b/sources/pyside2/tests/QtGui/qpolygonf_test.py new file mode 100644 index 000000000..7c243b903 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qpolygonf_test.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * +from PySide2.QtGui import * + +class QPolygonFNotIterableTest(unittest.TestCase): + """Test if a QPolygonF is iterable""" + def testIt(self): + p = QPolygonF(4) + self.assertEqual(len(p), 4) + + for i in range(0, 4): + p[i] = QPointF(float(i), float(i)) + + i = 0 + for point in p: + self.assertEqual(int(point.x()), i) + self.assertEqual(int(point.y()), i) + i += 1; + + def testPolygonShiftOperators(self): + p = QPolygon() + self.assertEqual(len(p), 0) + p << QPoint(10, 20) << QPoint(20, 30) << [QPoint(20, 30), QPoint(40, 50)] + self.assertEqual(len(p), 4) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qradialgradient_test.py b/sources/pyside2/tests/QtGui/qradialgradient_test.py new file mode 100644 index 000000000..16dbf7ded --- /dev/null +++ b/sources/pyside2/tests/QtGui/qradialgradient_test.py @@ -0,0 +1,57 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QRadialGradient +from PySide2.QtCore import QPointF + +class QRadialGradientConstructor(unittest.TestCase): + def _compare(self, qptf, tpl): + self.assertEqual((qptf.x(), qptf.y()), tpl) + + def _assertValues(self, grad): + self._compare(grad.center(), (1.0, 2.0)) + self._compare(grad.focalPoint(), (3.0, 4.0)) + self.assertEqual(grad.radius(), 5.0) + + def testAllInt(self): + grad = QRadialGradient(1, 2, 5, 3, 4) + self._assertValues(grad) + + def testQPointF(self): + grad = QRadialGradient(QPointF(1, 2), 5, QPointF(3, 4)) + self._assertValues(grad) + + def testSetQPointF(self): + grad = QRadialGradient() + grad.setCenter(QPointF(1, 2)) + self._compare(grad.center(), (1.0, 2.0)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qrasterwindow_test.py b/sources/pyside2/tests/QtGui/qrasterwindow_test.py new file mode 100644 index 000000000..db756ff85 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qrasterwindow_test.py @@ -0,0 +1,86 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit test for QBackingStore, QRasterWindow and QStaticText''' + +import unittest + +from helper import UsesQApplication +from PySide2.QtCore import QEvent, QPoint, QRect, QSize, QTimer, Qt +from PySide2.QtGui import QColor, QBackingStore, QPaintDevice, QPainter, QWindow, QPaintDeviceWindow, QRasterWindow, QRegion, QStaticText + +# QWindow rendering via QBackingStore +class TestBackingStoreWindow(QWindow): + def __init__(self): + super(TestBackingStoreWindow, self).__init__() + self.backingStore = QBackingStore(self) + self.text = QStaticText("BackingStoreWindow") + + def event(self, event): + if event.type() == QEvent.Resize: + self.backingStore.resize(self.size()) + self.render() + elif event.type() == QEvent.UpdateRequest or event.type() == QEvent.Expose: + self.backingStore.flush(QRegion(QRect(QPoint(0, 0), self.size()))) + + return QWindow.event(self, event) + + def render(self): + clientRect = QRect(QPoint(0, 0), self.size()) + painter = QPainter(self.backingStore.paintDevice()) + painter.fillRect(clientRect, QColor(Qt.green)) + painter.drawStaticText(QPoint(10, 10), self.text) + +# Window using convenience class QRasterWindow +class TestRasterWindow(QRasterWindow): + def __init__(self): + super(TestRasterWindow, self).__init__() + self.text = QStaticText("QRasterWindow") + + def paintEvent(self, event): + clientRect = QRect(QPoint(0, 0), self.size()) + painter = QPainter(self) + painter.fillRect(clientRect, QColor(Qt.red)) + painter.drawStaticText(QPoint(10, 10), self.text) + +class QRasterWindowTest(UsesQApplication): + def test(self): + rasterWindow = TestRasterWindow() + rasterWindow.setFramePosition(QPoint(100, 100)) + rasterWindow.resize(QSize(400, 400)) + rasterWindow.show() + backingStoreWindow = TestBackingStoreWindow() + backingStoreWindow.setFramePosition(QPoint(600, 100)) + backingStoreWindow.resize(QSize(400, 400)) + backingStoreWindow.show() + + QTimer.singleShot(100, self.app.quit) + self.app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qregion_test.py b/sources/pyside2/tests/QtGui/qregion_test.py new file mode 100644 index 000000000..e3af650e5 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qregion_test.py @@ -0,0 +1,49 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys + +from PySide2.QtGui import QRegion +from PySide2.QtCore import QPoint +from helper import UsesQApplication + +class QRegionTest(UsesQApplication): + + def testFunctionUnit(self): + r = QRegion(0, 0, 10, 10) + r2 = QRegion(5, 5, 10, 10) + + ru = r.united(r2) + self.assertTrue(ru.contains(QPoint(0,0))) + self.assertTrue(ru.contains(QPoint(5,5))) + self.assertTrue(ru.contains(QPoint(10,10))) + self.assertTrue(ru.contains(QPoint(14,14))) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qstylehints_test.py b/sources/pyside2/tests/QtGui/qstylehints_test.py new file mode 100644 index 000000000..c3d99aa3f --- /dev/null +++ b/sources/pyside2/tests/QtGui/qstylehints_test.py @@ -0,0 +1,42 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit test for QStyleHints''' + +import unittest + +from helper import UsesQApplication +from PySide2.QtGui import QStyleHints + +class QStyleHintsTest(UsesQApplication): + def test(self): + styleHints = self.app.styleHints() + self.assertTrue(styleHints.startDragDistance() > 0) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py b/sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py new file mode 100644 index 000000000..9d237f6d4 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QTextDocument, QTextCursor + +class QTextDocumentTest(unittest.TestCase): + + def testUndoRedo(self): + text = 'foobar' + doc = QTextDocument(text) + + self.assertFalse(doc.isRedoAvailable()) + self.assertTrue(doc.isUndoAvailable()) + self.assertEqual(doc.toPlainText(), text) + + cursor = QTextCursor(doc) + doc.undo(cursor) + + self.assertTrue(doc.isRedoAvailable()) + self.assertFalse(doc.isUndoAvailable()) + self.assertEqual(doc.toPlainText(), '') + + doc.redo(cursor) + + self.assertFalse(doc.isRedoAvailable()) + self.assertTrue(doc.isUndoAvailable()) + self.assertEqual(doc.toPlainText(), text) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py b/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py new file mode 100644 index 000000000..c65d09633 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QTextDocumentWriter, QTextDocument +from PySide2.QtCore import QBuffer + +class QTextDocumentWriterTest(unittest.TestCase): + + def testWrite(self): + text = 'foobar' + doc = QTextDocument(text) + b = QBuffer() + b.open(QBuffer.ReadWrite) + writer = QTextDocumentWriter(b, "plaintext"); + writer.write(doc); + b.close() + self.assertEqual(b.buffer(), text) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/qtextline_test.py b/sources/pyside2/tests/QtGui/qtextline_test.py new file mode 100644 index 000000000..a541c6cf5 --- /dev/null +++ b/sources/pyside2/tests/QtGui/qtextline_test.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QTextLayout +from helper import UsesQApplication + +class QTextLineTest(UsesQApplication): + + def testCursorToX(self): + textLayout = QTextLayout() + textLayout.beginLayout() + line = textLayout.createLine() + self.assertTrue(line.isValid()) + x, cursorPos = line.cursorToX(0) + self.assertEqual(type(x), float) + self.assertEqual(type(cursorPos), int) + x, cursorPos = line.cursorToX(1) + self.assertEqual(type(x), float) + self.assertEqual(type(cursorPos), int) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/qtransform_test.py b/sources/pyside2/tests/QtGui/qtransform_test.py new file mode 100644 index 000000000..654484f9d --- /dev/null +++ b/sources/pyside2/tests/QtGui/qtransform_test.py @@ -0,0 +1,101 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QPointF +from PySide2.QtGui import QTransform, QPolygonF, QPolygonF + +class QTransformTest(unittest.TestCase): + + def testMap(self): + transform = QTransform() + values = (10.0, 20.0) + tx, ty = transform.map(*values) + self.assertTrue(isinstance(tx, float)) + self.assertTrue(isinstance(ty, float)) + self.assertEqual((tx, ty), values) + + def testquadToQuad(self): + q1 = QPolygonF() + q1.append(QPointF(10.0, 10.0)) + q1.append(QPointF(20.0, 10.0)) + q1.append(QPointF(10.0, -10.0)) + q1.append(QPointF(20.0, -10.0)) + + q2 = QPolygonF() + q2.append(QPointF(20.0, 20.0)) + q2.append(QPointF(30.0, 20.0)) + q2.append(QPointF(20.0, -20.0)) + q2.append(QPointF(30.0, -20.0)) + + t1 = QTransform() + r1 = QTransform.quadToQuad(q1, q2, t1) + r2 = QTransform.quadToQuad(q1, q2) + + self.assertTrue(r1) + self.assertTrue(r2) + + self.assertEqual(t1, r2) + + def testquadToSquare(self): + q1 = QPolygonF() + q1.append(QPointF(10.0, 10.0)) + q1.append(QPointF(20.0, 10.0)) + q1.append(QPointF(10.0, -10.0)) + q1.append(QPointF(20.0, -10.0)) + + t1 = QTransform() + r1 = QTransform.quadToSquare(q1, t1) + r2 = QTransform.quadToSquare(q1) + + self.assertTrue(r1) + self.assertTrue(r2) + + self.assertEqual(t1, r2) + + + def testsquareToQuad(self): + q1 = QPolygonF() + q1.append(QPointF(10.0, 10.0)) + q1.append(QPointF(20.0, 10.0)) + q1.append(QPointF(10.0, -10.0)) + q1.append(QPointF(20.0, -10.0)) + + t1 = QTransform() + r1 = QTransform.squareToQuad(q1, t1) + r2 = QTransform.squareToQuad(q1) + + self.assertTrue(r1) + self.assertTrue(r2) + + self.assertEqual(t1, r2) + + +if __name__ == "__main__": + unittest.main() + diff --git a/sources/pyside2/tests/QtGui/repr_test.py b/sources/pyside2/tests/QtGui/repr_test.py new file mode 100644 index 000000000..90307e64c --- /dev/null +++ b/sources/pyside2/tests/QtGui/repr_test.py @@ -0,0 +1,117 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import PySide2 +from PySide2.QtCore import QPoint +from PySide2.QtGui import QMatrix +from PySide2.QtGui import QMatrix2x2, QMatrix2x3, QMatrix2x4 +from PySide2.QtGui import QMatrix3x2, QMatrix3x3, QMatrix3x4 +from PySide2.QtGui import QMatrix4x2, QMatrix4x3, QMatrix4x4 +from PySide2.QtGui import QVector2D, QVector3D, QVector4D +from PySide2.QtGui import QColor, QTransform, QKeySequence, QQuaternion +from PySide2.QtGui import QPolygon + +class ReprCopyHelper: + def testCopy(self): + copy = eval(self.original.__repr__()) + self.assertTrue(copy is not self.original) + self.assertEqual(copy, self.original) + +class QTransformReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QTransform(1, 2, 3, 4, 5, 6, 7, 8) + +class QKeySequenceReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QKeySequence("Ctrl+P") + +class QQuaternionReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QQuaternion(1, 2, 3, 4) + +class QVector2DReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QVector2D(1, 2) + +class QVector3DReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QVector3D(1, 2, 3) + +class QVector4DReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QVector4D(1, 2, 3, 4) + +class QMatrixReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix(1, 2, 3, 4, 5, 6) + + +# Avoid these tests until get gcc fixed +# Related bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43247 +""" +class QMatrix2x2ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix2x2([1, 2, 3, 4]) + +class QMatrix2x3ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix2x3([1, 2, 3, 4, 5, 6]) + +class QMatrix2x4ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix2x4([1, 2, 3, 4, 5, 6, 7, 8]) + +class QMatrix3x2ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix3x2([1, 2, 3, 4, 5, 6]) + +class QMatrix3x3ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix3x3([1, 2, 3, 4, 5, 6, 7, 8, 9]) + +class QMatrix3x4ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix3x4([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) + +class QMatrix4x2ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix4x2([1, 2, 3, 4, 5, 6, 7, 8]) + +class QMatrix4x3ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix4x3([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) + +class QMatrix4x4ReprCopy(ReprCopyHelper, unittest.TestCase): + def setUp(self): + self.original = QMatrix4x4([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) +""" + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtGui/sample.png b/sources/pyside2/tests/QtGui/sample.png new file mode 100644 index 000000000..60450f0dc Binary files /dev/null and b/sources/pyside2/tests/QtGui/sample.png differ diff --git a/sources/pyside2/tests/QtGui/timed_app_test.py b/sources/pyside2/tests/QtGui/timed_app_test.py new file mode 100644 index 000000000..487e4a925 --- /dev/null +++ b/sources/pyside2/tests/QtGui/timed_app_test.py @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import TimedQApplication + +class TestTimedApp(TimedQApplication): + '''Simple test case for TimedQApplication''' + + def testFoo(self): + #Simple test of TimedQApplication + self.app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtHelp/CMakeLists.txt b/sources/pyside2/tests/QtHelp/CMakeLists.txt new file mode 100644 index 000000000..d0ba2d80c --- /dev/null +++ b/sources/pyside2/tests/QtHelp/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(help_test.py) diff --git a/sources/pyside2/tests/QtHelp/help_test.py b/sources/pyside2/tests/QtHelp/help_test.py new file mode 100644 index 000000000..a99636508 --- /dev/null +++ b/sources/pyside2/tests/QtHelp/help_test.py @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtHelp import QHelpEngine + +from helper import UsesQApplication + +class QHelpEngineCreation(UsesQApplication): + + def testConstructor(self): + helpEngine = QHelpEngine('mycollection.qch') + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtMacExtras/CMakeLists.txt b/sources/pyside2/tests/QtMacExtras/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtMacExtras/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtMacExtras/this_module_loads_test.py b/sources/pyside2/tests/QtMacExtras/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtMacExtras/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtMultimedia/CMakeLists.txt b/sources/pyside2/tests/QtMultimedia/CMakeLists.txt new file mode 100644 index 000000000..62150eb79 --- /dev/null +++ b/sources/pyside2/tests/QtMultimedia/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(audio_test.py) diff --git a/sources/pyside2/tests/QtMultimedia/audio_test.py b/sources/pyside2/tests/QtMultimedia/audio_test.py new file mode 100644 index 000000000..66db5e1ec --- /dev/null +++ b/sources/pyside2/tests/QtMultimedia/audio_test.py @@ -0,0 +1,71 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QHttp''' + +import unittest + +from PySide2.QtCore import * +from PySide2.QtMultimedia import * + +class testAudioDevices(unittest.TestCase): + + def testListDevices(self): + valid = False + devices = QAudioDeviceInfo.availableDevices(QAudio.AudioOutput) + if not len(devices): + return + + valid = True + for devInfo in devices: + if devInfo.deviceName() == 'null': + # skip the test if the only device found is a invalid device + if len(devices) == 1: + return + else: + continue + fmt = QAudioFormat() + for codec in devInfo.supportedCodecs(): + fmt.setCodec(codec) + for frequency in devInfo.supportedSampleRates(): + fmt.setSampleRate(frequency) + for channels in devInfo.supportedChannelCounts(): + fmt.setChannelCount(channels) + for sampleType in devInfo.supportedSampleTypes(): + fmt.setSampleType(sampleType) + for sampleSize in devInfo.supportedSampleSizes(): + fmt.setSampleSize(sampleSize) + for endian in devInfo.supportedByteOrders(): + fmt.setByteOrder(endian) + if devInfo.isFormatSupported(fmt): + return + self.assertTrue(False) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtMultimediaWidgets/CMakeLists.txt b/sources/pyside2/tests/QtMultimediaWidgets/CMakeLists.txt new file mode 100644 index 000000000..2fc655f89 --- /dev/null +++ b/sources/pyside2/tests/QtMultimediaWidgets/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(qmultimediawidgets.py) diff --git a/sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py b/sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py new file mode 100644 index 000000000..734dca9e5 --- /dev/null +++ b/sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py @@ -0,0 +1,59 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QtMultimediaWidgets''' + +import unittest + +from helper import UsesQApplication +from PySide2.QtMultimediaWidgets import QGraphicsVideoItem, QVideoWidget +from PySide2.QtWidgets import QGraphicsScene, QGraphicsView, QVBoxLayout, QWidget +from PySide2.QtCore import QTimer + +class MyWidget(QWidget): + def __init__(self): + QWidget.__init__(self) + + layout = QVBoxLayout(self) + layout.addWidget(QVideoWidget()) + + graphicsScene = QGraphicsScene() + graphicsView = QGraphicsView(graphicsScene) + graphicsScene.addItem(QGraphicsVideoItem()) + layout.addWidget(graphicsView) + +class QMultimediaWidgetsTest(UsesQApplication): + def testMultimediaWidgets(self): + w = MyWidget() + w.show() + + timer = QTimer.singleShot(100, self.app.quit) + self.app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtNetwork/CMakeLists.txt b/sources/pyside2/tests/QtNetwork/CMakeLists.txt new file mode 100644 index 000000000..f93de5c17 --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/CMakeLists.txt @@ -0,0 +1,7 @@ +PYSIDE_TEST(bug_446.py) +PYSIDE_TEST(bug_1084.py) +PYSIDE_TEST(accessManager_test.py) +# Qt5: QHttp is gone PYSIDE_TEST(http_test.py) +PYSIDE_TEST(tcpserver_test.py) +PYSIDE_TEST(udpsocket_test.py) +PYSIDE_TEST(qipv6address_test.py) diff --git a/sources/pyside2/tests/QtNetwork/accessManager_test.py b/sources/pyside2/tests/QtNetwork/accessManager_test.py new file mode 100644 index 000000000..11b21e841 --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/accessManager_test.py @@ -0,0 +1,71 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QHttp''' + +import unittest + +from PySide2.QtCore import * +from PySide2.QtNetwork import * + +from helper import UsesQCoreApplication +from httpd import TestServer + +class AccessManagerCase(UsesQCoreApplication): + + def setUp(self): + super(AccessManagerCase, self).setUp() + self.httpd = TestServer() + self.httpd.start() + self.called = False + + def tearDown(self): + super(AccessManagerCase, self).tearDown() + if self.httpd: + self.httpd.shutdown() + self.httpd = None + + def goAway(self): + self.httpd.shutdown() + self.app.quit() + self.httpd = None + + def slot_replyFinished(self, reply): + self.assertEqual(type(reply), QNetworkReply) + self.called = True + self.goAway() + + def testNetworkRequest(self): + manager = QNetworkAccessManager() + manager.finished.connect(self.slot_replyFinished) + manager.get(QNetworkRequest(QUrl("http://127.0.0.1:%s" % self.httpd.port()))) + self.app.exec_() + self.assertTrue(self.called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtNetwork/bug_1084.py b/sources/pyside2/tests/QtNetwork/bug_1084.py new file mode 100644 index 000000000..b2d990196 --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/bug_1084.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' unit test for BUG #1084 ''' + +import unittest +from PySide2 import QtNetwork +import py3kcompat as py3k + +class QTcpSocketTestCase(unittest.TestCase): + def setUp(self): + self.sock = QtNetwork.QTcpSocket() + self.sock.connectToHost('127.0.0.1', 25) + + def testIt(self): + self.sock.write(py3k.unicode_('quit')) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtNetwork/bug_446.py b/sources/pyside2/tests/QtNetwork/bug_446.py new file mode 100644 index 000000000..4d3f3c0e9 --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/bug_446.py @@ -0,0 +1,76 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import * +from PySide2.QtNetwork import * + +from helper import UsesQCoreApplication + +class HttpSignalsCase(UsesQCoreApplication): + '''Test case for launching QHttp signals''' + DATA = "PySide rocks" + + def onError(self): + self.assertTrue(False) + + def onNewConnection(self): + self.serverConnection = self.server.nextPendingConnection() + self.serverConnection.error.connect(self.onError) + self.serverConnection.write(HttpSignalsCase.DATA) + self.server.close() + + def onReadReady(self): + data = self.client.read(100) + self.assertEqual(data.size(), len(HttpSignalsCase.DATA)) + self.assertEqual(data, HttpSignalsCase.DATA) + self.done() + + def onClientConnect(self): + self.client.readyRead.connect(self.onReadReady) + + def initServer(self): + self.server = QTcpServer() + self.server.newConnection.connect(self.onNewConnection) + self.assertTrue(self.server.listen()) + self.client = QTcpSocket() + self.client.connected.connect(self.onClientConnect) + self.client.connectToHost(QHostAddress(QHostAddress.LocalHost), self.server.serverPort()) + + def done(self): + self.serverConnection.close() + self.client.close() + self.app.quit() + + def testRun(self): + self.initServer() + self.app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtNetwork/qipv6address_test.py b/sources/pyside2/tests/QtNetwork/qipv6address_test.py new file mode 100644 index 000000000..e51760504 --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/qipv6address_test.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QIPv6Address''' + +import unittest + +from PySide2.QtNetwork import * + +class QIPv6AddressGetItemTest(unittest.TestCase): + def testLength(self): + ip = QIPv6Address() + self.assertEqual(len(ip), 16) + + def testSetItemNegativeIndex(self): + ip = QIPv6Address() + ip[-1] = 8 + self.assertEqual(ip[-1], 8) + + def testSetItemLargeIndex(self): + ip = QIPv6Address() + self.assertRaises(IndexError, ip.__setitem__, 32, 16) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtNetwork/tcpserver_test.py b/sources/pyside2/tests/QtNetwork/tcpserver_test.py new file mode 100644 index 000000000..3c13a1849 --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/tcpserver_test.py @@ -0,0 +1,52 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QTCPServer''' + +import unittest + +from PySide2.QtNetwork import QTcpServer + +class ListenDefaultArgsCase(unittest.TestCase): + '''Test case for TcpServer.listen with default args''' + + def setUp(self): + #Acquire resources + self.server = QTcpServer() + + def tearDown(self): + #Release resources + del self.server + + def testDefaultArgs(self): + # @bug 108 + #Default arguments for QTcpServer.listen + self.server.listen() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtNetwork/udpsocket_test.py b/sources/pyside2/tests/QtNetwork/udpsocket_test.py new file mode 100644 index 000000000..4e3d9ae62 --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/udpsocket_test.py @@ -0,0 +1,78 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QUdpSocket''' + +import unittest + +from PySide2.QtCore import QUrl, QObject, SIGNAL, QCoreApplication, QTimer +from PySide2.QtNetwork import QUdpSocket, QHostAddress + +class HttpSignalsCase(unittest.TestCase): + '''Test case for bug #124 - readDatagram signature + + QUdpSocket.readDatagram must return a tuple with the datagram, host and + port, while receiving only the max payload size.''' + + def setUp(self): + #Acquire resources + self.called = False + self.app = QCoreApplication([]) + + self.socket = QUdpSocket() + + self.server = QUdpSocket() + self.server.bind(QHostAddress(QHostAddress.LocalHost), 45454) + + def tearDown(self): + #Release resources + del self.socket + del self.server + del self.app + + def sendPackage(self): + addr = QHostAddress(QHostAddress.LocalHost) + self.socket.writeDatagram('datagram', addr, 45454) + + def callback(self): + while self.server.hasPendingDatagrams(): + datagram, host, port = self.server.readDatagram(self.server.pendingDatagramSize()) + self.called = True + self.app.quit() + + def testDefaultArgs(self): + #QUdpSocket.readDatagram pythonic return + # @bug 124 + QObject.connect(self.server, SIGNAL('readyRead()'), self.callback) + self.sendPackage() + self.app.exec_() + + self.assertTrue(self.called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtOpenGL/CMakeLists.txt b/sources/pyside2/tests/QtOpenGL/CMakeLists.txt new file mode 100644 index 000000000..b37a9ddce --- /dev/null +++ b/sources/pyside2/tests/QtOpenGL/CMakeLists.txt @@ -0,0 +1,2 @@ +PYSIDE_TEST(qglbuffer_test.py) +PYSIDE_TEST(qglwidget_test.py) diff --git a/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py b/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py new file mode 100644 index 000000000..fc65052ce --- /dev/null +++ b/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py @@ -0,0 +1,72 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Unit tests for QGLBuffer''' + +import unittest + +from PySide2.QtCore import QByteArray +from PySide2.QtOpenGL import QGLBuffer, QGLWidget +import py3kcompat as py3k +from helper import UsesQApplication + +class QGLBufferTest(UsesQApplication): + def testIt(self): + w = QGLWidget() + w.makeCurrent() + + b = QGLBuffer() + b.setUsagePattern(QGLBuffer.DynamicDraw) + + self.assertTrue(b.create()) + self.assertTrue(b.bufferId() != 0) + self.assertTrue(b.bind()) + + data = QByteArray("12345") + b.allocate(data) + self.assertEqual(b.size(), data.size()) + + m = b.map(QGLBuffer.ReadOnly) + if m: + self.assertEqual(m, py3k.buffer(py3k.b(data.data()))) + b.unmap() + + m = b.map(QGLBuffer.ReadWrite) + m[3] = py3k.b('A')[0] + b.unmap() + result, rdata = b.read(3, 1) + self.assertTrue(result) + self.assertEqual(py3k.b('A'), rdata.data()) + else: + print(" memory mapping is not possible in this OpenGL implementation.") + b.release() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtOpenGL/qglwidget_test.py b/sources/pyside2/tests/QtOpenGL/qglwidget_test.py new file mode 100644 index 000000000..48774f280 --- /dev/null +++ b/sources/pyside2/tests/QtOpenGL/qglwidget_test.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtGui import * +from PySide2.QtWidgets import * +from PySide2.QtOpenGL import * + +class TestQGLWidget (unittest.TestCase): + def testIt(self): + """Just test if the bindTexture(*, GLenum, GLint) methods overloads exists""" + app = QApplication([]) + img = QImage() + w = QGLWidget() + a = w.bindTexture(img, 0, 0) # ok if it throws nothing.. :-) + + + + + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtPrintSupport/CMakeLists.txt b/sources/pyside2/tests/QtPrintSupport/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtPrintSupport/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtPrintSupport/this_module_loads_test.py b/sources/pyside2/tests/QtPrintSupport/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtPrintSupport/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtQml/CMakeLists.txt b/sources/pyside2/tests/QtQml/CMakeLists.txt new file mode 100755 index 000000000..8460a8f0b --- /dev/null +++ b/sources/pyside2/tests/QtQml/CMakeLists.txt @@ -0,0 +1,20 @@ +PYSIDE_TEST(bug_451.py) +PYSIDE_TEST(bug_456.py) +PYSIDE_TEST(bug_557.py) +PYSIDE_TEST(bug_726.py) +PYSIDE_TEST(bug_814.py) +PYSIDE_TEST(bug_825.py) +PYSIDE_TEST(bug_847.py) +PYSIDE_TEST(bug_915.py) +PYSIDE_TEST(bug_926.py) +PYSIDE_TEST(bug_951.py) +PYSIDE_TEST(bug_995.py) +PYSIDE_TEST(bug_997.py) +PYSIDE_TEST(bug_1029.py) +PYSIDE_TEST(qqmlnetwork_test.py) +PYSIDE_TEST(qquickview_test.py) +PYSIDE_TEST(connect_python_qml.py) +PYSIDE_TEST(registertype.py) +PYSIDE_TEST(javascript_exceptions.py) +PYSIDE_TEST(qqmlincubator_incubateWhile.py) +PYSIDE_TEST(qquickitem_grabToImage.py) diff --git a/sources/pyside2/tests/QtQml/bug_1029.py b/sources/pyside2/tests/QtQml/bug_1029.py new file mode 100755 index 000000000..c5555393b --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_1029.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import gc + +from PySide2.QtCore import QUrl +from PySide2.QtGui import QGuiApplication +from PySide2.QtQml import qmlRegisterType +from PySide2.QtQuick import QQuickView, QQuickItem + +def register_qml_types(): + class TestClass(QQuickItem): + def __init__(self, parent = None): + QQuickItem.__init__(self, parent) + + qmlRegisterType(TestClass, "UserTypes", 1, 0, "TestClass") + +def main(): + app = QGuiApplication([]) + + # reg qml types here + register_qml_types() + + # force gc to run + gc.collect() + + view = QQuickView() + url = QUrl(__file__.replace(".py", ".qml")) + view.setSource(url) + +if __name__ == "__main__": + main() diff --git a/sources/pyside2/tests/QtQml/bug_1029.qml b/sources/pyside2/tests/QtQml/bug_1029.qml new file mode 100755 index 000000000..d47f31f44 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_1029.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import UserTypes 1.0 + +Rectangle +{ + width: 200 + height: 200 + + color: "#ff0000" + + TestClass + { + + } +} diff --git a/sources/pyside2/tests/QtQml/bug_451.py b/sources/pyside2/tests/QtQml/bug_451.py new file mode 100755 index 000000000..58ee64eb4 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_451.py @@ -0,0 +1,100 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' +Test bug 451: http://bugs.openbossa.org/show_bug.cgi?id=451 + +An archive of said bug: +https://srinikom.github.io/pyside-bz-archive/451.html +''' + +import sys +import unittest + +from helper import adjust_filename + +from PySide2 import QtCore, QtGui, QtQuick + +class PythonObject(QtCore.QObject): + def __init__(self): + QtCore.QObject.__init__(self, None) + self._called = "" + self._arg1 = None + self._arg2 = None + + def setCalled(self, v): + self._called = v + + def setArg1(self, v): + self._arg1 = v + + def setArg2(self, v): + self._arg2 = v + + def getCalled(self): + return self._called + + def getArg1(self): + return self._arg1 + + def getArg2(self): + return self._arg2 + + called = QtCore.Property(str, getCalled, setCalled) + arg1 = QtCore.Property(int, getArg1, setArg1) + arg2 = QtCore.Property('QVariant', getArg2, setArg2) + +class TestBug(unittest.TestCase): + def testQMLFunctionCall(self): + app = QtGui.QGuiApplication(sys.argv) + view = QtQuick.QQuickView() + + obj = PythonObject() + context = view.rootContext() + context.setContextProperty("python", obj) + view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_451.qml', __file__))) + root = view.rootObject() + root.simpleFunction() + self.assertEqual(obj.called, "simpleFunction") + + root.oneArgFunction(42) + self.assertEqual(obj.called, "oneArgFunction") + self.assertEqual(obj.arg1, 42) + + root.twoArgFunction(10, app) + self.assertEqual(obj.called, "twoArgFunction") + self.assertEqual(obj.arg1, 10) + self.assertEqual(obj.arg2, app) + + rvalue = root.returnFunction() + self.assertEqual(obj.called, "returnFunction") + self.assertEqual(rvalue, 42) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/bug_451.qml b/sources/pyside2/tests/QtQml/bug_451.qml new file mode 100755 index 000000000..60219b68e --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_451.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: page + + function simpleFunction() { + python.called = "simpleFunction" + } + + function oneArgFunction(x) { + python.called = "oneArgFunction" + python.arg1 = x + } + + function twoArgFunction(x, y) { + python.called = "twoArgFunction" + python.arg1 = x + python.arg2 = y + } + + function returnFunction() { + python.called = "returnFunction" + return 42 + } + +} diff --git a/sources/pyside2/tests/QtQml/bug_456.py b/sources/pyside2/tests/QtQml/bug_456.py new file mode 100755 index 000000000..d9a67fe19 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_456.py @@ -0,0 +1,70 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import adjust_filename, TimedQApplication + +from PySide2 import QtCore, QtGui, QtQuick + +class RotateValue(QtCore.QObject): + def __init__(self): + super(RotateValue,self).__init__() + + @QtCore.Slot(result=int) + def val(self): + return 100 + + def setRotation(self, v): + self._rotation = v + + def getRotation(self): + return self._rotation + + rotation = QtCore.Property(int, getRotation, setRotation) + +class TestConnectionWithInvalidSignature(TimedQApplication): + + def testSlotRetur(self): + view = QtQuick.QQuickView() + rotatevalue = RotateValue() + + timer = QtCore.QTimer() + timer.start(2000) + + context = view.rootContext() + context.setContextProperty("rotatevalue", rotatevalue) + view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_456.qml', __file__))) + root = view.rootObject() + button = root.findChild(QtCore.QObject, "buttonMouseArea") + view.show() + button.entered.emit() + self.assertEqual(rotatevalue.rotation, 100) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/bug_456.qml b/sources/pyside2/tests/QtQml/bug_456.qml new file mode 100755 index 000000000..ebbff02d5 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_456.qml @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: page + + width: 500; height: 200 + color: "lightgray" + + Rectangle { + id: button + width: 150; height: 40 + color: "darkgray" + anchors.horizontalCenter: page.horizontalCenter + y: 120 + MouseArea { + id: buttonMouseArea + objectName: "buttonMouseArea" + anchors.fill: parent + onEntered: { + rotatevalue.rotation = rotatevalue.val() + } + } + Text { + id: buttonText + text: "Press me!" + anchors.horizontalCenter: button.horizontalCenter + anchors.verticalCenter: button.verticalCenter + font.pointSize: 16; + } + } +} diff --git a/sources/pyside2/tests/QtQml/bug_557.py b/sources/pyside2/tests/QtQml/bug_557.py new file mode 100755 index 000000000..96e89d6d6 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_557.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +from helper import adjust_filename + +from PySide2.QtCore import QUrl +from PySide2.QtGui import QGuiApplication +from PySide2.QtQml import QQmlEngine, QQmlComponent + +app = QGuiApplication(sys.argv) + +engine = QQmlEngine() +component = QQmlComponent(engine) + +# This should segfault if the QDeclarativeComponent has not QQmlEngine +component.loadUrl(QUrl.fromLocalFile(adjust_filename('foo.qml', __file__))) + diff --git a/sources/pyside2/tests/QtQml/bug_726.py b/sources/pyside2/tests/QtQml/bug_726.py new file mode 100755 index 000000000..f440b64da --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_726.py @@ -0,0 +1,71 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import adjust_filename, TimedQApplication + +from PySide2 import QtCore, QtGui, QtQuick + +class ProxyObject(QtCore.QObject): + def __init__(self): + super(ProxyObject,self).__init__() + self._o = None + self._receivedName = "" + + @QtCore.Slot(result='QObject*') + def getObject(self): + if self._o: + return self._o + + self._o = QtCore.QObject() + self._o.setObjectName("PySideObject") + return self._o + + @QtCore.Slot(str) + def receivedObject(self, name): + self._receivedName = name + + +class TestConnectionWithInvalidSignature(TimedQApplication): + + def testSlotRetur(self): + view = QtQuick.QQuickView() + proxy = ProxyObject() + + context = view.rootContext() + context.setContextProperty("proxy", proxy) + view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_726.qml', __file__))) + root = view.rootObject() + button = root.findChild(QtCore.QObject, "buttonMouseArea") + view.show() + button.entered.emit() + self.assertEqual(proxy._receivedName, "PySideObject") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/bug_726.qml b/sources/pyside2/tests/QtQml/bug_726.qml new file mode 100755 index 000000000..d03376409 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_726.qml @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: page + + width: 500; height: 200 + color: "lightgray" + + Rectangle { + id: button + width: 150; height: 40 + color: "darkgray" + anchors.horizontalCenter: page.horizontalCenter + y: 120 + MouseArea { + id: buttonMouseArea + objectName: "buttonMouseArea" + anchors.fill: parent + onEntered: { + proxy.receivedObject(proxy.getObject().objectName) + } + } + Text { + id: buttonText + text: "Press me!" + anchors.horizontalCenter: button.horizontalCenter + anchors.verticalCenter: button.verticalCenter + font.pointSize: 16; + } + } +} diff --git a/sources/pyside2/tests/QtQml/bug_814.py b/sources/pyside2/tests/QtQml/bug_814.py new file mode 100755 index 000000000..be6eea964 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_814.py @@ -0,0 +1,73 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Copyright (C) 2011 Thomas Perl +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# Test case for PySide bug 814 +# http://bugs.pyside.org/show_bug.cgi?id=814 +# archive: +# https://srinikom.github.io/pyside-bz-archive/814.html +# 2011-04-08 Thomas Perl +# Released under the same terms as PySide itself + +import unittest + +from helper import adjust_filename, TimedQApplication + +from PySide2.QtCore import QUrl, QAbstractListModel, QModelIndex, Qt +from PySide2.QtQuick import QQuickView + +class ListModel(QAbstractListModel): + def __init__(self): + QAbstractListModel.__init__(self) + + def roleNames(self): + return { Qt.DisplayRole: 'pysideModelData' } + + def rowCount(self, parent = QModelIndex()): + return 3 + + def data(self, index, role): + if index.isValid() and role == Qt.DisplayRole: + return 'blubb' + return None + +class TestBug814(TimedQApplication): + def testAbstractItemModelTransferToQML(self): + view = QQuickView() + model = ListModel() + view.rootContext().setContextProperty("pythonModel", model) + view.setSource(QUrl.fromLocalFile(adjust_filename('bug_814.qml', __file__))) + root = view.rootObject() + view.show() + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtQml/bug_814.qml b/sources/pyside2/tests/QtQml/bug_814.qml new file mode 100755 index 000000000..bc5c23fa1 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_814.qml @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +ListView { + width: 300; height: 300 + delegate: Text { text: pysideModelData } + model: pythonModel +} + diff --git a/sources/pyside2/tests/QtQml/bug_825.py b/sources/pyside2/tests/QtQml/bug_825.py new file mode 100755 index 000000000..8e896f599 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_825.py @@ -0,0 +1,82 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import adjust_filename + +from PySide2.QtCore import Qt, QUrl, QTimer +from PySide2.QtGui import QGuiApplication, QPen +from PySide2.QtWidgets import QGraphicsItem +from PySide2.QtQml import qmlRegisterType +from PySide2.QtQuick import QQuickView, QQuickItem, QQuickPaintedItem + +paintCalled = False + +class MetaA(type): + pass + +class A(object): + __metaclass__ = MetaA + +MetaB = type(QQuickPaintedItem) +B = QQuickPaintedItem + +class MetaC(MetaA, MetaB): + pass + +class C(A, B): + __metaclass__ = MetaC + +class Bug825 (C): + def __init__(self, parent = None): + QQuickPaintedItem.__init__(self, parent) + + def paint(self, painter): + global paintCalled + pen = QPen(Qt.black, 2) + painter.setPen(pen); + painter.drawPie(self.boundingRect(), 0, 128); + paintCalled = True + +class TestBug825 (unittest.TestCase): + def testIt(self): + global paintCalled + app = QGuiApplication([]) + qmlRegisterType(Bug825, 'bugs', 1, 0, 'Bug825') + self.assertRaises(TypeError, qmlRegisterType, A, 'bugs', 1, 0, 'A') + + view = QQuickView() + view.setSource(QUrl.fromLocalFile(adjust_filename('bug_825.qml', __file__))) + view.show() + QTimer.singleShot(250, view.close) + app.exec_() + self.assertTrue(paintCalled) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/bug_825.qml b/sources/pyside2/tests/QtQml/bug_825.qml new file mode 100755 index 000000000..04572dc97 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_825.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import bugs 1.0 + +Item { + width: 300; height: 200 + + Bug825 { + anchors.fill: parent + } +} diff --git a/sources/pyside2/tests/QtQml/bug_847.py b/sources/pyside2/tests/QtQml/bug_847.py new file mode 100755 index 000000000..e46888d17 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_847.py @@ -0,0 +1,79 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Copyright (C) 2011 Thomas Perl +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# Testcase for PySide bug 847 +# Released under the same terms as PySide itself +# 2011-05-04 Thomas Perl + +from __future__ import print_function + +import unittest + +from helper import adjust_filename, UsesQApplication + +from PySide2.QtCore import Slot, Signal, QUrl, QTimer, QCoreApplication +from PySide2.QtQuick import QQuickView + +class View(QQuickView): + def __init__(self): + QQuickView.__init__(self) + + called = Signal(int, int) + + @Slot(int, int) + def blubb(self, x, y): + self.called.emit(x, y) + +class TestQML(UsesQApplication): + def done(self, x, y): + self._sucess = True + self.app.quit() + print("done called") + + def testPythonSlot(self): + self._sucess = False + view = View() + + # Connect first, then set the property. + view.called.connect(self.done) + view.setSource(QUrl.fromLocalFile(adjust_filename('bug_847.qml', __file__))) + view.rootObject().setProperty('pythonObject', view) + + view.show() + # Essentially a timeout in case method invocation fails. + QTimer.singleShot(2000, QCoreApplication.instance().quit) + self.app.exec_() + self.assertTrue(self._sucess) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtQml/bug_847.qml b/sources/pyside2/tests/QtQml/bug_847.qml new file mode 100755 index 000000000..ea764ede9 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_847.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 500 + height: 500 + color: 'red' + + property variant pythonObject: undefined + + Text { + anchors.centerIn: parent + text: 'click me' + color: 'white' + } + + onPythonObjectChanged: { + if (pythonObject) { + // Delay execution of method invocation, so that the event loop has a chance to start, + // which will subsequently be stopped by the method. + timer.start() + } + } + + Timer { + id: timer + interval: 100; running: false; + onTriggered: { + if (pythonObject) { + pythonObject.blubb(42, 84) + } + } + } +} + diff --git a/sources/pyside2/tests/QtQml/bug_915.py b/sources/pyside2/tests/QtQml/bug_915.py new file mode 100755 index 000000000..c94612334 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_915.py @@ -0,0 +1,58 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import TimedQApplication + +from PySide2.QtQuick import QQuickView, QQuickItem + +class TestBug915(TimedQApplication): + def testReturnPolicy(self): + view = QQuickView() + + item1 = QQuickItem() + item1.setObjectName("Item1") + item1.setParentItem(view.contentItem()) + self.assertEqual(item1.objectName(), "Item1") # check if the item still valid + + item2 = QQuickItem() + item2.setObjectName("Item2") + item2.setParentItem(view.contentItem()) + item1 = None + self.assertEqual(item2.objectName(), "Item2") # check if the item still valid + + view = None + +if __name__ == '__main__': + unittest.main() + + diff --git a/sources/pyside2/tests/QtQml/bug_926.py b/sources/pyside2/tests/QtQml/bug_926.py new file mode 100755 index 000000000..5f6251aa5 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_926.py @@ -0,0 +1,69 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest + +from helper import adjust_filename + +from PySide2.QtCore import QUrl, QTimer, QObject, Signal, Property +from PySide2.QtGui import QGuiApplication +from PySide2.QtQml import qmlRegisterType +from PySide2.QtQuick import QQuickView + +class MyClass (QObject): + + def __init__(self): + super(MyClass,self).__init__() + self.__url = QUrl() + + def getUrl(self): + return self.__url + + def setUrl(self,value): + newUrl = QUrl(value) + if (newUrl != self.__url): + self.__url = newUrl + self.urlChanged.emit() + + urlChanged = Signal() + urla = Property(QUrl, getUrl, setUrl, notify = urlChanged) + +class TestBug926 (unittest.TestCase): + def testIt(self): + app = QGuiApplication([]) + qmlRegisterType(MyClass,'Example',1,0,'MyClass') + view = QQuickView() + view.setSource(QUrl.fromLocalFile(adjust_filename('bug_926.qml', __file__))) + self.assertEqual(len(view.errors()), 0) + view.show() + QTimer.singleShot(0, app.quit) + app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/bug_926.qml b/sources/pyside2/tests/QtQml/bug_926.qml new file mode 100755 index 000000000..0133ebf52 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_926.qml @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import Example 1.0 + +Rectangle { + width: 100 + height: 62 + + MyClass { + id: myClass + urla: "http://www.pyside.org" + } + + Text { + id: name + text: myClass.urla + } +} diff --git a/sources/pyside2/tests/QtQml/bug_951.py b/sources/pyside2/tests/QtQml/bug_951.py new file mode 100755 index 000000000..897412bd1 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_951.py @@ -0,0 +1,61 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import adjust_filename, TimedQApplication + +from PySide2.QtCore import QUrl +from PySide2.QtQml import qmlRegisterType +from PySide2.QtQuick import QQuickItem, QQuickView + +class MyItem(QQuickItem): + COMPONENT_COMPLETE_CALLED = False + def __init__(self,parent=None): + super(MyItem, self).__init__(parent) + self.setObjectName("myitem") + + def componentComplete(self): + MyItem.COMPONENT_COMPLETE_CALLED = True + super(MyItem, self).componentComplete() + +class TestRegisterQMLType(TimedQApplication): + def setup(self): + TimedQApplication.setup(self, 100 * 3) # 3s + + def testSignalEmission(self): + qmlRegisterType(MyItem, "my.item", 1, 0, "MyItem") + + view = QQuickView() + view.setSource(QUrl.fromLocalFile(adjust_filename('bug_951.qml', __file__))) + + self.app.exec_() + self.assertTrue(MyItem.COMPONENT_COMPLETE_CALLED) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/bug_951.qml b/sources/pyside2/tests/QtQml/bug_951.qml new file mode 100755 index 000000000..8b93bfc6d --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_951.qml @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import my.item 1.0 +Rectangle{ + width:10 + height:10 + MyItem{ } +} diff --git a/sources/pyside2/tests/QtQml/bug_995.py b/sources/pyside2/tests/QtQml/bug_995.py new file mode 100755 index 000000000..d891f3445 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_995.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from helper import adjust_filename, UsesQApplication + +from PySide2.QtGui import QGuiApplication +from PySide2.QtQuick import QQuickView + +app = QGuiApplication([]) +view = QQuickView(adjust_filename('bug_995.qml', __file__)) +view.show() +view.resize(200, 200) +contentItem = view.contentItem() +item = contentItem.childAt(100, 100) + +# it CAN NOT crash here +print(item) + diff --git a/sources/pyside2/tests/QtQml/bug_995.qml b/sources/pyside2/tests/QtQml/bug_995.qml new file mode 100755 index 000000000..fcc33975c --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_995.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 100 + height: 100 + color: "red" + + Text { + text: "Hello World" + anchors.centerIn: parent + } +} diff --git a/sources/pyside2/tests/QtQml/bug_997.py b/sources/pyside2/tests/QtQml/bug_997.py new file mode 100755 index 000000000..fcb260cf3 --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_997.py @@ -0,0 +1,52 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import adjust_filename, UsesQApplication + +from PySide2 import QtCore, QtQml, QtQuick + +class TestBug(UsesQApplication): + def testQMLFunctionCall(self): + ownerData = QtQml.QQmlPropertyMap() + ownerData.insert('name', 'John Smith') + ownerData.insert('phone', '555-5555') + ownerData.insert('newValue', '') + + view = QtQuick.QQuickView() + ctxt = view.rootContext() + ctxt.setContextProperty('owner', ownerData) + view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_997.qml', __file__))) + view.show() + QtCore.QTimer.singleShot(1000, self.app.quit) + self.app.exec_() + self.assertEqual(ownerData.value('newName'), ownerData.value('name')) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/bug_997.qml b/sources/pyside2/tests/QtQml/bug_997.qml new file mode 100755 index 000000000..24f5ae51f --- /dev/null +++ b/sources/pyside2/tests/QtQml/bug_997.qml @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Text { + text: owner.name + " " + owner.phone + Component.onCompleted: { owner.newName = owner.name } +} diff --git a/sources/pyside2/tests/QtQml/connect_python_qml.py b/sources/pyside2/tests/QtQml/connect_python_qml.py new file mode 100644 index 000000000..3eeffd0d3 --- /dev/null +++ b/sources/pyside2/tests/QtQml/connect_python_qml.py @@ -0,0 +1,65 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' +Test case for bug #442 + +archive: +https://srinikom.github.io/pyside-bz-archive/442.html +''' + +import unittest + +from helper import adjust_filename, TimedQApplication + +from PySide2 import QtCore, QtGui, QtQuick + +class TestConnectionWithInvalidSignature(TimedQApplication): + def onButtonClicked(self): + self.buttonClicked = True + self.app.quit() + + def onButtonFailClicked(self): + pass + + def testFailConnection(self): + self.buttonClicked = False + self.buttonFailClicked = False + view = QtQuick.QQuickView() + view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('connect_python_qml.qml', __file__))) + root = view.rootObject() + button = root.findChild(QtCore.QObject, "buttonMouseArea") + self.assertRaises(TypeError, QtCore.QObject.connect, [button,QtCore.SIGNAL('entered()'), self.onButtonFailClicked]) + button.entered.connect(self.onButtonClicked) + button.entered.emit() + view.show() + self.app.exec_() + self.assertTrue(self.buttonClicked) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/connect_python_qml.qml b/sources/pyside2/tests/QtQml/connect_python_qml.qml new file mode 100755 index 000000000..79a364159 --- /dev/null +++ b/sources/pyside2/tests/QtQml/connect_python_qml.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: page + width: 500; height: 200 + color: "lightgray" + + Rectangle { + id: button + width: 150; height: 40 + color: "darkgray" + anchors.horizontalCenter: page.horizontalCenter + y: 150 + MouseArea { + id: buttonMouseArea + objectName: "buttonMouseArea" + anchors.fill: parent + } + } +} diff --git a/sources/pyside2/tests/QtQml/hw.qml b/sources/pyside2/tests/QtQml/hw.qml new file mode 100755 index 000000000..0e682bf40 --- /dev/null +++ b/sources/pyside2/tests/QtQml/hw.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: page + width: 500; height: 200 + color: "lightgray" + + Text { + id: helloText + text: "Hello world!" + y: 30 + anchors.horizontalCenter: page.horizontalCenter + font.pointSize: 24; font.bold: true + } + + Image { + // It's okay for this to fail. + source: "http://localhost/logo.png" + } +} diff --git a/sources/pyside2/tests/QtQml/javascript_exceptions.py b/sources/pyside2/tests/QtQml/javascript_exceptions.py new file mode 100644 index 000000000..513a22a3e --- /dev/null +++ b/sources/pyside2/tests/QtQml/javascript_exceptions.py @@ -0,0 +1,103 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import adjust_filename, UsesQApplication + +from PySide2.QtCore import Slot, Property, Signal, QObject, QUrl +from PySide2.QtQml import QJSEngine, qmlRegisterType +from PySide2.QtQuick import QQuickView + +test_error_message = "This is an error." + +method_test_string = """ +(function (obj) { + obj.methodThrows(); +}) +""" + +property_test_string = """ +(function (obj) { + obj.propertyThrows; +}) +""" + +test_1 = False +test_2 = False + +class TestClass(QObject): + @Slot() + def methodThrows(self): + raise TypeError(test_error_message) + + @Property(str) + def propertyThrows(self): + raise TypeError(test_error_message) + + @Slot(int) + def passTest(self, test): + global test_1, test_2 + + if test == 1: + test_1 = True + else: + test_2 = True + +class JavaScriptExceptionsTest(UsesQApplication): + def test_jsengine(self): + engine = QJSEngine() + test_object = TestClass() + test_value = engine.newQObject(test_object) + + result_1 = engine.evaluate(method_test_string).call([test_value]) + + self.assertTrue(result_1.isError()) + self.assertEqual(result_1.property('message').toString(), test_error_message) + self.assertEqual(result_1.property('name').toString(), 'TypeError') + + result_2 = engine.evaluate(property_test_string).call([test_value]) + + self.assertTrue(result_2.isError()) + self.assertEqual(result_2.property('message').toString(), test_error_message) + self.assertEqual(result_2.property('name').toString(), 'TypeError') + + def test_qml_type(self): + qmlRegisterType(TestClass, 'JavaScriptExceptions', 1, 0, 'JavaScriptExceptions'); + + view = QQuickView() + qml_url = QUrl.fromLocalFile(adjust_filename('javascript_exceptions.qml', __file__)) + + view.setSource(qml_url) + + self.assertTrue(test_1) + self.assertTrue(test_2) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/javascript_exceptions.qml b/sources/pyside2/tests/QtQml/javascript_exceptions.qml new file mode 100644 index 000000000..6d0e062cf --- /dev/null +++ b/sources/pyside2/tests/QtQml/javascript_exceptions.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 1.0 +import JavaScriptExceptions 1.0 + +Rectangle { + JavaScriptExceptions { + id: obj + } + + Component.onCompleted: { + // Method call test + try { + obj.methodThrows(); + } catch(e) { + obj.passTest(1); + } + + // Property accessor test + try { + obj.propertyThrows; + } catch(e) { + obj.passTest(2); + } + } +} \ No newline at end of file diff --git a/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py b/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py new file mode 100644 index 000000000..26be20f15 --- /dev/null +++ b/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py @@ -0,0 +1,96 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys +from helper import adjust_filename + +from PySide2.QtCore import QObject, QUrl, Slot, QTimer +from PySide2.QtGui import QGuiApplication +from PySide2.QtQml import QQmlIncubationController, VolatileBool +from PySide2.QtQuick import QQuickView + +class CustomIncubationController(QObject, QQmlIncubationController): + def __init__(self, test): + QObject.__init__(self) + QQmlIncubationController.__init__(self) + self.test = test + self.interrupted = False + + # Incubate every 50 milliseconds + self.startTimer(50) + self.incubationShouldContinue = VolatileBool(True) + self.test.assertEqual(self.incubationShouldContinue.get(), True) + + @Slot() + def interrupter(self): + if not self.interrupted: + self.interrupted = True + self.incubationShouldContinue.set(False) + self.test.assertEqual(self.incubationShouldContinue.get(), False) + QTimer.singleShot(0, QGuiApplication.instance().quit) + + def timerEvent(self, ev): + # Incubate items for 2000 milliseconds, or until the volatile bool is set to false. + self.incubateWhile(self.incubationShouldContinue, 2000) + +class TestBug(unittest.TestCase): + def testIncubateWhileCall(self): + app = QGuiApplication(sys.argv) + view = QQuickView() + controller = CustomIncubationController(self) + view.engine().setIncubationController(controller) + view.setResizeMode(QQuickView.SizeRootObjectToView) + view.setSource(QUrl.fromLocalFile(adjust_filename('qqmlincubator_incubateWhile.qml', + __file__))) + view.show() + + root = view.rootObject() + # The QML code will issue an interrupt signal after half of its items are loaded. + root.shouldInterrupt.connect(controller.interrupter) + res = app.exec_() + + itemsToCreate = root.property("itemsToCreate") + loadedItems = root.property("loadedItems") + self.assertEqual(loadedItems, itemsToCreate / 2) + + # Finish incubating the remaining items. + controller.incubateFor(1000) + loadedItems = root.property("loadedItems") + self.assertEqual(loadedItems, itemsToCreate) + + # Deleting the view before it goes out of scope is required to make sure all child QML + # instances are destroyed in the correct order. + del view + del app + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.qml b/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.qml new file mode 100644 index 000000000..3f4fe8214 --- /dev/null +++ b/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 2.0 + + +Rectangle { + id: root + objectName: "theNicestRoot" + width: 400; height: 400 + + signal shouldInterrupt() + property int loadedItems: 0 + property int itemsToCreate: 10 + + Row { + anchors.centerIn: parent + spacing: 20 + + Rectangle { + id: initialRectangle + width: 10; height: 10 + color: "red" + } + + Repeater { + model: itemsToCreate + Loader { + id: loader + asynchronous: true + source: "qqmlincubator_incubateWhile_component.qml" + onLoaded: { + root.loadedItems += 1 + + // Interrupt incubation after half of the items are loaded. + if (root.loadedItems >= (itemsToCreate / 2)) { + root.shouldInterrupt() + } + } + } + } + } +} diff --git a/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile_component.qml b/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile_component.qml new file mode 100644 index 000000000..654cf2281 --- /dev/null +++ b/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile_component.qml @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: root + width: 10; height: 10 + color: "yellow" +} diff --git a/sources/pyside2/tests/QtQml/qqmlnetwork_test.py b/sources/pyside2/tests/QtQml/qqmlnetwork_test.py new file mode 100755 index 000000000..fab3af8c8 --- /dev/null +++ b/sources/pyside2/tests/QtQml/qqmlnetwork_test.py @@ -0,0 +1,70 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QQmlNetwork''' + +from __future__ import print_function + +import unittest + +from PySide2.QtCore import QUrl +from PySide2.QtQuick import QQuickView +from PySide2.QtQml import QQmlNetworkAccessManagerFactory +from PySide2.QtNetwork import QNetworkAccessManager + +from helper import adjust_filename, TimedQApplication + +class CustomManager(QNetworkAccessManager): + def createRequest(self, op, req, data = None): + print(">> createRequest ", self, op, req.url(), data) + return QNetworkAccessManager.createRequest(self, op, req, data) + +class CustomFactory(QQmlNetworkAccessManagerFactory): + def create(self, parent = None): + return CustomManager() + +class TestQQmlNetworkFactory(TimedQApplication): + def setUp(self): + TimedQApplication.setUp(self, timeout=1000) + + def testQQuickNetworkFactory(self): + view = QQuickView() + self.factory = CustomFactory() + view.engine().setNetworkAccessManagerFactory(self.factory) + + url = QUrl.fromLocalFile(adjust_filename('hw.qml', __file__)) + + view.setSource(url) + view.show() + + self.assertEqual(view.status(), QQuickView.Ready) + + self.app.exec_() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/qquickitem_grabToImage.py b/sources/pyside2/tests/QtQml/qquickitem_grabToImage.py new file mode 100644 index 000000000..91835e689 --- /dev/null +++ b/sources/pyside2/tests/QtQml/qquickitem_grabToImage.py @@ -0,0 +1,79 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from helper import adjust_filename, TimedQApplication +from PySide2 import QtCore, QtGui, QtQuick + +class TestGrabToSharedPointerImage(TimedQApplication): + def setUp(self): + TimedQApplication.setUp(self, 1000) + + def testQQuickItemGrabToImageSharedPointer(self): + view = QtQuick.QQuickView() + view.setSource(QtCore.QUrl.fromLocalFile( + adjust_filename('qquickitem_grabToImage.qml', __file__))) + view.show() + + # Get the QQuickItem objects for the blue Rectangle and the Image item. + root = view.rootObject() + blueRectangle = root.findChild(QtQuick.QQuickItem, "blueRectangle") + imageContainer = root.findChild(QtQuick.QQuickItem, "imageContainer") + + # Start the image grabbing. + grabResultSharedPtr = blueRectangle.grabToImage() + + # Implicit call of operator bool() of the smart pointer, to check that it holds + # a valid pointer. + self.assertTrue(grabResultSharedPtr) + + self.grabbedColor = None + def onGrabReady(): + # Signal early exit. + QtCore.QTimer.singleShot(0, self.app.quit) + + # Show the grabbed image in the QML Image item. + imageContainer.setProperty("source", grabResultSharedPtr.url()) + + # Wait for signal when grabbing is complete. + grabResultSharedPtr.ready.connect(onGrabReady) + self.app.exec_() + + # Get the first pixel color of the grabbed image. + self.image = grabResultSharedPtr.image() + self.assertTrue(self.image) + self.grabbedColor = self.image.pixelColor(0,0) + self.assertTrue(self.grabbedColor.isValid()) + + # Compare the grabbed color with the one we set in the rectangle. + blueColor = QtGui.QColor("blue") + self.assertEqual(self.grabbedColor, blueColor) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/qquickitem_grabToImage.qml b/sources/pyside2/tests/QtQml/qquickitem_grabToImage.qml new file mode 100644 index 000000000..d103cf076 --- /dev/null +++ b/sources/pyside2/tests/QtQml/qquickitem_grabToImage.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: root + width: 600 + height: 600 + + Rectangle { + id: blue + objectName: "blueRectangle" + width: 200 + height: 200 + anchors.top: root.top + anchors.horizontalCenter: root.horizontalCenter + color: "blue" + } + + Text { + text: qsTr("Original blue rectangle") + anchors.left: blue.right + anchors.verticalCenter: blue.verticalCenter + } + + Image { + id: imageContainer + objectName: "imageContainer" + width: 200 + height: 200 + anchors.bottom: root.bottom + anchors.horizontalCenter: root.horizontalCenter + } + + Text { + text: qsTr("Image with the source URL set to the result of calling QQuickItem::grabToImage on the rectangle. If you see a second blue rectangle, that means it works.") + anchors.left: imageContainer.right + anchors.verticalCenter: imageContainer.verticalCenter + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + width: 200 + } + +} diff --git a/sources/pyside2/tests/QtQml/qquickview_test.py b/sources/pyside2/tests/QtQml/qquickview_test.py new file mode 100755 index 000000000..e65eb3afc --- /dev/null +++ b/sources/pyside2/tests/QtQml/qquickview_test.py @@ -0,0 +1,86 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QQuickView''' + +import unittest + +from helper import adjust_filename, TimedQApplication + +from PySide2.QtCore import QUrl, QObject, Property, Slot +from PySide2.QtQuick import QQuickView + +class MyObject(QObject): + def __init__(self, text, parent=None): + QObject.__init__(self, parent) + self._text = text + + def getText(self): + return self._text + + + @Slot(str) + def qmlText(self, text): + self._qmlText = text + + title = Property(str, getText) + + +class TestQQuickView(TimedQApplication): + + def testQQuickViewList(self): + view = QQuickView() + + dataList = ["Item 1", "Item 2", "Item 3", "Item 4"] + + ctxt = view.rootContext() + ctxt.setContextProperty("myModel", dataList) + + url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__)) + view.setSource(url) + view.show() + + self.assertEqual(view.status(), QQuickView.Ready) + + + def testModelExport(self): + view = QQuickView() + dataList = [MyObject("Item 1"), MyObject("Item 2"), MyObject("Item 3"), MyObject("Item 4")] + + ctxt = view.rootContext() + ctxt.setContextProperty("myModel", dataList) + + url = QUrl.fromLocalFile(adjust_filename('viewmodel.qml', __file__)) + view.setSource(url) + view.show() + + self.assertEqual(view.status(), QQuickView.Ready) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/registertype.py b/sources/pyside2/tests/QtQml/registertype.py new file mode 100755 index 000000000..82bac32b1 --- /dev/null +++ b/sources/pyside2/tests/QtQml/registertype.py @@ -0,0 +1,118 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest + +import helper + +from PySide2.QtCore import Property, QTimer, QUrl +from PySide2.QtGui import QGuiApplication, QPen, QColor, QPainter +from PySide2.QtQml import qmlRegisterType, ListProperty +from PySide2.QtQuick import QQuickView, QQuickItem, QQuickPaintedItem + +class PieSlice (QQuickPaintedItem): + def __init__(self, parent = None): + QQuickPaintedItem.__init__(self, parent) + self._color = QColor() + self._fromAngle = 0 + self._angleSpan = 0 + + def getColor(self): + return self._color + + def setColor(self, value): + self._color = value + + def getFromAngle(self): + return self._angle + + def setFromAngle(self, value): + self._fromAngle = value + + def getAngleSpan(self): + return self._angleSpan + + def setAngleSpan(self, value): + self._angleSpan = value + + color = Property(QColor, getColor, setColor) + fromAngle = Property(int, getFromAngle, setFromAngle) + angleSpan = Property(int, getAngleSpan, setAngleSpan) + + def paint(self, painter): + global paintCalled + pen = QPen(self._color, 2) + painter.setPen(pen); + painter.setRenderHints(QPainter.Antialiasing, True); + painter.drawPie(self.boundingRect(), self._fromAngle * 16, self._angleSpan * 16); + paintCalled = True + +class PieChart (QQuickItem): + def __init__(self, parent = None): + QQuickItem.__init__(self, parent) + self._name = '' + self._slices = [] + + def getName(self): + return self._name + + def setName(self, value): + self._name = value + + name = Property(str, getName, setName) + + def appendSlice(self, _slice): + global appendCalled + _slice.setParentItem(self) + self._slices.append(_slice) + appendCalled = True + + slices = ListProperty(PieSlice, append=appendSlice) + +appendCalled = False +paintCalled = False + +class TestQmlSupport(unittest.TestCase): + + def testIt(self): + app = QGuiApplication([]) + + qmlRegisterType(PieChart, 'Charts', 1, 0, 'PieChart'); + qmlRegisterType(PieSlice, "Charts", 1, 0, "PieSlice"); + + view = QQuickView() + view.setSource(QUrl.fromLocalFile(helper.adjust_filename('registertype.qml', __file__))) + view.show() + QTimer.singleShot(250, view.close) + app.exec_() + self.assertTrue(appendCalled) + self.assertTrue(paintCalled) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtQml/registertype.qml b/sources/pyside2/tests/QtQml/registertype.qml new file mode 100755 index 000000000..cfa7fce8f --- /dev/null +++ b/sources/pyside2/tests/QtQml/registertype.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import Charts 1.0 + +Item { + width: 300; height: 200 + + PieChart { + anchors.centerIn: parent + width: 100; height: 100 + + slices: [ + PieSlice { + anchors.fill: parent + color: "red" + fromAngle: 0; angleSpan: 110 + }, + PieSlice { + anchors.fill: parent + color: "black" + fromAngle: 110; angleSpan: 50 + }, + PieSlice { + anchors.fill: parent + color: "blue" + fromAngle: 160; angleSpan: 100 + } + ] + } +} diff --git a/sources/pyside2/tests/QtQml/view.qml b/sources/pyside2/tests/QtQml/view.qml new file mode 100755 index 000000000..8cc50e782 --- /dev/null +++ b/sources/pyside2/tests/QtQml/view.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +ListView { + width: 100 + height: 100 + anchors.fill: parent + model: myModel + delegate: Component { + Rectangle { + height: 25 + width: 100 + Text { text: modelData } + } + } +} diff --git a/sources/pyside2/tests/QtQml/viewmodel.qml b/sources/pyside2/tests/QtQml/viewmodel.qml new file mode 100755 index 000000000..18f799da8 --- /dev/null +++ b/sources/pyside2/tests/QtQml/viewmodel.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +ListView { + width: 100; height: 100 + anchors.fill: parent + + model: myModel + delegate: Rectangle { + height: 25 + width: 100 + Text { text: title } + } +} + diff --git a/sources/pyside2/tests/QtQuick/CMakeLists.txt b/sources/pyside2/tests/QtQuick/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtQuick/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtQuick/this_module_loads_test.py b/sources/pyside2/tests/QtQuick/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtQuick/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtQuickWidgets/CMakeLists.txt b/sources/pyside2/tests/QtQuickWidgets/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtQuickWidgets/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtQuickWidgets/this_module_loads_test.py b/sources/pyside2/tests/QtQuickWidgets/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtQuickWidgets/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtScript/CMakeLists.txt b/sources/pyside2/tests/QtScript/CMakeLists.txt new file mode 100644 index 000000000..dfea68df0 --- /dev/null +++ b/sources/pyside2/tests/QtScript/CMakeLists.txt @@ -0,0 +1,5 @@ +PYSIDE_TEST(base_test.py) +PYSIDE_TEST(bug_1022.py) +PYSIDE_TEST(engine_test.py) +PYSIDE_TEST(property_test.py) +PYSIDE_TEST(qscriptvalue_test.py) diff --git a/sources/pyside2/tests/QtScript/base_test.py b/sources/pyside2/tests/QtScript/base_test.py new file mode 100644 index 000000000..623610ac0 --- /dev/null +++ b/sources/pyside2/tests/QtScript/base_test.py @@ -0,0 +1,32 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2 import QtScript + + +#only test if the module import works fine bug #278 diff --git a/sources/pyside2/tests/QtScript/bug_1022.py b/sources/pyside2/tests/QtScript/bug_1022.py new file mode 100644 index 000000000..740180709 --- /dev/null +++ b/sources/pyside2/tests/QtScript/bug_1022.py @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import * +from PySide2.QtScript import * + +class QScriptValueTest(unittest.TestCase): + def testQScriptValue(self): + app = QCoreApplication([]) + engine = QScriptEngine() + repr(engine.evaluate('1 + 1')) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtScript/engine_test.py b/sources/pyside2/tests/QtScript/engine_test.py new file mode 100644 index 000000000..15f50fe29 --- /dev/null +++ b/sources/pyside2/tests/QtScript/engine_test.py @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject +from PySide2.QtScript import QScriptEngine + +class QScriptEngineTest(unittest.TestCase): + + def testQScriptEngine(self): + engine = QScriptEngine() + obj = engine.evaluate("({ unitName: 'Celsius', toKelvin: function(x) { return x + 273; } })") + toKelvin = obj.property("toKelvin") + result = toKelvin.call(obj, [100]) + self.assertEqual(result.toNumber(), 373) diff --git a/sources/pyside2/tests/QtScript/property_test.py b/sources/pyside2/tests/QtScript/property_test.py new file mode 100644 index 000000000..b958d3106 --- /dev/null +++ b/sources/pyside2/tests/QtScript/property_test.py @@ -0,0 +1,90 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, Property, QCoreApplication +from PySide2.QtScript import QScriptEngine + +class MyObject(QObject): + def __init__(self, parent = None): + QObject.__init__(self, parent) + self._p = 100 + + def setX(self, value): + self._p = value + + def getX(self): + return self._p + + def resetX(self): + self._p = 100 + + def delX(self): + self._p = 0 + + x = Property(int, getX, setX, resetX, delX) + + +class QPropertyTest(unittest.TestCase): + + def testSimple(self): + o = MyObject() + self.assertEqual(o.x, 100) + o.x = 42 + self.assertEqual(o.x, 42) + + def testHasProperty(self): + o = MyObject() + o.setProperty("x", 10) + self.assertEqual(o.x, 10) + self.assertEqual(o.property("x"), 10) + + def testMetaProperty(self): + o = MyObject() + m = o.metaObject() + found = False + for i in range(m.propertyCount()): + mp = m.property(i) + if mp.name() == "x": + found = True + break + self.assertTrue(found) + + def testScriptQProperty(self): + qapp = QCoreApplication([]) + myEngine = QScriptEngine() + obj = MyObject() + scriptObj = myEngine.newQObject(obj) + myEngine.globalObject().setProperty("obj", scriptObj) + myEngine.evaluate("obj.x = 42") + self.assertEqual(scriptObj.property("x").toInt32(), 42) + self.assertEqual(obj.property("x"), 42) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtScript/qscriptvalue_test.py b/sources/pyside2/tests/QtScript/qscriptvalue_test.py new file mode 100644 index 000000000..1e1a16677 --- /dev/null +++ b/sources/pyside2/tests/QtScript/qscriptvalue_test.py @@ -0,0 +1,72 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import unittest + +from PySide2.QtScript import * + +# Required for eval() to work +import PySide2.QtScript + +from helper import UsesQApplication + +class TestQScriptValue (UsesQApplication): + + def testOperator(self): + engine = QScriptEngine() + value = engine.evaluate('x = {"a": 1, "b":2}') + self.assertEqual(value['a'], 1) + self.assertRaises(KeyError, value.__getitem__, 'c') + value = engine.evaluate('x = ["x", "y", "z"]') + self.assertEqual(value[2], 'z') + self.assertRaises(IndexError, value.__getitem__, 23) + + def testRepr(self): + value = QScriptValue("somePerson = { firstName: 'John', lastName: 'Doe' }") + print(repr(value)) + value2 = eval(repr(value)) + self.assertEqual(value.toString(), value2.toString()) + self.assertEqual(value.toVariant(), value2.toVariant()) + + def testIteratorProtocol(self): + engine = QScriptEngine() + value = engine.evaluate('x = {"a": 1, "b":2}') + d = {} + for k, v in QScriptValueIterator(value): + d[k] = v + self.assertEqual(d, {'a': 1, 'b': 2}) + + d = {} + for k, v in value: + d[k] = v + self.assertEqual(d, {'a': 1, 'b': 2}) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtScriptTools/CMakeLists.txt b/sources/pyside2/tests/QtScriptTools/CMakeLists.txt new file mode 100644 index 000000000..ee22737c6 --- /dev/null +++ b/sources/pyside2/tests/QtScriptTools/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(debugger_test.py) diff --git a/sources/pyside2/tests/QtScriptTools/debugger_test.py b/sources/pyside2/tests/QtScriptTools/debugger_test.py new file mode 100644 index 000000000..ea8e557a6 --- /dev/null +++ b/sources/pyside2/tests/QtScriptTools/debugger_test.py @@ -0,0 +1,75 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import SIGNAL, QTimer +from PySide2.QtScript import QScriptEngine +from PySide2.QtScriptTools import QScriptEngineDebugger + +from helper import UsesQApplication + +class DebuggerTest(UsesQApplication): + + def setUp(self): + UsesQApplication.setUp(self) + self.engine = QScriptEngine() + self.debugger = QScriptEngineDebugger() + self.has_suspended = 0 + self.has_resumed = 0 + self.count = 3 + + def suspended(self): + self.has_suspended += 1 + # Will emit evaluationResumed until there are more instructions to be run + QTimer.singleShot(100, self.debugger.action(QScriptEngineDebugger.StepIntoAction).trigger) + + def resumed(self): + # Will be called when debugger.state() change from Suspended to Running + # except for the first time. + self.has_resumed += 1 + + def testBasic(self): + '''Interrupt and resume evaluation with QScriptEngineDebugger''' + + self.debugger.attachTo(self.engine) + self.debugger.setAutoShowStandardWindow(False) + self.debugger.connect(SIGNAL('evaluationSuspended()'), self.suspended) + self.debugger.connect(SIGNAL('evaluationResumed()'), self.resumed) + + # For some reason StepIntoAction does not actually continue execution, and thus interrupting + # causes the test to hang. The same behavior is present in a Qt5.6 C++ code equivalent. It + # seems like a bug in QtScript, thus the interruption is commented out for now, which will + # force the test to fail. + #self.debugger.action(QScriptEngineDebugger.InterruptAction).trigger() + self.engine.evaluate("3+4\n2+1\n5+1") + self.assertTrue(self.has_resumed >= 1) + self.assertTrue(self.has_suspended >= 1) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtSql/CMakeLists.txt b/sources/pyside2/tests/QtSql/CMakeLists.txt new file mode 100644 index 000000000..8db3a9813 --- /dev/null +++ b/sources/pyside2/tests/QtSql/CMakeLists.txt @@ -0,0 +1,3 @@ +PYSIDE_TEST(bug_1013.py) +PYSIDE_TEST(qsqldatabaseandqueries_test.py) +PYSIDE_TEST(qvarianttype_test.py) diff --git a/sources/pyside2/tests/QtSql/bug_1013.py b/sources/pyside2/tests/QtSql/bug_1013.py new file mode 100644 index 000000000..8657fb9d2 --- /dev/null +++ b/sources/pyside2/tests/QtSql/bug_1013.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtSql import * +import unittest + +class TestBug1013 (unittest.TestCase): + + def someSlot(self, row, record): + record.setValue(0, 2) + self._wasCalled = True + + def testIt(self): + app = QCoreApplication([]) + db = QSqlDatabase.addDatabase('QSQLITE') + db.setDatabaseName(':memory:') + db.open() + query = QSqlQuery() + query.exec_('CREATE TABLE "foo" (id INT);') + model = QSqlTableModel() + model.setTable('foo') + + self._wasCalled = False + model.primeInsert.connect(self.someSlot) + model.select() + QTimer.singleShot(0,lambda: model.insertRow(0) and app.quit()) + app.exec_() + self.assertTrue(self._wasCalled) + self.assertEqual(model.data(model.index(0, 0)), 2) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py b/sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py new file mode 100644 index 000000000..b99946c44 --- /dev/null +++ b/sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py @@ -0,0 +1,99 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QtSql database creation, destruction and queries''' + +import sys +import unittest + +from PySide2 import QtSql +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class Foo(QWidget): + def __init__(self): + QWidget.__init__(self) + self.model = QtSql.QSqlTableModel() + +class SqlDatabaseCreationDestructionAndQueries(unittest.TestCase): + '''Test cases for QtSql database creation, destruction and queries''' + + def setUp(self): + #Acquire resources + self.assertFalse(not QtSql.QSqlDatabase.drivers(), "installed Qt has no DB drivers") + self.assertTrue("QSQLITE" in QtSql.QSqlDatabase.drivers(), "\"QSQLITE\" driver not available in this Qt version") + self.db = QtSql.QSqlDatabase.addDatabase("QSQLITE") + self.db.setDatabaseName(":memory:") + self.assertTrue(self.db.open()) + + def tearDown(self): + #Release resources + self.db.close() + QtSql.QSqlDatabase.removeDatabase(":memory:") + del self.db + + def testTableCreationAndDestruction(self): + #Test table creation and destruction + query = QtSql.QSqlQuery() + query.exec_("CREATE TABLE dummy(id int primary key, dummyfield varchar(20))") + query.exec_("DROP TABLE dummy") + query.clear() + + def testTableInsertionAndRetrieval(self): + #Test table creation, insertion and retrieval + query = QtSql.QSqlQuery() + query.exec_("CREATE TABLE person(id int primary key, " + "firstname varchar(20), lastname varchar(20))") + query.exec_("INSERT INTO person VALUES(101, 'George', 'Harrison')") + query.prepare("INSERT INTO person (id, firstname, lastname) " + "VALUES (:id, :firstname, :lastname)") + query.bindValue(":id", 102) + query.bindValue(":firstname", "John") + query.bindValue(":lastname", "Lennon") + query.exec_() + + lastname = '' + query.exec_("SELECT lastname FROM person where id=101") + self.assertTrue(query.isActive()) + query.next() + lastname = query.value(0) + self.assertEqual(lastname, 'Harrison') + + def testTableModelDeletion(self): + app = QApplication([]) + + bar = Foo() + model = bar.model + del bar + del app + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtSql/qvarianttype_test.py b/sources/pyside2/tests/QtSql/qvarianttype_test.py new file mode 100644 index 000000000..1eb532cea --- /dev/null +++ b/sources/pyside2/tests/QtSql/qvarianttype_test.py @@ -0,0 +1,62 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QVariant::Type converter''' +import unittest +import py3kcompat as py3k +from PySide2.QtSql import QSqlField + +class QVariantTypeTest(unittest.TestCase): + def testQVariantType(self): + f = QSqlField("name", str) + self.assertEqual(f.type(), py3k.unicode) + + f = QSqlField("name", "QString") + self.assertEqual(f.type(), py3k.unicode) + + f = QSqlField("name", "double") + self.assertEqual(f.type(), float) + + f = QSqlField("name", float) + self.assertEqual(f.type(), float) + + f = QSqlField("name", int) + self.assertEqual(f.type(), int) + + if not py3k.IS_PY3K: + f = QSqlField("name", long) + self.assertEqual(f.type(), int) # long isn't registered in QVariant:Type, just in QMetaType::Type + + #f = QSqlField("name", QObject) + #self.assertEqual(f.type(), None) + + f = QSqlField("name", None) + self.assertEqual(f.type(), None) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtSvg/CMakeLists.txt b/sources/pyside2/tests/QtSvg/CMakeLists.txt new file mode 100644 index 000000000..4f5e2805f --- /dev/null +++ b/sources/pyside2/tests/QtSvg/CMakeLists.txt @@ -0,0 +1,3 @@ +PYSIDE_TEST(qsvggenerator_test.py) +PYSIDE_TEST(qsvgrenderer_test.py) +PYSIDE_TEST(qsvgwidget_test.py) diff --git a/sources/pyside2/tests/QtSvg/qsvggenerator_test.py b/sources/pyside2/tests/QtSvg/qsvggenerator_test.py new file mode 100644 index 000000000..4605eb455 --- /dev/null +++ b/sources/pyside2/tests/QtSvg/qsvggenerator_test.py @@ -0,0 +1,63 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from sys import getrefcount +from PySide2.QtCore import QBuffer +from PySide2.QtSvg import QSvgGenerator + +class QSvgGeneratorTest(unittest.TestCase): + + def testRefCountOfTOutputDevice(self): + generator = QSvgGenerator() + iodevice1 = QBuffer() + refcount1 = getrefcount(iodevice1) + + generator.setOutputDevice(iodevice1) + + self.assertEqual(generator.outputDevice(), iodevice1) + self.assertEqual(getrefcount(generator.outputDevice()), refcount1 + 1) + + iodevice2 = QBuffer() + refcount2 = getrefcount(iodevice2) + + generator.setOutputDevice(iodevice2) + + self.assertEqual(generator.outputDevice(), iodevice2) + self.assertEqual(getrefcount(generator.outputDevice()), refcount2 + 1) + self.assertEqual(getrefcount(iodevice1), refcount1) + + del generator + + self.assertEqual(getrefcount(iodevice2), refcount2) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py new file mode 100644 index 000000000..976a2e5ac --- /dev/null +++ b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py @@ -0,0 +1,53 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest, os +from PySide2.QtCore import * +from PySide2.QtWidgets import * +from PySide2.QtSvg import * + +class QSvgRendererTest(unittest.TestCase): + + def testLoad(self): + tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg') + app = QApplication([]) + + fromFile = QSvgRenderer(tigerPath) + self.assertTrue(fromFile.isValid()) + + tigerFile = QFile(tigerPath) + tigerFile.open(QFile.ReadOnly) + tigerData = tigerFile.readAll() + fromContents = QSvgRenderer(tigerData) + self.assertTrue(fromContents.isValid()) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py b/sources/pyside2/tests/QtSvg/qsvgwidget_test.py new file mode 100644 index 000000000..31152f9ab --- /dev/null +++ b/sources/pyside2/tests/QtSvg/qsvgwidget_test.py @@ -0,0 +1,55 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest, os +from PySide2.QtCore import * +from PySide2.QtWidgets import * +from PySide2.QtSvg import * + +class QSvgWidgetTest(unittest.TestCase): + + def testLoad(self): + tigerPath = os.path.join(os.path.dirname(__file__), 'tiger.svg') + + app = QApplication([]) + fromFile = QSvgWidget() + fromFile.load(tigerPath) + self.assertTrue(fromFile.renderer().isValid()) + + tigerFile = QFile(tigerPath) + tigerFile.open(QFile.ReadOnly) + tigerData = tigerFile.readAll() + fromContents = QSvgWidget() + fromContents.load(tigerData) + self.assertTrue(fromContents.renderer().isValid()) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtSvg/tiger.svg b/sources/pyside2/tests/QtSvg/tiger.svg new file mode 100644 index 000000000..983e57026 --- /dev/null +++ b/sources/pyside2/tests/QtSvg/tiger.svg @@ -0,0 +1,730 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/pyside2/tests/QtTest/CMakeLists.txt b/sources/pyside2/tests/QtTest/CMakeLists.txt new file mode 100644 index 000000000..9d1e9db39 --- /dev/null +++ b/sources/pyside2/tests/QtTest/CMakeLists.txt @@ -0,0 +1,3 @@ +PYSIDE_TEST(click_test.py) +PYSIDE_TEST(eventfilter_test.py) +PYSIDE_TEST(touchevent_test.py) diff --git a/sources/pyside2/tests/QtTest/click_test.py b/sources/pyside2/tests/QtTest/click_test.py new file mode 100644 index 000000000..e655371ae --- /dev/null +++ b/sources/pyside2/tests/QtTest/click_test.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''QtTest mouse click functionalities''' + +import unittest + +from PySide2.QtCore import Qt, QObject +from PySide2.QtWidgets import QPushButton, QLineEdit +from PySide2.QtTest import QTest + +from helper import UsesQApplication + +class MouseClickTest(UsesQApplication): + + def testBasic(self): + '''QTest.mouseClick with QCheckBox''' + button = QPushButton() + button.setCheckable(True) + button.setChecked(False) + + QTest.mouseClick(button, Qt.LeftButton) + self.assertTrue(button.isChecked()) + + QTest.mouseClick(button, Qt.LeftButton) + self.assertFalse(button.isChecked()) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtTest/eventfilter_test.py b/sources/pyside2/tests/QtTest/eventfilter_test.py new file mode 100644 index 000000000..e94b279b7 --- /dev/null +++ b/sources/pyside2/tests/QtTest/eventfilter_test.py @@ -0,0 +1,75 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Tests for QKeyEvent''' + +import unittest + +from PySide2.QtCore import Qt, QObject, QEvent +from PySide2.QtGui import QKeyEvent +from PySide2.QtWidgets import QLineEdit +from PySide2.QtTest import QTest + +from helper import UsesQApplication + + +class KeyEventFilter(QObject): + + def __init__(self, widget, eventType, key): + QObject.__init__(self) + + self.widget = widget + self.eventType = eventType + self.key = key + + self.processed = False + + def eventFilter(self, obj, event): + if self.widget == obj and event.type() == self.eventType and \ + isinstance(event, QKeyEvent) and event.key() == self.key: + self.processed = True + return True + + return False + +class EventFilterTest(UsesQApplication): + + def testKeyEvent(self): + widget = QLineEdit() + key = Qt.Key_A + eventFilter = KeyEventFilter(widget, QEvent.KeyPress, key) + widget.installEventFilter(eventFilter) + + QTest.keyClick(widget, key) + + self.assertTrue(eventFilter.processed) + + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtTest/touchevent_test.py b/sources/pyside2/tests/QtTest/touchevent_test.py new file mode 100644 index 000000000..1a4fb94ee --- /dev/null +++ b/sources/pyside2/tests/QtTest/touchevent_test.py @@ -0,0 +1,77 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtWidgets import QWidget +from PySide2.QtCore import QPoint, QTimer, Qt, QEvent +from PySide2.QtGui import QTouchDevice +from PySide2.QtTest import QTest + +import unittest + +from helper import UsesQApplication + +class MyWidget(QWidget): + def __init__(self, parent = None): + QWidget.__init__(self, parent) + self._sequence = [] + # Fixme (Qt 5): The device needs to be registered (using + # QWindowSystemInterface::registerTouchDevice()) for the test to work + self._device = QTouchDevice() + self.setAttribute(Qt.WA_AcceptTouchEvents) + QTimer.singleShot(200, self.generateEvent) + + def event(self, e): + self._sequence.append(e.type()) + return QWidget.event(self, e) + + def generateEvent(self): + o = QTest.touchEvent(self, self._device) + o.press(0, QPoint(10, 10)) + o.commit() + del o + + QTest.touchEvent(self, self._device).press(0, QPoint(10, 10)) + QTest.touchEvent(self, self._device).stationary(0).press(1, QPoint(40, 10)) + QTest.touchEvent(self, self._device).move(0, QPoint(12, 12)).move(1, QPoint(45, 5)) + QTest.touchEvent(self, self._device).release(0, QPoint(12, 12)).release(1, QPoint(45, 5)) + QTimer.singleShot(200, self.deleteLater) + + +class TouchEventTest(UsesQApplication): + def testCreateEvent(self): + w = MyWidget() + w.show() + self.app.exec_() + # same values as C++ + self.assertEqual(w._sequence.count(QEvent.Type.TouchBegin), 2) + self.assertEqual(w._sequence.count(QEvent.Type.TouchUpdate), 2) + self.assertEqual(w._sequence.count(QEvent.Type.TouchEnd), 1) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/CMakeLists.txt b/sources/pyside2/tests/QtUiTools/CMakeLists.txt new file mode 100644 index 000000000..68ed7f134 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/CMakeLists.txt @@ -0,0 +1,13 @@ +PYSIDE_TEST(bug_360.py) +PYSIDE_TEST(bug_376.py) +PYSIDE_TEST(bug_392.py) +PYSIDE_TEST(bug_426.py) +PYSIDE_TEST(bug_552.py) +PYSIDE_TEST(bug_797.py) +PYSIDE_TEST(bug_909.py) +PYSIDE_TEST(bug_913.py) +PYSIDE_TEST(bug_958.py) +PYSIDE_TEST(bug_965.py) +PYSIDE_TEST(bug_1060.py) +PYSIDE_TEST(uiloader_test.py) +PYSIDE_TEST(ui_test.py) diff --git a/sources/pyside2/tests/QtUiTools/action.ui b/sources/pyside2/tests/QtUiTools/action.ui new file mode 100644 index 000000000..9eda559de --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/action.ui @@ -0,0 +1,16 @@ + + main_window + + + + + + + foo + + + + + + + diff --git a/sources/pyside2/tests/QtUiTools/bug_1060.py b/sources/pyside2/tests/QtUiTools/bug_1060.py new file mode 100644 index 000000000..21d79810a --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_1060.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' unit test for BUG #1060 ''' + +from PySide2.QtWidgets import QApplication +from PySide2.QtUiTools import QUiLoader +from helper import adjust_filename + +class MyQUiLoader(QUiLoader): + def __init__(self): + super(MyQUiLoader, self).__init__() + + def createWidget(self, *args): + return super(MyQUiLoader, self).createWidget(*args) + +if __name__ == "__main__": + app = QApplication([]) + + ui = MyQUiLoader().load(adjust_filename("bug_1060.ui", __file__)) + ui.show() diff --git a/sources/pyside2/tests/QtUiTools/bug_1060.ui b/sources/pyside2/tests/QtUiTools/bug_1060.ui new file mode 100644 index 000000000..f4044a8c2 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_1060.ui @@ -0,0 +1,19 @@ + + + Dialog + + + + 0 + 0 + 100 + 100 + + + + Dialog + + + + + diff --git a/sources/pyside2/tests/QtUiTools/bug_360.py b/sources/pyside2/tests/QtUiTools/bug_360.py new file mode 100644 index 000000000..6d2c2a4e3 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_360.py @@ -0,0 +1,64 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import os +from helper import UsesQApplication + +from PySide2 import QtCore, QtWidgets +from PySide2.QtUiTools import QUiLoader + +class MyQUiLoader(QUiLoader): + def __init__(self, baseinstance): + QUiLoader.__init__(self) + self.baseinstance = baseinstance + self._widgets = [] + + def createWidget(self, className, parent=None, name=""): + widget = QUiLoader.createWidget(self, className, parent, name) + self._widgets.append(widget) + if parent is None: + return self.baseinstance + else: + setattr(self.baseinstance, name, widget) + return widget + +class ButTest(UsesQApplication): + def testCase(self): + w = QtWidgets.QWidget() + loader = MyQUiLoader(w) + + filePath = os.path.join(os.path.dirname(__file__), 'minimal.ui') + ui = loader.load(filePath) + + self.assertEqual(len(loader._widgets), 1) + self.assertEqual(type(loader._widgets[0]), QtWidgets.QFrame) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtUiTools/bug_376.py b/sources/pyside2/tests/QtUiTools/bug_376.py new file mode 100644 index 000000000..64b5acbd1 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_376.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import os +from helper import UsesQApplication + +from PySide2 import QtCore, QtWidgets +from PySide2.QtUiTools import QUiLoader + +class BugTest(UsesQApplication): + def testCase(self): + w = QtWidgets.QWidget() + loader = QUiLoader() + + filePath = os.path.join(os.path.dirname(__file__), 'test.ui') + result = loader.load(filePath, w) + self.assertTrue(isinstance(result.child_object, QtWidgets.QFrame)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtUiTools/bug_392.py b/sources/pyside2/tests/QtUiTools/bug_392.py new file mode 100644 index 000000000..d788b29d6 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_392.py @@ -0,0 +1,75 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import os +from helper import UsesQApplication + +from PySide2 import QtWidgets +from PySide2.QtUiTools import QUiLoader + +class MyWidget(QtWidgets.QComboBox): + def __init__(self, parent=None): + QtWidgets.QComboBox.__init__(self, parent) + + def isPython(self): + return True + +class BugTest(UsesQApplication): + def testCase(self): + w = QtWidgets.QWidget() + loader = QUiLoader() + + filePath = os.path.join(os.path.dirname(__file__), 'action.ui') + result = loader.load(filePath, w) + self.assertTrue(isinstance(result.actionFoo, QtWidgets.QAction)) + + def testPythonCustomWidgets(self): + w = QtWidgets.QWidget() + loader = QUiLoader() + loader.registerCustomWidget(MyWidget) + + filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget.ui') + result = loader.load(filePath, w) + self.assertTrue(isinstance(result.custom, MyWidget)) + self.assertTrue(result.custom.isPython()) + + def testPythonCustomWidgetsTwice(self): + w = QtWidgets.QWidget() + loader = QUiLoader() + loader.registerCustomWidget(MyWidget) + + filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget2.ui') + result = loader.load(filePath, w) + self.assertTrue(isinstance(result.custom, MyWidget)) + self.assertTrue(isinstance(result.custom2, MyWidget)) + self.assertTrue(result.custom.isPython()) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtUiTools/bug_426.py b/sources/pyside2/tests/QtUiTools/bug_426.py new file mode 100644 index 000000000..eac350a42 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_426.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import os +from PySide2 import QtCore, QtWidgets +from PySide2.QtUiTools import QUiLoader + +class Window(object): + def __init__(self): + loader = QUiLoader() + filePath = os.path.join(os.path.dirname(__file__), 'bug_426.ui') + self.widget = loader.load(filePath) + self.group = QtWidgets.QActionGroup(self.widget) + self.widget.show() + QtCore.QTimer.singleShot(0, self.widget.close) + +if __name__ == "__main__": + app = QtWidgets.QApplication(sys.argv) + win = Window() + sys.exit(app.exec_()) diff --git a/sources/pyside2/tests/QtUiTools/bug_426.ui b/sources/pyside2/tests/QtUiTools/bug_426.ui new file mode 100644 index 000000000..99353cd2b --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_426.ui @@ -0,0 +1,19 @@ + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + diff --git a/sources/pyside2/tests/QtUiTools/bug_552.py b/sources/pyside2/tests/QtUiTools/bug_552.py new file mode 100644 index 000000000..34165aa00 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_552.py @@ -0,0 +1,49 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from helper import adjust_filename +from PySide2 import QtWidgets, QtCore +from PySide2.QtUiTools import QUiLoader + +class View_1(QtWidgets.QWidget): + + def __init__(self): + QtWidgets.QWidget.__init__(self) + loader = QUiLoader() + widget = loader.load(adjust_filename('bug_552.ui', __file__), self) + self.children = [] + for child in widget.findChildren(QtCore.QObject, None): + self.children.append(child) + self.t = widget.tabWidget + self.t.removeTab(0) + +app = QtWidgets.QApplication([]) +window = View_1() +window.show() + +# If it doesn't crash it works :-) diff --git a/sources/pyside2/tests/QtUiTools/bug_552.ui b/sources/pyside2/tests/QtUiTools/bug_552.ui new file mode 100644 index 000000000..f98da4421 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_552.ui @@ -0,0 +1,42 @@ + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + 130 + 80 + 139 + 80 + + + + 0 + + + + Tab 1 + + + + + Tab 2 + + + + + + + diff --git a/sources/pyside2/tests/QtUiTools/bug_797.py b/sources/pyside2/tests/QtUiTools/bug_797.py new file mode 100644 index 000000000..476368d2f --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_797.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2 import QtUiTools +from PySide2 import QtCore +from PySide2 import QtWidgets +from helper import adjust_filename + +app = QtWidgets.QApplication([]) +loader = QtUiTools.QUiLoader() +file = QtCore.QFile(adjust_filename('bug_552.ui', __file__)) +w = QtWidgets.QWidget() +# An exception can't be thrown +mainWindow = loader.load(file, w) diff --git a/sources/pyside2/tests/QtUiTools/bug_909.py b/sources/pyside2/tests/QtUiTools/bug_909.py new file mode 100644 index 000000000..2b6bfbd4e --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_909.py @@ -0,0 +1,52 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest + +from PySide2.QtCore import QFile +from PySide2.QtWidgets import QTabWidget +from PySide2.QtUiTools import QUiLoader + +from helper import UsesQApplication +from helper import adjust_filename + +class TestDestruction(UsesQApplication): + def testBug909(self): + fileName = QFile(adjust_filename('bug_909.ui', __file__)) + loader = QUiLoader() + main_win = loader.load(fileName) + self.assertEqual(sys.getrefcount(main_win), 2) + fileName.close() + + tw = QTabWidget(main_win) + main_win.setCentralWidget(tw) + main_win.show() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/bug_909.ui b/sources/pyside2/tests/QtUiTools/bug_909.ui new file mode 100644 index 000000000..b07f62d05 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_909.ui @@ -0,0 +1,31 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + 0 + 0 + 800 + 25 + + + + + + + + diff --git a/sources/pyside2/tests/QtUiTools/bug_913.py b/sources/pyside2/tests/QtUiTools/bug_913.py new file mode 100644 index 000000000..d249ce958 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_913.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest +from helper import adjust_filename + +from PySide2.QtCore import * +from PySide2.QtWidgets import * +from PySide2.QtUiTools import * + +class TestBug913 (unittest.TestCase): + + def testIt(self): + app = QApplication([]) + + loader = QUiLoader() + widget = loader.load(adjust_filename('bug_913.ui', __file__)) + widget.tabWidget.currentIndex() # direct child is available as member + widget.le_first.setText('foo') # child of QTabWidget must also be available! + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/bug_913.ui b/sources/pyside2/tests/QtUiTools/bug_913.ui new file mode 100644 index 000000000..0fc95fd53 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_913.ui @@ -0,0 +1,57 @@ + + + Form + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + + Tab 1 + + + + + + First name: + + + + + + + + + + Last name: + + + + + + + + + + + Tab 2 + + + + + + + + + diff --git a/sources/pyside2/tests/QtUiTools/bug_958.py b/sources/pyside2/tests/QtUiTools/bug_958.py new file mode 100644 index 000000000..9cae430ea --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_958.py @@ -0,0 +1,52 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import QtWidgets, QtUiTools +from helper import adjust_filename +from helper import TimedQApplication + +class Gui_Qt(QtWidgets.QMainWindow): + def __init__(self, parent=None): + super(Gui_Qt, self).__init__(parent) + + lLoader = QtUiTools.QUiLoader() + + # this used to cause a segfault because the old inject code used to destroy the parent layout + self._cw = lLoader.load(adjust_filename('bug_958.ui', __file__), self) + + self.setCentralWidget(self._cw) + +class BugTest(TimedQApplication): + def testCase(self): + lMain = Gui_Qt() + lMain.show() + self.app.exec_() + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/bug_958.ui b/sources/pyside2/tests/QtUiTools/bug_958.ui new file mode 100644 index 000000000..57cdbddba --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_958.ui @@ -0,0 +1,48 @@ + + + customWidget + + + + 0 + 0 + 626 + 578 + + + + + 500 + 0 + + + + Form + + + + + + + + + 0 + + + + + + + + + &Berechnen + + + + + + + + + + diff --git a/sources/pyside2/tests/QtUiTools/bug_965.py b/sources/pyside2/tests/QtUiTools/bug_965.py new file mode 100644 index 000000000..96235cd4d --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_965.py @@ -0,0 +1,48 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtUiTools import QUiLoader +import unittest + +from helper import UsesQApplication +from helper import adjust_filename + +class MyQUiLoader(QUiLoader): + def __init__(self): + super(MyQUiLoader, self).__init__() + + def createWidget(self, className, parent=None, name=""): + return None + +class BugTest(UsesQApplication): + def testCase(self): + loader = MyQUiLoader() + self.assertRaises(RuntimeError, loader.load, adjust_filename('bug_965.ui', __file__)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/bug_965.ui b/sources/pyside2/tests/QtUiTools/bug_965.ui new file mode 100644 index 000000000..e324db829 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/bug_965.ui @@ -0,0 +1,27 @@ + + + + + MainWindow + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + + diff --git a/sources/pyside2/tests/QtUiTools/minimal.ui b/sources/pyside2/tests/QtUiTools/minimal.ui new file mode 100644 index 000000000..c6bb70cda --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/minimal.ui @@ -0,0 +1,6 @@ + + + Form + + + diff --git a/sources/pyside2/tests/QtUiTools/pycustomwidget.ui b/sources/pyside2/tests/QtUiTools/pycustomwidget.ui new file mode 100644 index 000000000..c066153a0 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/pycustomwidget.ui @@ -0,0 +1,36 @@ + + + qwidget + + + + 0 + 0 + 400 + 300 + + + + + + + + + 10 + 10 + 79 + 23 + + + + + + + MyWidget + QComboBox +
customwidget
+
+
+ + +
diff --git a/sources/pyside2/tests/QtUiTools/pycustomwidget2.ui b/sources/pyside2/tests/QtUiTools/pycustomwidget2.ui new file mode 100644 index 000000000..8826ac1fb --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/pycustomwidget2.ui @@ -0,0 +1,48 @@ + + + qwidget + + + + 0 + 0 + 400 + 300 + + + + + + + + + + 10 + 10 + 79 + 23 + + + + + + + + 10 + 10 + 79 + 23 + + + + + + + MyWidget + QComboBox +
customwidget
+
+
+ + +
diff --git a/sources/pyside2/tests/QtUiTools/test.ui b/sources/pyside2/tests/QtUiTools/test.ui new file mode 100644 index 000000000..60afe22b3 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/test.ui @@ -0,0 +1,48 @@ + + + Form + + + + 0 + 0 + 185 + 133 + + + + Form + + + + + 0 + 0 + 181 + 131 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 50 + 60 + 80 + 25 + + + + PushButton + + + + + + + diff --git a/sources/pyside2/tests/QtUiTools/ui_test.py b/sources/pyside2/tests/QtUiTools/ui_test.py new file mode 100644 index 000000000..e52d28278 --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/ui_test.py @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtUiTools import QUiLoader + +from helper import UsesQApplication + +class QUiLoaderCreation(UsesQApplication): + + def testConstructor(self): + loader = QUiLoader() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtUiTools/uiloader_test.py b/sources/pyside2/tests/QtUiTools/uiloader_test.py new file mode 100644 index 000000000..e429f5adc --- /dev/null +++ b/sources/pyside2/tests/QtUiTools/uiloader_test.py @@ -0,0 +1,71 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import os +from helper import UsesQApplication + +from PySide2.QtWidgets import QWidget +from PySide2.QtUiTools import QUiLoader + +def get_file_path(): + for path in file_path: + if os.path.exists(path): + return path + return "" + +class QUioaderTeste(UsesQApplication): + def testLoadFile(self): + filePath = os.path.join(os.path.dirname(__file__), 'test.ui') + loader = QUiLoader() + parent = QWidget() + w = loader.load(filePath, parent) + self.assertNotEqual(w, None) + + self.assertEqual(len(parent.children()), 1) + + child = w.findChild(QWidget, "child_object") + self.assertNotEqual(child, None) + self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object")) + + def testLoadFileUnicodeFilePath(self): + filePath = str(os.path.join(os.path.dirname(__file__), 'test.ui')) + loader = QUiLoader() + parent = QWidget() + w = loader.load(filePath, parent) + self.assertNotEqual(w, None) + + self.assertEqual(len(parent.children()), 1) + + child = w.findChild(QWidget, "child_object") + self.assertNotEqual(child, None) + self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object")) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWebChannel/CMakeLists.txt b/sources/pyside2/tests/QtWebChannel/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtWebChannel/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtWebChannel/this_module_loads_test.py b/sources/pyside2/tests/QtWebChannel/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtWebChannel/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtWebEngine/CMakeLists.txt b/sources/pyside2/tests/QtWebEngine/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtWebEngine/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtWebEngine/this_module_loads_test.py b/sources/pyside2/tests/QtWebEngine/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtWebEngine/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtWebEngineWidgets/CMakeLists.txt b/sources/pyside2/tests/QtWebEngineWidgets/CMakeLists.txt new file mode 100644 index 000000000..0276d19a1 --- /dev/null +++ b/sources/pyside2/tests/QtWebEngineWidgets/CMakeLists.txt @@ -0,0 +1,29 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +PYSIDE_TEST(pyside-474-qtwebengineview.py) diff --git a/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py b/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py new file mode 100644 index 000000000..c6114361d --- /dev/null +++ b/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py @@ -0,0 +1,49 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import unittest + +from PySide2 import QtWidgets +from PySide2 import QtWebEngineWidgets + +class MainTest(unittest.TestCase): + + def test_WebEngineView_findText_exists(self): + qApp = (QtWidgets.QApplication.instance() or + QtWidgets.QApplication([])) + view = QtWebEngineWidgets.QWebEngineView() + with self.assertRaises(TypeError): + view.findText(123) + view.findText("nothing") + # we are testing only the existence of the function, + # after it suddenly showed up. + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebEngineWidgets/this_module_loads_test.py b/sources/pyside2/tests/QtWebEngineWidgets/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtWebEngineWidgets/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtWebKit/CMakeLists.txt b/sources/pyside2/tests/QtWebKit/CMakeLists.txt new file mode 100644 index 000000000..7fab64773 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/CMakeLists.txt @@ -0,0 +1,11 @@ +PYSIDE_TEST(bug_448.py) +PYSIDE_TEST(bug_694.py) +PYSIDE_TEST(bug_803.py) +PYSIDE_TEST(bug_899.py) +PYSIDE_TEST(bug_959.py) +PYSIDE_TEST(qvariantlist_property_test.py) +PYSIDE_TEST(qml_plugin_test.py) +PYSIDE_TEST(shouldInterruptjavascript_test.py) +PYSIDE_TEST(webpage_test.py) +PYSIDE_TEST(webview_test.py) +PYSIDE_TEST(webframe_test.py) diff --git a/sources/pyside2/tests/QtWebKit/bug_448.py b/sources/pyside2/tests/QtWebKit/bug_448.py new file mode 100644 index 000000000..2c50bd166 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/bug_448.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for bug: http://bugs.openbossa.org/show_bug.cgi?id=448''' + +import unittest +import sys + +from PySide2.QtWidgets import QApplication +from PySide2.QtWebKit import QWebView + +class Bug448(unittest.TestCase): + def onError(self, erros): + pass + + def testReturnOwnership(self): + app = QApplication(sys.argv) + webview = QWebView() + webview.page().networkAccessManager().sslErrors.connect(self.onError) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/bug_694.py b/sources/pyside2/tests/QtWebKit/bug_694.py new file mode 100644 index 000000000..f59c08b04 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/bug_694.py @@ -0,0 +1,78 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest +from PySide2.QtCore import * +from PySide2.QtWidgets import * +from PySide2.QtWebKit import * + +class ErrorPage (QWebPage): + + def __init__(self): + QWebPage.__init__(self) + self.rcv_extension = None + self.rcv_url = None + self.rcv_url_copy = None + self.rcv_option_type = None + self.rcv_output_type = None + + + def supportsExtension(self, extension): + return extension == QWebPage.ErrorPageExtension + + def extension(self, extension, option, output): + self.rcv_extension = extension + self.rcv_url = option.url + self.rcv_url_copy = QUrl(option.url) + self.rcv_option_type = type(option) + self.rcv_output_type = type(output) + return True + +class TestWebPageExtension(unittest.TestCase): + def testIt(self): + app = QApplication([]) + ep = ErrorPage() + view = QWebView() + view.setPage(ep) + view.load("foo://bar") # Some malformmed url + view.show() + + # If the timeout is 0 the webpage isn't even loaded on Qt4.6-i386, so we use 100 :-) + QTimer.singleShot(100, app.quit) + app.exec_() + + self.assertEqual(ep.rcv_extension, QWebPage.ErrorPageExtension) + self.assertRaises(RuntimeError, ep.rcv_url.__str__) + + self.assertEqual(ep.rcv_url_copy, "foo://bar") + self.assertEqual(ep.rcv_option_type, QWebPage.ErrorPageExtensionOption) + self.assertEqual(ep.rcv_output_type, QWebPage.ErrorPageExtensionReturn) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/bug_803.py b/sources/pyside2/tests/QtWebKit/bug_803.py new file mode 100644 index 000000000..23b670f9c --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/bug_803.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtWidgets import * +from PySide2.QtWebKit import * + +class TestBug803 (unittest.TestCase): + + def testIt(self): + app = QApplication([]) + page = QWebPage() + frame = page.mainFrame() + frame.setHtml("

1

2

") + elems = frame.findAllElements("p") + self.assertEqual(len(elems), 2) + self.assertEqual(elems[0].toPlainText(), "1") + self.assertEqual(elems[1].toPlainText(), "2") + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/bug_899.py b/sources/pyside2/tests/QtWebKit/bug_899.py new file mode 100644 index 000000000..edd705c8e --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/bug_899.py @@ -0,0 +1,64 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import Property, QObject +from PySide2.QtWebKit import QWebView +from helper import TimedQApplication + +class TestLambdaPropery(TimedQApplication): + + def testBug899(self): + html = ''' + + + + ''' + + class Obj(object): + list1 = ['foo', 'bar', 'baz'] + list2 = ['fi', 'fo', 'fum'] + + obj = Obj() + + wrapper_dict = {} + for name in ('list1', 'list2'): + getter = lambda arg=None, name=name: getattr(obj, name) + wrapper_dict[name] = Property('QVariantList', getter) + wrapper = type('PyObj', (QObject,), wrapper_dict) + + view = QWebView() + view.page().mainFrame().addToJavaScriptWindowObject('py_obj', wrapper()) + view.setHtml(html) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/bug_959.py b/sources/pyside2/tests/QtWebKit/bug_959.py new file mode 100644 index 000000000..22f217bee --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/bug_959.py @@ -0,0 +1,128 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import QObject, Slot, QTimer +from PySide2.QtWebKit import QWebView +from PySide2.QtWidgets import QApplication +from PySide2 import QtCore + +import sys +import unittest + +from helper import UsesQApplication + +functionID = -1 +currentWebView = None + +class JSFuncs(QObject): + @Slot(str,result=str) + def slot_str_str(self, x): + global functionID + functionID = 0 + return x.upper() + + @Slot(str,result='QVariant') + def slot_str_list(self, x): + global functionID + functionID = 1 + return [x, x] + + @Slot('QStringList',result=str) + def slot_strlist_str(self, x): + global functionID + functionID = 2 + return x[-1] + + @Slot('QVariant',result=str) + def slot_variant_str(self, x): + global functionID + functionID = 3 + return str(x) + + @Slot('QVariantList',result=str) + def slot_variantlist_str(self, x): + global functionID + functionID = 4 + return str(x[-1]) + + @Slot('QVariantMap',result=str) + def slot_variantmap_str(self, x): + global functionID + functionID = 5 + return str(x["foo"]) + + + +PAGE_DATA = "data:text/html," +FUNCTIONS_LIST = ['jsfuncs.slot_str_str("hello")', + 'jsfuncs.slot_str_list("hello")', + 'jsfuncs.slot_strlist_str(["hello","world"])', + 'jsfuncs.slot_variant_str("hello")', + 'jsfuncs.slot_variantlist_str(["hello","world"])', + 'jsfuncs.slot_variantmap_str({"foo": "bar"})'] + + +def onLoadFinished( result ): + QTimer.singleShot( 100, createNextWebView ) + +def createNextWebView(): + global functionID + + nListCount = len(FUNCTIONS_LIST) - 1 + functionID = functionID + 1 + print functionID + + if functionID < nListCount: + createWebView( functionID ) + else: + QTimer.singleShot(300, QApplication.instance().quit) + + +def createWebView( nIndex ): + global functionID + global currentWebView + + functionID = nIndex + currentWebView = QWebView() + currentWebView._jsfuncs = JSFuncs() + currentWebView.page().mainFrame().addToJavaScriptWindowObject("jsfuncs", currentWebView._jsfuncs) + QObject.connect( currentWebView, QtCore.SIGNAL('loadFinished( bool )'), onLoadFinished ) + currentWebView.load(PAGE_DATA % FUNCTIONS_LIST[ nIndex ]) + currentWebView.show() + +class Bug959(UsesQApplication): + + def testJavaScriptInWebViewForCrash( self ): + # wait for the webview load to be finished before creating the next webview + # don't create the webview inside of onLoadFinished + # also call onLoadFinished with the correct number of variables + createNextWebView() + self.app.exec_() + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/fox.html b/sources/pyside2/tests/QtWebKit/fox.html new file mode 100644 index 000000000..da873b1cc --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/fox.html @@ -0,0 +1,7 @@ + +Title + + +

The quick brown fox jumps over the lazy dog.

+ + diff --git a/sources/pyside2/tests/QtWebKit/qml_plugin_test.py b/sources/pyside2/tests/QtWebKit/qml_plugin_test.py new file mode 100644 index 000000000..d7e855ce8 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/qml_plugin_test.py @@ -0,0 +1,88 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import os +import sys +import unittest + +from PySide2.QtCore import QUrl, QTimer +from PySide2.QtWidgets import QApplication, QLabel +from PySide2.QtWebKit import QWebPluginFactory, QWebView, QWebSettings + +from helper import UsesQApplication + +class PluginFactory(QWebPluginFactory): + + def plugins(self): + plugins = [] + + mime = self.MimeType() + mime.name = 'DummyFile' + mime.fileExtensions = ['.pys'] + + plugin = self.Plugin() + plugin.name = 'DummyPlugin' + plugin.mimeTypes = [mime] + + plugins.append(plugin) + + return plugins + + def create(self, mimeType, url, argumentNames, argumentValues): + if mimeType != 'application/x-dummy': + return None + + for name, value in zip(argumentNames, argumentValues): + if name == 'text': + text = value + else: + text = "Webkit plugins!" + + widget = QLabel(text) + return widget + +class TestPlugin(UsesQApplication): + + def testPlugin(self): + view = QWebView() + fac = PluginFactory() + view.page().setPluginFactory(fac) + QWebSettings.globalSettings().setAttribute(QWebSettings.PluginsEnabled, True) + + view.load(QUrl(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'qmlplugin', 'index.html'))) + + view.resize(840, 600) + view.show() + + QTimer.singleShot(500, self.app.quit) + + self.app.exec_() + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys b/sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys new file mode 100644 index 000000000..0b7469da4 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/qmlplugin/dummy.pys @@ -0,0 +1 @@ +Foobar! diff --git a/sources/pyside2/tests/QtWebKit/qmlplugin/index.html b/sources/pyside2/tests/QtWebKit/qmlplugin/index.html new file mode 100644 index 000000000..db0d6b5b2 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/qmlplugin/index.html @@ -0,0 +1,5 @@ + +

Custom Plugin

+ + + diff --git a/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py b/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py new file mode 100644 index 000000000..c33b2d1fe --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py @@ -0,0 +1,71 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import Property, QObject +from PySide2.QtWebKit import QWebView +from helper import TimedQApplication + +class TestLoadFinished(TimedQApplication): + + def setUp(self): + TimedQApplication.setUp(self, timeout=1000) + + def tearDown(self): + TimedQApplication.tearDown(self) + + def testQVariantListProperty(self): + class Obj(object): + list = ['foo', 'bar', 'baz'] + + obj = Obj() + + wrapper_dict = {} + for name in ['list']: + getter = lambda arg=None, name=name: getattr(obj, name) + wrapper_dict[name] = Property('QVariantList', getter) + wrapper = type('PyObj', (QObject,), wrapper_dict) + + view = QWebView() + frame = view.page().mainFrame() + frame.addToJavaScriptWindowObject('py_obj', wrapper()) + + html = ''' + + + + ''' + view.setHtml(html) + view.show() + self.app.exec_() + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py b/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py new file mode 100644 index 000000000..7c9763f2e --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import QtCore, QtWebKit + +from helper import UsesQApplication + +class QWebPageHeadless(QtWebKit.QWebPage): + # FIXME: This is not working, the slot is not overriden! + # http://doc.qt.nokia.com/4.7-snapshot/qwebpage.html#shouldInterruptJavaScript + @QtCore.Slot() + def shouldInterruptJavaScript(self): + self._interrupted = True + QtCore.QTimer.singleShot(300, self._app.quit) + return True + +class TestSlotOverride(UsesQApplication): + def testFunctionCall(self): + page = QWebPageHeadless() + page._interrupted = False + page._app = self.app + page.mainFrame().setHtml('') + self.app.exec_() + self.assertTrue(page._interrupted) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/webframe_test.py b/sources/pyside2/tests/QtWebKit/webframe_test.py new file mode 100644 index 000000000..e82ae5279 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/webframe_test.py @@ -0,0 +1,62 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys + +from PySide2.QtCore import QObject, SIGNAL, QUrl +from PySide2.QtWebKit import * +from PySide2.QtNetwork import QNetworkRequest + +from helper import adjust_filename, UsesQApplication + + + +class TestWebFrame(UsesQApplication): + def load_finished(self, ok): + self.assertTrue(ok) + page = self.view.page() + self.assertTrue(page) + frame = page.mainFrame() + self.assertTrue(frame) + meta = frame.metaData() + self.assertEqual(meta['description'], ['PySide Test METADATA.']) + self.app.quit() + + def testMetaData(self): + self.view = QWebView() + QObject.connect(self.view, SIGNAL('loadFinished(bool)'), + self.load_finished) + url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__)) + self.view.setUrl(url) + self.app.exec_() + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWebKit/webpage_test.py b/sources/pyside2/tests/QtWebKit/webpage_test.py new file mode 100644 index 000000000..1abb6be49 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/webpage_test.py @@ -0,0 +1,88 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QWebPage''' + +import unittest + +from PySide2.QtCore import QObject, SIGNAL, QUrl +from PySide2.QtWebKit import QWebPage +from PySide2.QtNetwork import QNetworkAccessManager + +from helper import adjust_filename, TimedQApplication + +#Define a global timeout because TimedQApplication uses a singleton! +#Use a value big enough to run all the tests. +TIMEOUT = 1000 + +class TestFindText(TimedQApplication): + '''Test cases for finding text''' + + def setUp(self): + TimedQApplication.setUp(self, timeout=TIMEOUT) + self.page = QWebPage() + QObject.connect(self.page, SIGNAL('loadFinished(bool)'), + self.load_finished) + self.called = False + + def tearDown(self): + #Release resources + del self.page + self.called = False + TimedQApplication.tearDown(self) + + def testFindSelectText(self): + url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__)) + self.page.mainFrame().load(url) + self.app.exec_() + self.assertTrue(self.called) + + def load_finished(self, ok): + #Callback to check if load was successful + if ok: + self.called = True + self.assertTrue(self.page.findText('fox')) + self.assertEqual(self.page.selectedText(), 'fox') + self.app.quit() + +class SetNetworkAccessManagerCase(TimedQApplication): + + def setUp(self): + TimedQApplication.setUp(self, timeout=TIMEOUT) + + def testSetNetworkAccessManager(self): + page = QWebPage() + manager = QNetworkAccessManager() + page.setNetworkAccessManager(manager) + + def testNetWorkAccessManager(self): + page = QWebPage() + a = page.networkAccessManager() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebKit/webview_test.py b/sources/pyside2/tests/QtWebKit/webview_test.py new file mode 100644 index 000000000..f6c82e045 --- /dev/null +++ b/sources/pyside2/tests/QtWebKit/webview_test.py @@ -0,0 +1,94 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QWebView''' + +import unittest +import py3kcompat as py3k +import sys + +from PySide2.QtCore import QObject, SIGNAL, QUrl +from PySide2.QtWebKit import QWebPage, QWebView +from PySide2.QtNetwork import QNetworkRequest + +from helper import adjust_filename, TimedQApplication + + +class testWebPage(QWebPage): + def sayMyName(self): + return 'testWebPage' + +class TestLoadFinished(TimedQApplication): + '''Test case for signal QWebView.loadFinished(bool)''' + + def setUp(self): + #Acquire resources + TimedQApplication.setUp(self, timeout=1000) + self.view = QWebView() + QObject.connect(self.view, SIGNAL('loadFinished(bool)'), + self.load_finished) + self.called = False + + def tearDown(self): + #Release resources + del self.view + self.called = False + TimedQApplication.tearDown(self) + + def testLoadFinishedFromFile(self): + url = QUrl.fromLocalFile(adjust_filename('fox.html', __file__)) + self.view.setUrl(url) + self.app.exec_() + + self.assertTrue(self.called) + + def testSetPageAndGetPage(self): + twp = testWebPage() + self.view.setPage(twp) + del twp + p = self.view.page() + self.assertEqual(p.sayMyName(), 'testWebPage') + + # Setting the same webpage should not incref the python obj + refCount = sys.getrefcount(p) + self.view.setPage(p) + self.assertEqual(sys.getrefcount(p), refCount) + + # Changing the webpage obj should decref the old one + twp2 = testWebPage() + self.view.setPage(twp2) + self.assertEqual(sys.getrefcount(p), refCount - 1) + + def load_finished(self, ok): + #Callback to check if load was successful + self.app.quit() + if ok: + self.called = True + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWebKitWidgets/CMakeLists.txt b/sources/pyside2/tests/QtWebKitWidgets/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtWebKitWidgets/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtWebKitWidgets/this_module_loads_test.py b/sources/pyside2/tests/QtWebKitWidgets/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtWebKitWidgets/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtWebSockets/CMakeLists.txt b/sources/pyside2/tests/QtWebSockets/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtWebSockets/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtWebSockets/this_module_loads_test.py b/sources/pyside2/tests/QtWebSockets/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtWebSockets/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtWidgets/CMakeLists.txt b/sources/pyside2/tests/QtWidgets/CMakeLists.txt new file mode 100644 index 000000000..3c31b1d7d --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/CMakeLists.txt @@ -0,0 +1,134 @@ +#Keep this in alphabetical sort + +PYSIDE_TEST(action_clear.py) +PYSIDE_TEST(add_action_test.py) +PYSIDE_TEST(api2_test.py) +PYSIDE_TEST(application_test.py) +PYSIDE_TEST(bug_172.py) +PYSIDE_TEST(bug_243.py) +PYSIDE_TEST(bug_307.py) +PYSIDE_TEST(bug_324.py) +PYSIDE_TEST(bug_338.py) +PYSIDE_TEST(bug_363.py) +PYSIDE_TEST(bug_389.py) +PYSIDE_TEST(bug_400.py) +PYSIDE_TEST(bug_416.py) +PYSIDE_TEST(bug_429.py) +PYSIDE_TEST(bug_430.py) +PYSIDE_TEST(bug_433.py) +PYSIDE_TEST(bug_467.py) +PYSIDE_TEST(bug_493.py) +PYSIDE_TEST(bug_512.py) +PYSIDE_TEST(bug_525.py) +PYSIDE_TEST(bug_546.py) +PYSIDE_TEST(bug_547.py) +PYSIDE_TEST(bug_549.py) +PYSIDE_TEST(bug_569.py) +PYSIDE_TEST(bug_575.py) +PYSIDE_TEST(bug_576.py) +PYSIDE_TEST(bug_585.py) +PYSIDE_TEST(bug_589.py) +PYSIDE_TEST(bug_632.py) +PYSIDE_TEST(bug_635.py) +PYSIDE_TEST(bug_640.py) +PYSIDE_TEST(bug_653.py) +PYSIDE_TEST(bug_662.py) +PYSIDE_TEST(bug_667.py) +PYSIDE_TEST(bug_668.py) +PYSIDE_TEST(bug_674.py) +PYSIDE_TEST(bug_675.py) +PYSIDE_TEST(bug_688.py) +PYSIDE_TEST(bug_693.py) +PYSIDE_TEST(bug_696.py) +PYSIDE_TEST(bug_711.py) +PYSIDE_TEST(bug_714.py) +PYSIDE_TEST(bug_722.py) +PYSIDE_TEST(bug_728.py) +PYSIDE_TEST(bug_736.py) +PYSIDE_TEST(bug_750.py) +PYSIDE_TEST(bug_778.py) +PYSIDE_TEST(bug_785.py) +PYSIDE_TEST(bug_793.py) +PYSIDE_TEST(bug_811.py) +PYSIDE_TEST(bug_834.py) +PYSIDE_TEST(bug_836.py) +PYSIDE_TEST(bug_844.py) +PYSIDE_TEST(bug_854.py) +PYSIDE_TEST(bug_860.py) +PYSIDE_TEST(bug_862.py) +PYSIDE_TEST(bug_871.py) +PYSIDE_TEST(bug_879.py) +PYSIDE_TEST(bug_919.py) +PYSIDE_TEST(bug_921.py) +PYSIDE_TEST(bug_941.py) +PYSIDE_TEST(bug_964.py) +PYSIDE_TEST(bug_967.py) +PYSIDE_TEST(bug_972.py) +PYSIDE_TEST(bug_979.py) +PYSIDE_TEST(bug_988.py) +PYSIDE_TEST(bug_998.py) +PYSIDE_TEST(bug_1002.py) +PYSIDE_TEST(bug_1006.py) +PYSIDE_TEST(bug_1048.py) +PYSIDE_TEST(bug_1077.py) +PYSIDE_TEST(customproxywidget_test.py) +PYSIDE_TEST(event_filter_test.py) +PYSIDE_TEST(grandparent_method_test.py) +PYSIDE_TEST(hashabletype_test.py) +PYSIDE_TEST(keep_reference_test.py) +PYSIDE_TEST(missing_symbols_test.py) +PYSIDE_TEST(paint_event_test.py) +PYSIDE_TEST(parent_method_test.py) +PYSIDE_TEST(python_properties_test.py) +PYSIDE_TEST(qabstracttextdocumentlayout_test.py) +PYSIDE_TEST(qaction_test.py) +PYSIDE_TEST(qapp_test.py) +PYSIDE_TEST(qapplication_exit_segfault_test.py) +PYSIDE_TEST(qapplication_singleton_test.py) +PYSIDE_TEST(qbrush_test.py) +PYSIDE_TEST(qdynamic_signal.py) +# TODO: This passes, but requires manual button clicking (at least on mac) +#PYSIDE_TEST(qfontdialog_test.py) +PYSIDE_TEST(qformlayout_test.py) +PYSIDE_TEST(qgraphicsitem_test.py) +PYSIDE_TEST(qgraphicsitem_isblocked_test.py) +PYSIDE_TEST(qgraphicsproxywidget_test.py) +PYSIDE_TEST(qgraphicsscene_test.py) +PYSIDE_TEST(qimage_test.py) +PYSIDE_TEST(qinputdialog_get_test.py) +PYSIDE_TEST(qkeysequenceedit_test.py) +PYSIDE_TEST(qlayout_ref_test.py) +PYSIDE_TEST(qlayout_test.py) +PYSIDE_TEST(qlcdnumber_test.py) +PYSIDE_TEST(qlistwidget_test.py) +PYSIDE_TEST(qlistwidgetitem_test.py) +PYSIDE_TEST(qmainwindow_test.py) +PYSIDE_TEST(qmenu_test.py) +PYSIDE_TEST(qmenuadd_test.py) +PYSIDE_TEST(qobject_mi_test.py) +PYSIDE_TEST(qpen_test.py) +PYSIDE_TEST(qpicture_test.py) +PYSIDE_TEST(qpixmap_constructor.py) +PYSIDE_TEST(qpushbutton_test.py) +PYSIDE_TEST(qshortcut_test.py) +PYSIDE_TEST(qsplitter_test.py) +PYSIDE_TEST(qstandarditemmodel_test.py) +PYSIDE_TEST(qstring_qkeysequence_test.py) +PYSIDE_TEST(qstyle_test.py) +PYSIDE_TEST(qtableview_test.py) +PYSIDE_TEST(qtabwidget_test.py) +PYSIDE_TEST(qtextedit_test.py) +PYSIDE_TEST(qtextedit_signal_test.py) +PYSIDE_TEST(qtoolbar_test.py) +PYSIDE_TEST(qtoolbox_test.py) +PYSIDE_TEST(qvalidator_test.py) +PYSIDE_TEST(qvariant_test.py) +PYSIDE_TEST(qwidget_setlayout_test.py) +PYSIDE_TEST(qwidget_test.py) +PYSIDE_TEST(reference_count_test.py) +PYSIDE_TEST(returnquadruplesofnumbers_test.py) +PYSIDE_TEST(standardpixmap_test.py) +PYSIDE_TEST(test_module_template.py) +PYSIDE_TEST(virtual_protected_inheritance_test.py) +PYSIDE_TEST(virtual_pure_override_test.py) +PYSIDE_TEST(wrong_return_test.py) diff --git a/sources/pyside2/tests/QtWidgets/action_clear.py b/sources/pyside2/tests/QtWidgets/action_clear.py new file mode 100644 index 000000000..72ea41e08 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/action_clear.py @@ -0,0 +1,74 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtWidgets import QMenu, QWidget, QMenuBar, QToolBar +import weakref + +import unittest +from helper import UsesQApplication + + +class TestQActionLifeCycle(UsesQApplication): + def actionDestroyed(self, act): + self._actionDestroyed = True + + def testMenu(self): + self._actionDestroyed = False + w = QWidget() + menu = QMenu(w) + act = menu.addAction("MENU") + _ref = weakref.ref(act, self.actionDestroyed) + act = None + self.assertFalse(self._actionDestroyed) + menu.clear() + self.assertTrue(self._actionDestroyed) + + def testMenuBar(self): + self._actionDestroyed = False + w = QWidget() + menuBar = QMenuBar(w) + act = menuBar.addAction("MENU") + _ref = weakref.ref(act, self.actionDestroyed) + act = None + self.assertFalse(self._actionDestroyed) + menuBar.clear() + self.assertTrue(self._actionDestroyed) + + def testToolBar(self): + self._actionDestroyed = False + w = QWidget() + toolBar = QToolBar(w) + act = toolBar.addAction("MENU") + _ref = weakref.ref(act, self.actionDestroyed) + act = None + self.assertFalse(self._actionDestroyed) + toolBar.clear() + self.assertTrue(self._actionDestroyed) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/add_action_test.py b/sources/pyside2/tests/QtWidgets/add_action_test.py new file mode 100644 index 000000000..c6bc7abb5 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/add_action_test.py @@ -0,0 +1,71 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Tests for QMenuBar.addAction(identifier, callback) calls''' + +import unittest + +from PySide2.QtCore import SLOT +from PySide2.QtWidgets import QMenuBar, QAction, QPushButton + +from helper import UsesQApplication + + +class AddActionTest(UsesQApplication): + '''QMenuBar addAction''' + + def tearDown(self): + try: + del self.called + except AttributeError: + pass + super(AddActionTest, self).tearDown() + + def _callback(self): + self.called = True + + def testBasic(self): + '''QMenuBar.addAction(id, callback)''' + menubar = QMenuBar() + action = menubar.addAction("Accounts", self._callback) + action.activate(QAction.Trigger) + self.assertTrue(self.called) + + def testWithCppSlot(self): + '''QMenuBar.addAction(id, object, slot)''' + menubar = QMenuBar() + widget = QPushButton() + widget.setCheckable(True) + widget.setChecked(False) + action = menubar.addAction("Accounts", widget, SLOT("toggle()")) + action.activate(QAction.Trigger) + self.assertTrue(widget.isChecked()) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/api2_test.py b/sources/pyside2/tests/QtWidgets/api2_test.py new file mode 100644 index 000000000..ad46567bc --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/api2_test.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for PySide API2 support''' + + +import unittest +import sys + +from PySide2.QtGui import QIntValidator, QValidator +from PySide2.QtWidgets import QWidget, QSpinBox, QApplication + +from helper import UsesQApplication + +class WidgetValidatorQInt(QWidget, QIntValidator): + def __init__(self, parent=None): + QWidget.__init__(self, parent) + QIntValidator.__init__(self, parent) + +class WidgetValidatorQSpinBox(QSpinBox): + def __init__(self, parent=None): + QSpinBox.__init__(self, parent) + + def fixup(self, text): + print("It was called!") + +class DoubleQObjectInheritanceTest(UsesQApplication): + + def testDouble(self): + '''Double inheritance from QObject classes''' + + obj = WidgetValidatorQInt() + + #QIntValidator methods + state, string, number = obj.validate('Test', 0) + self.assertEqual(state, QValidator.Invalid) + state, string, number = obj.validate('33', 0) + self.assertEqual(state, QValidator.Acceptable) + + def testQSpinBox(self): + obj = WidgetValidatorQSpinBox() + + obj.setRange(1, 10) + obj.setValue(0) + self.assertEqual(obj.value(), 1) + +class QClipboardTest(UsesQApplication): + + def testQClipboard(self): + #skip this test on MacOS because the clipboard is not available during the ssh session + #this cause problems in the buildbot + if sys.platform == 'darwin': + return + clip = QApplication.clipboard() + clip.setText("Testing this thing!") + + text, subtype = clip.text("") + self.assertEqual(subtype, "plain") + self.assertEqual(text, "Testing this thing!") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/application_test.py b/sources/pyside2/tests/QtWidgets/application_test.py new file mode 100644 index 000000000..78628a556 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/application_test.py @@ -0,0 +1,51 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from testbinding import TestObject +from PySide2.QtWidgets import QApplication + +class QApplicationInstance(unittest.TestCase): + + def appDestroyed(self): + sefl.assertTrue(False) + + def testInstanceObject(self): + TestObject.createApp() + app1 = QApplication.instance() + app2 = QApplication.instance() + app1.setObjectName("MyApp") + self.assertEqual(app1, app2) + self.assertEqual(app2.objectName(), app1.objectName()) + app1.destroyed.connect(self.appDestroyed) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_1002.py b/sources/pyside2/tests/QtWidgets/bug_1002.py new file mode 100644 index 000000000..6deadb238 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_1002.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys +from PySide2.QtWidgets import QWidget, QPushButton + +from helper import UsesQApplication + +class TestBug1002 (UsesQApplication): + def testReturnWindow(self): + widget = QWidget() + button = QPushButton(widget) + self.assertEqual(sys.getrefcount(widget), 2) + window = button.window() + self.assertEqual(sys.getrefcount(widget), 3) + self.assertEqual(sys.getrefcount(window), 3) + + del widget + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_1006.py b/sources/pyside2/tests/QtWidgets/bug_1006.py new file mode 100644 index 000000000..6a8ea03b4 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_1006.py @@ -0,0 +1,111 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import weakref +import sys + +from PySide2.QtCore import Qt +from PySide2.QtWidgets import QDialog, QLabel, QGridLayout, QHBoxLayout, QWidget + +from helper import TimedQApplication + +class LabelWindow(QDialog): + def __init__(self, parent): + super(LabelWindow, self).__init__(parent) + + self.test_layout = QGridLayout() + label = QLabel("Label") + self.test_layout.addWidget(label, 0, 0) + self.setLayout(self.test_layout) + self._destroyCalled = False + + + def replace(self, unit): + old_item = self.test_layout.itemAtPosition(0, 0) + old_label = old_item.widget() + ref = weakref.ref(old_item, self._destroyed) + + self.test_layout.removeWidget(old_label) + unit.assertRaises(RuntimeError, old_item.widget) + del old_item + + label = QLabel("Label New") + old_label.deleteLater() + label.setAlignment(Qt.AlignCenter) + self.test_layout.addWidget(label, 0, 0) + + def _destroyed(self, obj): + self._destroyCalled = True + +class TestBug1006 (TimedQApplication): + + def testLayoutItemLifeTime(self): + window = LabelWindow(None) + window.replace(self) + self.assertTrue(window._destroyCalled) + self.app.exec_() + + def testParentLayout(self): + def createLayout(): + label = QLabel() + layout = QHBoxLayout() + layout.addWidget(label) + + widget = QWidget() + widget.setLayout(layout) + return (layout, widget) + (layout, widget) = createLayout() + item = layout.itemAt(0) + self.assertTrue(isinstance(item.widget(), QWidget)) + + def testRemoveOrphanWidget(self): + widget = QLabel() + layout = QHBoxLayout() + layout.addWidget(widget) + self.assertEqual(sys.getrefcount(widget), 3) + + layout.removeWidget(widget) + widget.setObjectName("MyWidget") + self.assertEqual(sys.getrefcount(widget), 2) + + def testRemoveChildWidget(self): + parent = QLabel() + widget = QLabel(parent) + self.assertEqual(sys.getrefcount(widget), 3) + + layout = QHBoxLayout() + layout.addWidget(widget) + self.assertEqual(sys.getrefcount(widget), 3) + + layout.removeWidget(widget) + widget.setObjectName("MyWidget") + self.assertEqual(sys.getrefcount(widget), 3) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_1048.py b/sources/pyside2/tests/QtWidgets/bug_1048.py new file mode 100644 index 000000000..1e09fa66a --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_1048.py @@ -0,0 +1,36 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2 import QtWidgets + +a = QtWidgets.QApplication([]) + +w = QtWidgets.QWidget() +l = QtWidgets.QGridLayout(w) + +l.itemAtPosition(0, 0) diff --git a/sources/pyside2/tests/QtWidgets/bug_1077.py b/sources/pyside2/tests/QtWidgets/bug_1077.py new file mode 100644 index 000000000..68380e42c --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_1077.py @@ -0,0 +1,45 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' unit test for BUG #1077 ''' + +from PySide2 import QtCore, QtGui, QtWidgets +import time + +class Highlighter(QtGui.QSyntaxHighlighter): + def __init__(self, parent, mode): + QtGui.QSyntaxHighlighter.__init__(self, parent) + self.tstamp = time.time() + +if __name__ == "__main__": + app = QtWidgets.QApplication([]) + python = QtWidgets.QTextEdit() + python.setWindowTitle("python") + hl = Highlighter(python.document(), "python") + python.show() + text = hl.document() diff --git a/sources/pyside2/tests/QtWidgets/bug_172.py b/sources/pyside2/tests/QtWidgets/bug_172.py new file mode 100644 index 000000000..993b634c3 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_172.py @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtWidgets import * + +if __name__ == '__main__': + app = QApplication([]) + + wdg = QWidget() + + hbox = QHBoxLayout() + + vbox = QVBoxLayout() + vbox.addLayout(hbox) + + wdg.setLayout(vbox) diff --git a/sources/pyside2/tests/QtWidgets/bug_243.py b/sources/pyside2/tests/QtWidgets/bug_243.py new file mode 100644 index 000000000..361f02f17 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_243.py @@ -0,0 +1,45 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 243: http://bugs.openbossa.org/show_bug.cgi?id=243''' + +import unittest +import sys + +from PySide2.QtWidgets import QApplication, QMainWindow, QLayout + +class QAppPresence(unittest.TestCase): + + def testBug(self): + app = QApplication(sys.argv) + window = QMainWindow() + l = window.layout() + self.assertTrue(isinstance(l, QLayout)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_307.py b/sources/pyside2/tests/QtWidgets/bug_307.py new file mode 100644 index 000000000..4937f9835 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_307.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import colorsys + +from PySide2.QtCore import SIGNAL +from PySide2.QtWidgets import QPushButton, QApplication + + +class Test (QApplication) : + def __init__(self, argv) : + super(Test, self).__init__(argv) + self._called = False + + def called(self): + self._called = True + + +class QApplicationSignalsTest(unittest.TestCase): + def testQuit(self): + app = Test([]) + button = QPushButton("BUTTON") + app.connect(button, SIGNAL("clicked()"), app.called) + button.click() + self.assertTrue(app._called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_324.py b/sources/pyside2/tests/QtWidgets/bug_324.py new file mode 100644 index 000000000..cc1871c7f --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_324.py @@ -0,0 +1,60 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 324: http://bugs.openbossa.org/show_bug.cgi?id=324''' + +import unittest +import sys +import signal +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class QBug( QObject ): + def __init__(self, parent = None): + QObject.__init__(self, parent) + + def check(self): + self.done.emit("abc") + + done = Signal(str) + +class Bug324(unittest.TestCase): + + def on_done(self, val): + self.value = val + + def testBug(self): + app = QApplication([]) + bug = QBug() + self.value = '' + bug.done.connect(self.on_done) + bug.check() + self.assertEqual(self.value, 'abc') + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_338.py b/sources/pyside2/tests/QtWidgets/bug_338.py new file mode 100644 index 000000000..326c10a4d --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_338.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 338: http://bugs.openbossa.org/show_bug.cgi?id=338''' + +import sys +import unittest + +from PySide2 import QtCore, QtWidgets + +class DiagramItem(QtWidgets.QGraphicsPolygonItem): + def __init__(self, parent=None, scene=None): + super(DiagramItem, self).__init__(parent, scene) + + def itemChange(self, change, value): + return value + + +class BugTest(unittest.TestCase): + def test(self): + app = QtWidgets.QApplication(sys.argv) + scene = QtWidgets.QGraphicsScene() + item = DiagramItem() + item2 = DiagramItem() + #this cause segfault + scene.addItem(item) + scene.addItem(item2) + +if __name__ == "__main__": + unittest.main() \ No newline at end of file diff --git a/sources/pyside2/tests/QtWidgets/bug_363.py b/sources/pyside2/tests/QtWidgets/bug_363.py new file mode 100644 index 000000000..7587c45de --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_363.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 363: http://bugs.openbossa.org/show_bug.cgi?id=363''' + +import sys +import unittest + +from helper import UsesQApplication +from PySide2 import QtCore, QtWidgets + +# Check for desktop object lifetime +class BugTest(UsesQApplication): + def mySlot(self): + pass + + # test if it is possible to connect with a desktop object after storing that on an auxiliar variable + def testCase1(self): + desktop = QtWidgets.QApplication.desktop() + desktop.resized[int].connect(self.mySlot) + self.assertTrue(True) + + # test if it is possible to connect with a desktop object without storing that on an auxiliar variable + def testCase2(self): + QtWidgets.QApplication.desktop().resized[int].connect(self.mySlot) + self.assertTrue(True) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_389.py b/sources/pyside2/tests/QtWidgets/bug_389.py new file mode 100644 index 000000000..1ea8183e3 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_389.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 389: http://bugs.openbossa.org/show_bug.cgi?id=389''' + +import sys +import unittest +from helper import UsesQApplication +from PySide2 import QtCore, QtGui, QtWidgets + +class BugTest(UsesQApplication): + def testCase(self): + s = QtWidgets.QWidget().style() + i = s.standardIcon(QtWidgets.QStyle.SP_TitleBarMinButton) + self.assertEqual(type(i), QtGui.QIcon) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_400.py b/sources/pyside2/tests/QtWidgets/bug_400.py new file mode 100644 index 000000000..ad673704d --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_400.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 400: http://bugs.openbossa.org/show_bug.cgi?id=400''' + +import unittest +from helper import UsesQApplication +from PySide2.QtWidgets import QTreeWidgetItemIterator, QTreeWidgetItem, QTreeWidget + +class BugTest(UsesQApplication): + def testCase(self): + treeWidget = QTreeWidget() + treeWidget.setColumnCount(1) + items = [] + for i in range(10): + items.append(QTreeWidgetItem(None, ["item: %i" % i])) + + treeWidget.insertTopLevelItems(0, items); + _iter = QTreeWidgetItemIterator(treeWidget) + index = 0 + while(_iter.value()): + item = _iter.value() + self.assertTrue(item is items[index]) + index += 1 + _iter += 1 + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_416.py b/sources/pyside2/tests/QtWidgets/bug_416.py new file mode 100644 index 000000000..988f3f83b --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_416.py @@ -0,0 +1,71 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from helper import TimedQApplication +from PySide2.QtCore import QSignalTransition, QState, Qt, QStateMachine +from PySide2.QtWidgets import QCheckBox + +class CheckedTransition(QSignalTransition): + def __init__(self, check): + QSignalTransition.__init__(self, check.stateChanged[int]) + self.eventTested = False + + def eventTest(self, event): + self.eventTested = True + if not QSignalTransition.eventTest(self, event): + return False + return event.arguments()[0] == Qt.Checked + +class TestBug(TimedQApplication): + def testCase(self): + check = QCheckBox() + check.setTristate(True) + + s1 = QState() + s2 = QState() + + t1 = CheckedTransition(check) + t1.setTargetState(s2) + s1.addTransition(t1) + + machine = QStateMachine() + machine.addState(s1) + machine.addState(s2) + machine.setInitialState(s1) + machine.start() + + check.stateChanged[int].emit(1) + check.show() + self.app.exec_() + self.assertTrue(t1.eventTested) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_429.py b/sources/pyside2/tests/QtWidgets/bug_429.py new file mode 100644 index 000000000..2d9a9fee6 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_429.py @@ -0,0 +1,38 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtWidgets import * +import sys + +app = QApplication(sys.argv) +scene = QGraphicsScene() +label = QLabel("hello world") +label.show() +QTimer.singleShot(0, label.close) +exit(app.exec_()) diff --git a/sources/pyside2/tests/QtWidgets/bug_430.py b/sources/pyside2/tests/QtWidgets/bug_430.py new file mode 100644 index 000000000..7c7a5fa7a --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_430.py @@ -0,0 +1,42 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class ListModel(QAbstractListModel): + def rowCount(self, parent = QModelIndex()): + return 0 + +app = QApplication([]) +model = ListModel() +v = QListView() +v.setModel(model) +QTimer.singleShot(0, v.close) +app.exec_() diff --git a/sources/pyside2/tests/QtWidgets/bug_433.py b/sources/pyside2/tests/QtWidgets/bug_433.py new file mode 100644 index 000000000..798bc28bd --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_433.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys + +from PySide2 import QtCore, QtWidgets + +class Test(QtWidgets.QGraphicsView): + def __init__(self, parent=None): + super(Test, self).__init__(parent) + self.s = QtWidgets.QGraphicsScene() + self.setScene(self.s) + +a = QtWidgets.QApplication(sys.argv) +t = Test() +t.show() +QtCore.QTimer.singleShot(0, t.close) +sys.exit(a.exec_()) diff --git a/sources/pyside2/tests/QtWidgets/bug_467.py b/sources/pyside2/tests/QtWidgets/bug_467.py new file mode 100644 index 000000000..0bc5ed80d --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_467.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 367: http://bugs.openbossa.org/show_bug.cgi?id=467''' + +import unittest +from helper import UsesQApplication +from PySide2.QtWidgets import QMainWindow, QApplication + +class MyWidget(QMainWindow): + def __init__(self, parent = None): + QMainWindow.__init__(self, parent) + + +class BugTest(UsesQApplication): + def testCase(self): + w = MyWidget() + widgets = QApplication.allWidgets() + self.assertTrue(w in widgets) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_493.py b/sources/pyside2/tests/QtWidgets/bug_493.py new file mode 100644 index 000000000..5372e28b7 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_493.py @@ -0,0 +1,51 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import Qt, QEvent +from PySide2.QtGui import QKeyEvent, QKeySequence +from PySide2.QtWidgets import QApplication +import unittest + + +class TestBug569(unittest.TestCase): + + def testIt(self): + # We need a qapp otherwise Qt will crash when trying to detect the + # current platform + app = QApplication([]) + ev1 = QKeyEvent(QEvent.KeyRelease, Qt.Key_Delete, Qt.NoModifier) + ev2 = QKeyEvent(QEvent.KeyRelease, Qt.Key_Copy, Qt.NoModifier) + ks = QKeySequence.Delete + + self.assertEqual(ev1, ks) + self.assertEqual(ks, ev1) + self.assertNotEqual(ev2, ks) + self.assertNotEqual(ks, ev2) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_512.py b/sources/pyside2/tests/QtWidgets/bug_512.py new file mode 100644 index 000000000..37b68c551 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_512.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 512: http://bugs.openbossa.org/show_bug.cgi?id=512''' + +import unittest +from helper import UsesQApplication +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class BugTest(UsesQApplication): + def testCase(self): + w = QWidget(None) + lbl = QLabel("Hello", w); + g = QGridLayout() + g.addWidget(lbl, 0, 0) + w.setLayout(g) + w.show() + + t = g.getItemPosition(0) + self.assertEqual(type(t), tuple) + self.assertEqual(t, (0,0,1,1)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_525.py b/sources/pyside2/tests/QtWidgets/bug_525.py new file mode 100644 index 000000000..2a999a3fc --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_525.py @@ -0,0 +1,49 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtWidgets import QApplication +from PySide2.QtWidgets import QMenu + +class M2(QMenu): + def __init__(self,parent=None): + super(M2,self).__init__(parent) + self.setTitle(self.tr("M2")) + +class TestMenuDerivedClass(unittest.TestCase): + def aboutToShowHandler(self): + pass + + def testConnectSignal(self): + app = QApplication([]) + m2 = M2() + # Test if the aboutToShow signal was translated to correct type + m2.aboutToShow.connect(self.aboutToShowHandler) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_546.py b/sources/pyside2/tests/QtWidgets/bug_546.py new file mode 100644 index 000000000..bfcf503e6 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_546.py @@ -0,0 +1,42 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtWidgets import * + +class TestBug546(unittest.TestCase): + + """Test to check a crash at exit""" + def testIt(self): + app = QApplication([]) + textEdit = QPlainTextEdit() + completer = QCompleter(("foo", "bar"), textEdit) + completer.setWidget(textEdit) + +if __name__=='__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_547.py b/sources/pyside2/tests/QtWidgets/bug_547.py new file mode 100644 index 000000000..9b348b61f --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_547.py @@ -0,0 +1,85 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +""" Unittest for bug #547 """ +""" http://bugs.openbossa.org/show_bug.cgi?id=547 """ + +import sys +import unittest + +from PySide2 import QtWidgets + +class MyMainWindow(unittest.TestCase): + app = QtWidgets.QApplication(sys.argv) + def testCase1(self): + self._tree = QtWidgets.QTreeWidget() + self._tree.setColumnCount(2) + self._i1 = None + self._i11 = None + + self._updateTree() + self.assertEqual(sys.getrefcount(self._i1), 3) + self.assertEqual(sys.getrefcount(self._i11), 3) + + self._i11.parent().setExpanded(True) + self._i11.setExpanded(True) + + self._updateTree() + self.assertEqual(sys.getrefcount(self._i1), 3) + self.assertEqual(sys.getrefcount(self._i11), 3) + + def testCase2(self): + self._tree = QtWidgets.QTreeWidget() + self._tree.setColumnCount(2) + self._i1 = None + self._i11 = None + + self._updateTree() + self.assertEqual(sys.getrefcount(self._i1), 3) + self.assertEqual(sys.getrefcount(self._i11), 3) + + self._i11.parent().setExpanded(True) + self._i11.setExpanded(True) + + self.assertEqual(sys.getrefcount(self._i1), 3) + self.assertEqual(sys.getrefcount(self._i11), 3) + + def _updateTree(self): + self._tree.clear() + if self._i1 and self._i11: + self.assertEqual(sys.getrefcount(self._i1), 2) + self.assertEqual(sys.getrefcount(self._i11), 2) + + self._i1 = QtWidgets.QTreeWidgetItem(self._tree, ['1', ]) + self.assertEqual(sys.getrefcount(self._i1), 3) + self._i11 = QtWidgets.QTreeWidgetItem(self._i1, ['11', ]) + self.assertEqual(sys.getrefcount(self._i11), 3) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_549.py b/sources/pyside2/tests/QtWidgets/bug_549.py new file mode 100644 index 000000000..24159dbc5 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_549.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtWidgets import * + +class TestBug549(unittest.TestCase): + def testBug(self): + app = QApplication([]) + w = QGraphicsWidget() + w.setContentsMargins(1, 2, 3, 4) + self.assertEqual(w.getContentsMargins(), (1, 2, 3, 4)) + w.setWindowFrameMargins(5, 6, 7, 8) + self.assertEqual(w.getWindowFrameMargins(), (5, 6, 7, 8)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_569.py b/sources/pyside2/tests/QtWidgets/bug_569.py new file mode 100644 index 000000000..05a964c18 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_569.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtWidgets import * +import unittest + + +class TestBug569(unittest.TestCase): + + def testIt(self): + types = (QTableWidgetItem, QListWidgetItem, QTreeWidgetItem) + for t in types: + a = t() + a.__lt__ = lambda other : True + b = t() + b.__lt__ = lambda other : False + self.assertTrue(a < b) + self.assertFalse(b < a) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_575.py b/sources/pyside2/tests/QtWidgets/bug_575.py new file mode 100644 index 000000000..9b0e00e1c --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_575.py @@ -0,0 +1,48 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +""" Unittest for bug #575 """ +""" http://bugs.openbossa.org/show_bug.cgi?id=575 """ + +from PySide2.QtWidgets import QApplication, QPlainTextEdit, QTextEdit +import sys +import unittest + +class Bug575(unittest.TestCase): + def testPropertyValues(self): + app = QApplication(sys.argv) + textEdit = QPlainTextEdit() + textEdit.insertPlainText("PySide INdT") + selection = QTextEdit.ExtraSelection() + selection.cursor = textEdit.textCursor() + selection.cursor.setPosition(2) + self.assertEqual(selection.cursor.position(), 2) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_576.py b/sources/pyside2/tests/QtWidgets/bug_576.py new file mode 100644 index 000000000..eefb2cb52 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_576.py @@ -0,0 +1,62 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +""" Unittest for bug #576 """ +""" http://bugs.openbossa.org/show_bug.cgi?id=576 """ + +import sys +import unittest + +from PySide2 import QtCore, QtWidgets + +class Bug576(unittest.TestCase): + def onButtonDestroyed(self, button): + self._destroyed = True + self.assertTrue(isinstance(button, QtWidgets.QPushButton)) + + def testWidgetParent(self): + self._destroyed = False + app = QtWidgets.QApplication(sys.argv) + w = QtWidgets.QWidget() + + b = QtWidgets.QPushButton("test") + b.destroyed[QtCore.QObject].connect(self.onButtonDestroyed) + self.assertEqual(sys.getrefcount(b), 2) + b.setParent(w) + self.assertEqual(sys.getrefcount(b), 3) + b.parent() + self.assertEqual(sys.getrefcount(b), 3) + b.setParent(None) + self.assertEqual(sys.getrefcount(b), 2) + del b + self.assertTrue(self._destroyed) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_585.py b/sources/pyside2/tests/QtWidgets/bug_585.py new file mode 100644 index 000000000..1232d6c0b --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_585.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test bug 585: http://bugs.openbossa.org/show_bug.cgi?id=585''' + +import sys +import unittest + +from PySide2 import QtCore, QtWidgets + +class Bug585(unittest.TestCase): + def testCase(self): + app = QtWidgets.QApplication([]) + self._tree = QtWidgets.QTreeWidget() + self._tree.setColumnCount(2) + i1 = QtWidgets.QTreeWidgetItem(self._tree, ['1', ]) + i2 = QtWidgets.QTreeWidgetItem(self._tree, ['2', ]) + refCount = sys.getrefcount(i1) + + # this function return None + # because the topLevelItem does not has a parent item + # but still have a TreeWidget as a parent + self._tree.topLevelItem(0).parent() + + self.assertEqual(refCount, sys.getrefcount(i1)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_589.py b/sources/pyside2/tests/QtWidgets/bug_589.py new file mode 100644 index 000000000..25ba10d71 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_589.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# trimmed down diagramscene.py to demonstrate crash in sizeHint() + +import sys +from PySide2 import QtCore, QtWidgets +import unittest + +class CustomWidget(QtWidgets.QGraphicsProxyWidget): + def itemChange(self, eventType, value): + QtWidgets.QGraphicsProxyWidget.itemChange(self, eventType, value) + +class Bug589(unittest.TestCase): + def testCase(self): + widget = QtWidgets.QGraphicsProxyWidget() + custom = CustomWidget() + custom.setParentItem(widget) + +if __name__ == "__main__": + app = QtWidgets.QApplication(sys.argv) + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_632.py b/sources/pyside2/tests/QtWidgets/bug_632.py new file mode 100644 index 000000000..fa8063412 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_632.py @@ -0,0 +1,48 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +from PySide2.QtWidgets import QLineEdit, QApplication +import unittest + + +class Bug589(unittest.TestCase): + def testWrongSignature(self): + text = QLineEdit("PySide bug 632") + a = b = c = d = 0 + self.assertRaises(TypeError, text.getTextMargins, (a, b, c, d)) + + def testTupleReturn(self): + text = QLineEdit("PySide bug 632") + text.setTextMargins(10, 20, 30, 40) + (a, b, c, d) = text.getTextMargins() + self.assertTrue((a, b, c, d), (10, 20, 30, 40)) + +if __name__ == "__main__": + app = QApplication(sys.argv) + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_635.py b/sources/pyside2/tests/QtWidgets/bug_635.py new file mode 100644 index 000000000..f23241d30 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_635.py @@ -0,0 +1,57 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 635: http://bugs.openbossa.org/show_bug.cgi?id=635''' + +import unittest +from PySide2.QtGui import QIcon +from PySide2.QtWidgets import QApplication, QToolBar +import sys + +class testQToolBar(unittest.TestCase): + def callback(self): + self._called = True + + def testAddAction(self): + bar = QToolBar() + self._called = False + a = bar.addAction("act1", self.callback) + a.trigger() + self.assertTrue(self._called) + + def testAddActionWithIcon(self): + bar = QToolBar() + self._called = False + icon = QIcon() + a = bar.addAction(icon, "act1", self.callback) + a.trigger() + self.assertTrue(self._called) + +if __name__ == '__main__': + app = QApplication(sys.argv) + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_640.py b/sources/pyside2/tests/QtWidgets/bug_640.py new file mode 100644 index 000000000..b9a9a0e8b --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_640.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +from PySide2.QtWidgets import * +import unittest + +class Bug640(unittest.TestCase): + def testIt(self): + option = QStyleOptionGraphicsItem() + a = option.state # crash!? + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_653.py b/sources/pyside2/tests/QtWidgets/bug_653.py new file mode 100644 index 000000000..ba7178b98 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_653.py @@ -0,0 +1,45 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class TestBug653(unittest.TestCase): + """Crash after calling QWizardPage.wizard()""" + def testIt(self): + app = QApplication([]) + + wizard = QWizard() + page = QWizardPage() + wizard.addPage(page) + page.wizard() # crash here if the bug still exists due to a circular dependency + wizard.show() + +if __name__ == "__main__": + unittest.main() \ No newline at end of file diff --git a/sources/pyside2/tests/QtWidgets/bug_662.py b/sources/pyside2/tests/QtWidgets/bug_662.py new file mode 100644 index 000000000..369bccfeb --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_662.py @@ -0,0 +1,57 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 662: http://bugs.openbossa.org/show_bug.cgi?id=662''' + +import unittest +from PySide2.QtGui import QTextCharFormat +from PySide2.QtWidgets import QTextEdit, QApplication +import sys + +class testQTextBlock(unittest.TestCase): + def tesIterator(self): + edit = QTextEdit() + cursor = edit.textCursor() + fmt = QTextCharFormat() + frags = [] + for i in range(10): + fmt.setFontPointSize(i+10) + frags.append("block%d"%i) + cursor.insertText(frags[i], fmt) + + doc = edit.document() + block = doc.begin() + + index = 0 + for i in block: + self.assertEqual(i.fragment().text(), frags[index]) + index += 1 + +if __name__ == '__main__': + app = QApplication(sys.argv) + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_667.py b/sources/pyside2/tests/QtWidgets/bug_667.py new file mode 100644 index 000000000..ad91b5a78 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_667.py @@ -0,0 +1,53 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys + +from PySide2.QtCore import QTimer, QPointF +from PySide2.QtWidgets import QApplication, QGraphicsView, QGraphicsScene, QGraphicsEllipseItem + +class Ball(QGraphicsEllipseItem): + def __init__(self, d, parent=None): + super(Ball, self).__init__(0, 0, d, d, parent) + self.vel = QPointF(0,0) #commenting this out prevents the crash + +class Foo(QGraphicsView): + def __init__(self): + super(Foo, self).__init__(None) + self.scene = QGraphicsScene(self.rect()) + self.setScene(self.scene) + self.scene.addItem(Ball(10)) + + +if __name__ == "__main__": + app = QApplication(sys.argv) + w = Foo() + w.show() + w.raise_() + QTimer.singleShot(0, w.close) + sys.exit(app.exec_()) diff --git a/sources/pyside2/tests/QtWidgets/bug_668.py b/sources/pyside2/tests/QtWidgets/bug_668.py new file mode 100644 index 000000000..02036fae4 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_668.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +import sys + +class A(QMainWindow): + def __init__(self, parent=None): + super(A, self).__init__(parent) + a = QFileSystemModel(self) + a.setRootPath(QDir.homePath()) + + v = QTreeView(self) + v.setModel(a) + self.setCentralWidget(v) + +app = QApplication([]) +m = A() +m.show() +QTimer.singleShot(0, m.close) +app.exec_() diff --git a/sources/pyside2/tests/QtWidgets/bug_674.py b/sources/pyside2/tests/QtWidgets/bug_674.py new file mode 100644 index 000000000..c26bd7eee --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_674.py @@ -0,0 +1,51 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtWidgets import * +import unittest +import sys + +class TestBug679(unittest.TestCase): + '''QGraphicsScene::clear() is missing''' + def testIt(self): + app = QApplication([]) + + scene = QGraphicsScene() + hello = scene.addText("Hello") + scene.addText("World") + + self.assertEqual(sys.getrefcount(hello), 3) + scene.clear() + self.assertEqual(sys.getrefcount(hello), 2) + self.assertEqual(len(scene.items()), 0) + self.assertRaises(RuntimeError, hello.isVisible) # the C++ object was deleted + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_675.py b/sources/pyside2/tests/QtWidgets/bug_675.py new file mode 100644 index 000000000..9e1358a8c --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_675.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +app = QApplication([]) + +scene = QGraphicsScene() + +# don't segfault due to lack of keepReferenceCall +textEdit = scene.addWidget(QTextEdit()) + +layout = QGraphicsLinearLayout() +layout.addItem(textEdit) + +view = QGraphicsView(scene) +view.show() diff --git a/sources/pyside2/tests/QtWidgets/bug_688.py b/sources/pyside2/tests/QtWidgets/bug_688.py new file mode 100644 index 000000000..d622b33be --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_688.py @@ -0,0 +1,116 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test bug 688: http://bugs.openbossa.org/show_bug.cgi?id=688''' + +import unittest +from helper import UsesQApplication +from PySide2.QtGui import QTextFrame, QTextCursor, QTextCharFormat, QFont, QTextFrameFormat +from PySide2.QtWidgets import QTextEdit + +class BugTest(UsesQApplication): + def testCase(self): + editor = QTextEdit() + cursor = QTextCursor(editor.textCursor()) + cursor.movePosition(QTextCursor.Start) + + mainFrame = cursor.currentFrame() + + plainCharFormat = QTextCharFormat() + boldCharFormat = QTextCharFormat() + boldCharFormat.setFontWeight(QFont.Bold); + cursor.insertText(""" + Text documents are represented by the + QTextDocument class, rather than by QString objects. + Each QTextDocument object contains information about + the document's internal representation, its structure, + and keeps track of modifications to provide undo/redo + facilities. This approach allows features such as the + layout management to be delegated to specialized + classes, but also provides a focus for the framework.""", + plainCharFormat) + + frameFormat = QTextFrameFormat() + frameFormat.setMargin(32) + frameFormat.setPadding(8) + frameFormat.setBorder(4) + cursor.insertFrame(frameFormat) + + cursor.insertText(""" + Documents are either converted from external sources + or created from scratch using Qt. The creation process + can done by an editor widget, such as QTextEdit, or by + explicit calls to the Scribe API.""", + boldCharFormat) + + cursor = mainFrame.lastCursorPosition() + cursor.insertText(""" + There are two complementary ways to visualize the + contents of a document: as a linear buffer that is + used by editors to modify the contents, and as an + object hierarchy containing structural information + that is useful to layout engines. In the hierarchical + model, the objects generally correspond to visual + elements such as frames, tables, and lists. At a lower + level, these elements describe properties such as the + style of text used and its alignment. The linear + representation of the document is used for editing and + manipulation of the document's contents.""", + plainCharFormat) + + + frame = cursor.currentFrame() + + items = [] + + #test iterator + for i in frame: + items.append(i) + + #test __iadd__ + b = frame.begin() + i = 0 + while not b.atEnd(): + self.assertEqual(b, items[i]) + self.assertTrue(b.parentFrame(), items[i].parentFrame()) + b.__iadd__(1) + i += 1 + + #test __isub__ + b = frame.end() + i = 0 + while i > 0: + self.assertEqual(b, items[i]) + self.assertTrue(b.parentFrame(), items[i].parentFrame()) + b.__isub__(1) + i -= 1 + + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_693.py b/sources/pyside2/tests/QtWidgets/bug_693.py new file mode 100644 index 000000000..eecc6b62b --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_693.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtWidgets import * +import unittest + +class MyModel (QAbstractListModel): + + stupidLine = QLine(0, 0, 10, 10) + + def rowCount(self, parent): + return 1 + + def data(self, index, role): + return self.stupidLine + +class TestBug693(unittest.TestCase): + def testIt(self): + app = QApplication([]) + model = MyModel() + view = QListView() + view.setModel(model) + view.show() + + # This must NOT throw the exception: + # RuntimeError: Internal C++ object (PySide2.QtCore.QLine) already deleted. + MyModel.stupidLine.isNull() + + + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_696.py b/sources/pyside2/tests/QtWidgets/bug_696.py new file mode 100644 index 000000000..60f6f2166 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_696.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest + +from helper import UsesQApplication +from PySide2.QtWidgets import QMainWindow, QMenu, QApplication + +class MainWindow(QMainWindow): + def __init__(self, *args): + self._menu = QMenu(self.dontexist) # attribute called with invalid C++ object + +class MainWindow2(QMainWindow): + def __init__(self): + self.show() + +class Bug696(UsesQApplication): + def testContructorInitialization(self): + self.assertRaises(AttributeError, MainWindow) + + def testContructorInitializationAndCPPFunction(self): + self.assertRaises(RuntimeError, MainWindow2) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_711.py b/sources/pyside2/tests/QtWidgets/bug_711.py new file mode 100644 index 000000000..c56081f9b --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_711.py @@ -0,0 +1,53 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtWidgets import QToolBar, QApplication, QAction, QToolButton + +try: + xrange +except NameError: + xrange = range # py3k + +class TestLabelPixmap(unittest.TestCase): + def testReference(self): + toolbar = QToolBar() + + for i in xrange(20): + toolbar.addAction(QAction("Action %d" % i, None)) + + buttons = toolbar.findChildren(QToolButton, "") + toolbar.clear() + + for b in buttons: + self.assertRaises(RuntimeError, b.objectName) + +if __name__ == '__main__': + app = QApplication([]) + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_714.py b/sources/pyside2/tests/QtWidgets/bug_714.py new file mode 100644 index 000000000..6fef26d33 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_714.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys +from PySide2.QtGui import QPixmap +from PySide2.QtWidgets import QLabel, QApplication + +class TestLabelPixmap(unittest.TestCase): + def testReference(self): + l = QLabel() + p = QPixmap() + l.setPixmap(p) # doesn't increment pixmap ref because this makes a copy + self.assertEqual(sys.getrefcount(p), 2) + + p = l.pixmap() # this increment the reference because this is an internal pointer + self.assertEqual(sys.getrefcount(p), 3) + + p2 = l.pixmap() + self.assertEqual(p, p2) + +if __name__ == '__main__': + app = QApplication([]) + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_722.py b/sources/pyside2/tests/QtWidgets/bug_722.py new file mode 100644 index 000000000..20087a088 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_722.py @@ -0,0 +1,52 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import UsesQApplication + +from PySide2.QtWidgets import QDoubleSpinBox, QGraphicsBlurEffect + +class TestSignalConnection(UsesQApplication): + def testFloatSignal(self): + foo1 = QDoubleSpinBox() + foo2 = QDoubleSpinBox() + foo1.valueChanged[float].connect(foo2.setValue) + foo2.valueChanged[float].connect(foo1.setValue) + foo1.setValue(0.42) + self.assertEqual(foo1.value(), foo2.value()) + + def testQRealSignal(self): + foo1 = QDoubleSpinBox() + effect = QGraphicsBlurEffect() + effect.blurRadiusChanged['qreal'].connect(foo1.setValue) # check if qreal is a valid type + effect.setBlurRadius(0.42) + self.assertAlmostEqual(foo1.value(), effect.blurRadius()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_728.py b/sources/pyside2/tests/QtWidgets/bug_728.py new file mode 100644 index 000000000..8ef40b374 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_728.py @@ -0,0 +1,36 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtWidgets import * +from PySide2.QtCore import * + +app = QApplication([]) +QTimer.singleShot(200, app.quit) + +# This test for a dead lock in QFileDialog.getOpenFileNames, the test fail with a timeout if the dead lock exists. +QFileDialog.getOpenFileNames(None, "caption", QDir.homePath(), None, "", QFileDialog.DontUseNativeDialog) diff --git a/sources/pyside2/tests/QtWidgets/bug_736.py b/sources/pyside2/tests/QtWidgets/bug_736.py new file mode 100644 index 000000000..2fe80f801 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_736.py @@ -0,0 +1,47 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class TestBug736 (unittest.TestCase): + + def testIt(self): + app = QApplication([]) + slider = QSlider(Qt.Horizontal) + slider2 = QSlider(Qt.Horizontal) + + slider2.setMaximum(10) + slider.valueChanged[int].connect(slider2.setMaximum) + slider.valueChanged[int].emit(100) + self.assertEqual(slider2.maximum(), 100) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_750.py b/sources/pyside2/tests/QtWidgets/bug_750.py new file mode 100644 index 000000000..055e982a8 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_750.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import UsesQApplication + +from PySide2.QtCore import QTimer +from PySide2.QtGui import QPainter, QFont, QFontInfo +from PySide2.QtWidgets import QWidget, qApp + +class MyWidget(QWidget): + def paintEvent(self, e): + p = QPainter(self) + self._info = p.fontInfo() + self._app.quit() + + +class TestQPainter(UsesQApplication): + def testFontInfo(self): + w = MyWidget() + w._app = self.app + w._info = None + QTimer.singleShot(300, w.show) + self.app.exec_() + self.assertTrue(w._info) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_778.py b/sources/pyside2/tests/QtWidgets/bug_778.py new file mode 100644 index 000000000..270b1a48a --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_778.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import UsesQApplication + +from PySide2.QtWidgets import QTreeWidget, QTreeWidgetItem, QTreeWidgetItemIterator + +class QTreeWidgetItemIteratorTest(UsesQApplication): + def testWidgetIterator(self): + treeWidget = QTreeWidget() + treeWidget.setColumnCount(1) + items = [] + for i in range(10): + items.append(QTreeWidgetItem(None, ['item: %d' % i])) + treeWidget.insertTopLevelItems(0, items) + + index = 0 + for it in QTreeWidgetItemIterator(treeWidget): + self.assertEqual(it.value().text(0), 'item: %d' % index) + index += 1 + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_785.py b/sources/pyside2/tests/QtWidgets/bug_785.py new file mode 100644 index 000000000..ccd8dfddc --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_785.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys + +import unittest +from PySide2.QtCore import QItemSelection +from PySide2.QtGui import QStandardItemModel, QStandardItem +from PySide2.QtWidgets import QApplication +class Bug324(unittest.TestCase): + def testOperators(self): + model = QStandardItemModel() + for i in range(100): + model.appendRow(QStandardItem("Item: %d"%i)) + + first = model.index(0, 0) + second = model.index(10, 0) + third = model.index(20, 0) + fourth = model.index(30, 0) + + sel = QItemSelection(first, second) + sel2 = QItemSelection() + sel2.select(third, fourth) + + sel3 = sel + sel2 #check operator + + self.assertEqual(len(sel3), 2) + sel4 = sel + sel4 += sel2 #check operator += + self.assertEqual(len(sel4), 2) + self.assertEqual(sel4, sel3) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_793.py b/sources/pyside2/tests/QtWidgets/bug_793.py new file mode 100644 index 000000000..89dc4408c --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_793.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys +from PySide2.QtCore import QTimer +from PySide2.QtWidgets import QWidget, QApplication + +class TestW1(QWidget): + def __init__(self, parent = None): + super(TestW1, self).__init__(parent) + TestW2(parent, self) + +class TestW2(QWidget): + def __init__(self, ancestor, parent = None): + super(TestW2, self).__init__(parent) + self.ancestor_ref = ancestor + +class Test(QWidget): + def __init__(self): + super(Test, self).__init__() + TestW1(self) + +class TestQApplicationDestrcutor(unittest.TestCase): + def testDestructor(self): + w = Test() + w.show() + QTimer.singleShot(0, w.close) + +if __name__ == '__main__': + app = QApplication(sys.argv) + unittest.main() + sys.exit(app.exec_()) diff --git a/sources/pyside2/tests/QtWidgets/bug_811.py b/sources/pyside2/tests/QtWidgets/bug_811.py new file mode 100644 index 000000000..d219ec6c3 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_811.py @@ -0,0 +1,61 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys +import weakref + +from helper import UsesQApplication + +from PySide2.QtGui import QTextBlockUserData, QTextCursor +from PySide2.QtWidgets import QTextEdit + +class TestUserData(QTextBlockUserData): + def __init__(self, data): + super(TestUserData, self).__init__() + self.data = data + +class TestUserDataRefCount(UsesQApplication): + def testRefcount(self): + textedit = QTextEdit() + textedit.setReadOnly(True) + doc = textedit.document() + cursor = QTextCursor(doc) + cursor.insertText("PySide Rocks") + ud = TestUserData({"Life": 42}) + self.assertEqual(sys.getrefcount(ud), 2) + cursor.block().setUserData(ud) + self.assertEqual(sys.getrefcount(ud), 3) + ud2 = cursor.block().userData() + self.assertEqual(sys.getrefcount(ud), 4) + self.udata = weakref.ref(ud, None) + del ud, ud2 + self.assertEqual(sys.getrefcount(self.udata()), 2) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_834.py b/sources/pyside2/tests/QtWidgets/bug_834.py new file mode 100644 index 000000000..00fe06510 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_834.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2 import QtCore, QtWidgets + +class Window(QtWidgets.QMainWindow): + def childEvent(self, event): + super(Window, self).childEvent(event) + +app = QtWidgets.QApplication([]) +window = Window() + +dock1 = QtWidgets.QDockWidget() +dock2 = QtWidgets.QDockWidget() +window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dock1) +window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dock2) +window.tabifyDockWidget(dock1, dock2) + +window.show() +QtCore.QTimer.singleShot(0, window.close) +app.exec_() diff --git a/sources/pyside2/tests/QtWidgets/bug_836.py b/sources/pyside2/tests/QtWidgets/bug_836.py new file mode 100644 index 000000000..5aeb94659 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_836.py @@ -0,0 +1,56 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class Mixin1(object): + pass + +class Mixin2(object): + pass + +class Mixin3(object): + pass + +class MainWindow(Mixin1, Mixin2, Mixin3, QFrame): + def __init__(self): + super(MainWindow, self).__init__() + +def main(): + app = QApplication([]) + # if it doesn't crash it should pass + w = MainWindow() + w.show() + QTimer.singleShot(0, w.close) + app.exec_() + +if __name__ == "__main__": + main() + + diff --git a/sources/pyside2/tests/QtWidgets/bug_844.py b/sources/pyside2/tests/QtWidgets/bug_844.py new file mode 100644 index 000000000..991abbd13 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_844.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtWidgets import * +from PySide2.QtCore import * + +class QtKeyPressListener(QObject): + def __init__(self, obj): + QObject.__init__(self) + obj.installEventFilter(self) + + def eventFilter(self, obj, event): + # This used to crash here due to a misbehaviour of type discovery! + return QObject.eventFilter(self, obj, event) + +app = QApplication([]) +key_listener = QtKeyPressListener(app) +w = QLabel('Hello') +w.show() +QTimer.singleShot(0, w.close) +app.exec_() diff --git a/sources/pyside2/tests/QtWidgets/bug_854.py b/sources/pyside2/tests/QtWidgets/bug_854.py new file mode 100644 index 000000000..47c368259 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_854.py @@ -0,0 +1,68 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtWidgets import QTableView, QVBoxLayout, QApplication +from PySide2.QtCore import QAbstractItemModel + +from helper import UsesQApplication +import unittest + + +class VirtualList(QAbstractItemModel): + def __getitem__(self, index): + self._getItemCalled = True + pass + + def rowCount(self, parent): + return 5000 + + def columnCount(self, parent): + return 3 + + def index(self, row, column, parent): + return self.createIndex(row, column) + + def parent(self, index): + return QModelIndex() + + def data(self, index, role): + return "(%i, %i)" % (index.row(), index.column()) + + +class TestQAbstractItemModel(UsesQApplication): + def testSetModel(self): + model = VirtualList() + model._getItemCalled = False + table = QTableView() + table.setModel(model) + table.show() + self.assertFalse(model._getItemCalled) + +if __name__ == "__main__": + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/bug_860.py b/sources/pyside2/tests/QtWidgets/bug_860.py new file mode 100644 index 000000000..f961a8ff2 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_860.py @@ -0,0 +1,63 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest + +from PySide2.QtCore import QSignalMapper +from PySide2.QtWidgets import QCheckBox + +from helper import UsesQApplication + +class MultipleSlotTest(UsesQApplication): + def cb_changed(self, i): + self._changed = True + + def cb_changedVoid(self): + self._changed = True + + def testSignalMapper(self): + checkboxMapper = QSignalMapper() + box = QCheckBox('check me') + box.stateChanged.connect(checkboxMapper.map) + + checkboxMapper.setMapping(box, box.text()) + checkboxMapper.mapped[str].connect(self.cb_changed) + self._changed = False + box.setChecked(True) + self.assertTrue(self._changed) + + def testSimpleSignal(self): + box = QCheckBox('check me') + box.stateChanged[int].connect(self.cb_changedVoid) + self._changed = False + box.setChecked(True) + self.assertTrue(self._changed) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/bug_862.py b/sources/pyside2/tests/QtWidgets/bug_862.py new file mode 100644 index 000000000..fc164bcc4 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/bug_862.py @@ -0,0 +1,67 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import QObject +from PySide2.QtWidgets import * +import PySide2.QtCore +import unittest + +class MyQObject(QObject): + def __init__(self): + QObject.__init__(self) + +class MyQWidget(QWidget): + def __init__(self): + QWidget.__init__(self) + +class MyQGraphicsObject(QGraphicsObject): + def __init__(self): + QGraphicsObject.__init__(self) + +class MyQGraphicsItem(QGraphicsItem): + def __init__(self): + QGraphicsItem.__init__(self) + +class TestRepr (unittest.TestCase): + + def testIt(self): + + app = QApplication([]) + + self.assertEqual("<__main__.MyQObject object at ", repr(MyQObject())[:30]) + self.assertEqual("<__main__.MyQWidget object at ", repr(MyQWidget())[:30]) + self.assertEqual("<__main__.MyQGraphicsObject(0x", repr(MyQGraphicsObject())[:30]) + self.assertEqual("<__main__.MyQGraphicsItem(0x", repr(MyQGraphicsItem())[:28]) + + self.assertEqual(" c #545454", + ", c #5A5A5A", + "' c #4B4B4B", + ") c #4A4A4A", + "! c #4F4F4F", + "~ c #585858", + "{ c #515151", + "] c #4C4C4C", + "^ c #B1B1B1", + "/ c #FCFCFC", + "( c #FDFDFD", + "_ c #C1C1C1", + ": c #848484", + "< c #616161", + "[ c #5E5E5E", + "} c #CECECE", + "| c #E2E2E2", + "1 c #E4E4E4", + "2 c #DFDFDF", + "3 c #D2D2D2", + "4 c #D8D8D8", + "5 c #D4D4D4", + "6 c #E6E6E6", + "7 c #F1F1F1", + "8 c #838383", + "9 c #8E8E8E", + "0 c #8F8F8F", + "a c #CBCBCB", + "b c #CCCCCC", + "c c #E9E9E9", + "d c #F2F2F2", + "e c #EDEDED", + "f c #B5B5B5", + "g c #A6A6A6", + "h c #ABABAB", + "i c #BBBBBB", + "j c #B0B0B0", + "k c #EAEAEA", + "l c #6C6C6C", + "m c #BCBCBC", + "n c #F5F5F5", + "o c #FAFAFA", + "p c #B6B6B6", + "q c #F3F3F3", + "r c #CFCFCF", + "s c #FBFBFB", + "t c #CDCDCD", + "u c #DDDDDD", + "v c #999999", + "w c #F0F0F0", + "x c #2B2B2B", + "y c #C3C3C3", + "z c #A4A4A4", + "A c #D7D7D7", + "B c #E7E7E7", + "C c #6E6E6E", + "D c #9D9D9D", + "E c #BABABA", + "F c #AEAEAE", + "G c #898989", + "H c #646464", + "I c #BDBDBD", + "J c #CACACA", + "K c #2A2A2A", + "L c #212121", + "M c #B7B7B7", + "N c #F4F4F4", + "O c #737373", + "P c #828282", + "Q c #4D4D4D", + "R c #000000", + "S c #151515", + "T c #B2B2B2", + "U c #D6D6D6", + "V c #D3D3D3", + "W c #2F2F2F", + "X c #636363", + "Y c #A1A1A1", + "Z c #BFBFBF", + "` c #E0E0E0", + " . c #6A6A6A", + ".. c #050505", + "+. c #A3A3A3", + "@. c #202020", + "#. c #5F5F5F", + "$. c #B9B9B9", + "%. c #C7C7C7", + "&. c #D0D0D0", + "*. c #3E3E3E", + "=. c #666666", + "-. c #DBDBDB", + ";. c #424242", + ">. c #C2C2C2", + ",. c #1A1A1A", + "'. c #2C2C2C", + "). c #F6F6F6", + "!. c #AAAAAA", + "~. c #DCDCDC", + "{. c #2D2D2D", + "]. c #2E2E2E", + "^. c #A7A7A7", + "/. c #656565", + "(. c #333333", + "_. c #464646", + ":. c #C4C4C4", + "<. c #B8B8B8", + "[. c #292929", + "}. c #979797", + "|. c #EFEFEF", + "1. c #909090", + "2. c #8A8A8A", + "3. c #575757", + "4. c #676767", + "5. c #C5C5C5", + "6. c #7A7A7A", + "7. c #797979", + "8. c #989898", + "9. c #EEEEEE", + "0. c #707070", + "a. c #C8C8C8", + "b. c #111111", + "c. c #AFAFAF", + "d. c #474747", + "e. c #565656", + "f. c #E3E3E3", + "g. c #494949", + "h. c #5B5B5B", + "i. c #222222", + "j. c #353535", + "k. c #D9D9D9", + "l. c #0A0A0A", + "m. c #858585", + "n. c #E5E5E5", + "o. c #0E0E0E", + "p. c #9A9A9A", + "q. c #6F6F6F", + "r. c #868686", + "s. c #060606", + "t. c #1E1E1E", + "u. c #E8E8E8", + "v. c #A5A5A5", + "w. c #0D0D0D", + "x. c #030303", + "y. c #272727", + "z. c #131313", + "A. c #1F1F1F", + "B. c #757575", + "C. c #F7F7F7", + "D. c #414141", + "E. c #080808", + "F. c #6B6B6B", + "G. c #313131", + "H. c #C0C0C0", + "I. c #C9C9C9", + "J. c #0B0B0B", + "K. c #232323", + "L. c #434343", + "M. c #3D3D3D", + "N. c #282828", + "O. c #7C7C7C", + "P. c #252525", + "Q. c #3A3A3A", + "R. c #F8F8F8", + "S. c #1B1B1B", + "T. c #949494", + "U. c #3B3B3B", + "V. c #242424", + "W. c #383838", + "X. c #6D6D6D", + "Y. c #818181", + "Z. c #939393", + "`. c #9E9E9E", + " + c #929292", + ".+ c #7D7D7D", + "++ c #ADADAD", + "@+ c #DADADA", + "#+ c #919191", + "$+ c #E1E1E1", + "%+ c #BEBEBE", + "&+ c #ACACAC", + "*+ c #9C9C9C", + "=+ c #B3B3B3", + "-+ c #808080", + ";+ c #A8A8A8", + ">+ c #393939", + ",+ c #747474", + "'+ c #7F7F7F", + ")+ c #D1D1D1", + "!+ c #606060", + "~+ c #5C5C5C", + "{+ c #686868", + "]+ c #7E7E7E", + "^+ c #787878", + "/+ c #595959", + ". . . + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / . . + + ", + ". ( + _ : < [ & } | 1 2 $ 3 4 5 3 6 7 + + 8 9 + . + . ", + ". + 0 9 a ( 3 a b c d e c f g h i g j $ k + l m + . + ", + "+ 2 8 n o p | ( q r s . # t + + + u ^ v e w + x + + + ", + "+ y z . @ A k B 7 n + ( s | p 8 C D 2 E 4 + + F G + . ", + "# H I $ J G K L - M N . 2 O P Q R R S T U s s V W j + ", + "X Y Z @ o ` _ g ...+.( 4 @.#.m G $.%.7 &.X *.=.-.;.&.", + "Q >.C ,.'.} e + ).!.k + . + + . ~.{.> ].x f 7 ^./.k (.", + "_.:.4 @ <.[.}.|.1.2.+ + + >.} 4 B + ( @ _ 3.4.5.6.r 7.", + "3.8.9.~ 0.+ a.Q b.+ + c.d.#.=.$ |.b #.e.z ^ ; ^. .f.g.", + "-.h.+ i.S M + # p j.% n 9.5.k.H l.m.V ^.n.o.M + M p.q.", + "7 r.N s.1.R t.<.|.| u.v.~ w.x.E + s y.z.A.B.C.+ 5 D.q ", + ").p.2 E.0.9 F.%.O {._ @.+ + i { [ i.G.H.P I.+ s q.} + ", + ").p.6 J.R b.K.L.M.A.! b.g.K [.R M k + N.I + + >.O.+ . ", + ").8.9.N.P...R R R R E.t.W n.+ Q.R.6 @.| + . + S.+ + . ", + "n }.w T.U.B.<.i.@ Y + + U.+ c u V.= B B 7 u.W.c + . + ", + "N T.# + }.X.Y.,.8.F.8 Z.[.`. +.+}.4 ++@+O.< ~.+ ( . + ", + "d #+1 + _ ~.u.$+b $.y @+| $+%+I.&+k.h W +.9.+ ( . + . ", + "w 0 |.*+. >.<.=+++++p a.p -+;+5.k.>+,+@ + . . + . + + ", + "q '+9.R.^ I.t b %.I.)+4 $+n.I.,+ .|.+ . . . + . + + + ", + ". p !+( + + + + + + E 0. .-+8.f.+ + . . + + . + + + + ", + ". ( A ~+{+]+^+l > /+D f.c q . + . . + + . + + + + + + " +] + +class QImageTest(UsesQApplication): + '''Test case for calling setPixel with float as argument''' + + def testQImageStringBuffer(self): + '''Test if the QImage signatures receiving string buffers exist.''' + img0 = QImage(adjust_filename('sample.png', __file__)) + + # btw let's test the bits() method + img1 = QImage(img0.bits(), img0.width(), img0.height(), img0.format()) + self.assertEqual(img0, img1) + img2 = QImage(img0.bits(), img0.width(), img0.height(), img0.bytesPerLine(), img0.format()) + self.assertEqual(img0, img2) + + ## test scanLine method + data1 = img0.scanLine(0) + data2 = img1.scanLine(0) + self.assertEqual(data1, data2) + + # PySide python 3.x does not support slice yet + if not py3k.IS_PY3K: + buff = py3k.buffer(img0.bits()[:img0.bytesPerLine()]) + self.assertEqual(data1, buff) + self.assertEqual(data2, buff) + + def testEmptyBuffer(self): + img = QImage(py3k.buffer(''), 100, 100, QImage.Format_ARGB32) + + def testEmptyStringAsBuffer(self): + img = QImage(py3k.b(''), 100, 100, QImage.Format_ARGB32) + + def testXpmConstructor(self): + label = QLabel() + img = QImage(xpm) + self.assertFalse(img.isNull()) + self.assertEqual(img.width(), 27) + self.assertEqual(img.height(), 22) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py b/sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py new file mode 100644 index 000000000..3f94dcd44 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py @@ -0,0 +1,52 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2 import QtCore, QtWidgets +from helper import UsesQApplication, TimedQApplication + +class TestInputDialog(TimedQApplication): + + def testGetDouble(self): + self.assertEqual(QtWidgets.QInputDialog.getDouble(None, "title", "label"), (0.0, False)) + + def testGetInt(self): + self.assertEqual(QtWidgets.QInputDialog.getInt(None, "title", "label"), (0, False)) + + def testGetItem(self): + (item, bool) = QtWidgets.QInputDialog.getItem(None, "title", "label", ["1", "2", "3"]) + self.assertEqual(str(item), "1") + + def testGetText(self): + (text, bool) = QtWidgets.QInputDialog.getText(None, "title", "label") + self.assertEqual(str(text),"") + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py b/sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py new file mode 100644 index 000000000..0591df1ba --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QKeySequenceEdit.''' + +import unittest +from PySide2.QtCore import QTimer +from PySide2.QtWidgets import QKeySequenceEdit + +from helper import UsesQApplication + +class QKeySequenceEditTest(UsesQApplication): + def testKeySequence(self): + keySequenceEdit = QKeySequenceEdit() + keySequenceEdit.show() + QTimer.singleShot(0, keySequenceEdit.close) + self.app.exec_() + print(keySequenceEdit.keySequence()) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qlayout_ref_test.py b/sources/pyside2/tests/QtWidgets/qlayout_ref_test.py new file mode 100644 index 000000000..f1a9f363f --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qlayout_ref_test.py @@ -0,0 +1,179 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QLayout handling of child widgets references''' + +import unittest +from sys import getrefcount + +from PySide2.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout, QWidget +from PySide2.QtWidgets import QStackedLayout, QFormLayout +from PySide2.QtWidgets import QApplication, QPushButton, QLabel + +from helper import UsesQApplication + +class SaveReference(UsesQApplication): + '''Test case to check if QLayout-derived classes increment the refcount + of widgets passed to addWidget()''' + + # Adding here as nose can't see the qapplication attrib we inherit + qapplication = True + + def setUp(self): + #Acquire resources + super(SaveReference, self).setUp() + self.widget1 = QPushButton('click me') + self.widget2 = QLabel('aaa') + + def tearDown(self): + #Release resources + del self.widget2 + del self.widget1 + super(SaveReference, self).tearDown() + + def checkLayoutReference(self, layout): + #Checks the reference cound handling of layout.addWidget + self.assertEqual(getrefcount(self.widget1), 2) + layout.addWidget(self.widget1) + self.assertEqual(getrefcount(self.widget1), 3) + + self.assertEqual(getrefcount(self.widget2), 2) + layout.addWidget(self.widget2) + self.assertEqual(getrefcount(self.widget2), 3) + + # Check if doesn't mess around with previous widget refcount + self.assertEqual(getrefcount(self.widget1), 3) + + def testMoveLayout(self): + l = QHBoxLayout() + self.assertEqual(getrefcount(self.widget1), 2) + l.addWidget(self.widget1) + self.assertEqual(getrefcount(self.widget1), 3) + + w = QWidget() + w.setLayout(l) + self.assertEqual(getrefcount(self.widget1), 3) + + + def testHBoxReference(self): + #QHBoxLayout.addWidget reference count + w = QWidget() + self.checkLayoutReference(QHBoxLayout(w)) + + def testVBoxReference(self): + #QVBoxLayout.addWidget reference count + w = QWidget() + self.checkLayoutReference(QVBoxLayout(w)) + + def testGridReference(self): + #QGridLayout.addWidget reference count + w = QWidget() + self.checkLayoutReference(QGridLayout(w)) + + def testFormReference(self): + #QFormLayout.addWidget reference count + w = QWidget() + self.checkLayoutReference(QFormLayout(w)) + + def testStackedReference(self): + #QStackedLayout.addWidget reference count + w = QWidget() + self.checkLayoutReference(QStackedLayout(w)) + +class MultipleAdd(UsesQApplication): + '''Test case to check if refcount is incremented only once when multiple + calls to addWidget are made with the same widget''' + + qapplication = True + + def setUp(self): + #Acquire resources + super(MultipleAdd, self).setUp() + self.widget = QPushButton('click me') + self.win = QWidget() + self.layout = QHBoxLayout(self.win) + + def tearDown(self): + #Release resources + del self.widget + del self.layout + del self.win + super(MultipleAdd, self).tearDown() + + def testRefCount(self): + #Multiple QLayout.addWidget calls on the same widget + self.assertEqual(getrefcount(self.widget), 2) + self.layout.addWidget(self.widget) + self.assertEqual(getrefcount(self.widget), 3) + self.layout.addWidget(self.widget) + self.assertEqual(getrefcount(self.widget), 3) + self.layout.addWidget(self.widget) + self.assertEqual(getrefcount(self.widget), 3) + +class InternalAdd(UsesQApplication): + def testInternalRef(self): + mw = QWidget() + w = QWidget() + ow = QWidget() + + topLayout = QGridLayout() + + # unique reference + self.assertEqual(getrefcount(w), 2) + self.assertEqual(getrefcount(ow), 2) + + topLayout.addWidget(w, 0, 0) + topLayout.addWidget(ow, 1, 0) + + # layout keep the referemce + self.assertEqual(getrefcount(w), 3) + self.assertEqual(getrefcount(ow), 3) + + mainLayout = QGridLayout() + + mainLayout.addLayout(topLayout, 1, 0, 1, 4) + + # the same reference + self.assertEqual(getrefcount(w), 3) + self.assertEqual(getrefcount(ow), 3) + + mw.setLayout(mainLayout) + + # now trasfer the ownership to mw + self.assertEqual(getrefcount(w), 3) + self.assertEqual(getrefcount(ow), 3) + + del mw + + # remove the ref and invalidate the widget + self.assertEqual(getrefcount(w), 2) + self.assertEqual(getrefcount(ow), 2) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qlayout_test.py b/sources/pyside2/tests/QtWidgets/qlayout_test.py new file mode 100644 index 000000000..684a6c409 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qlayout_test.py @@ -0,0 +1,140 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys + +from helper import UsesQApplication +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class MyLayout(QLayout): + def __init__(self, parent=None): + QLayout.__init__(self, parent) + self._list = [] + + def addItem(self, item): + self.add(item) + + def addWidget(self, widget): + self.add(QWidgetItem(widget)) + + def itemAt(self, index): + if index < len(self._list): + return self._list[index] + + return None + + def count(self): + return len(self._list) + + def add(self, item): + self._list.append(item) + +class MissingItemAtLayout(QLayout): + def __init__(self, parent=None): + QLayout.__init__(self, parent) + self._list = [] + + def addItem(self, item): + self.add(item) + + def addWidget(self, widget): + self.add(QWidgetItem(widget)) + + def count(self): + return len(self._list) + + def add(self, item): + self._list.append(item) + +#Test if a layout implemented in python, the QWidget.setLayout works +#fine because this implement som layout functions used in glue code of +#QWidget, then in c++ when call a virtual function this need call the QLayout +#function implemented in python + +class QLayoutTest(UsesQApplication): + def testOwnershipTransfer(self): + b = QPushButton("teste") + l = MyLayout() + + l.addWidget(b) + + self.assertEqual(sys.getrefcount(b), 2) + + w = QWidget() + + #transfer ref + w.setLayout(l) + + self.assertEqual(sys.getrefcount(b), 3) + + + def testReferenceTransfer(self): + b = QPushButton("teste") + l = QHBoxLayout() + + # keep ref + l.addWidget(b) + self.assertEqual(sys.getrefcount(b), 3) + + w = QWidget() + + # transfer ref + w.setLayout(l) + + self.assertEqual(sys.getrefcount(b), 3) + + # release ref + del w + + self.assertEqual(sys.getrefcount(b), 2) + + def testMissingFunctions(self): + w = QWidget() + b = QPushButton("test") + l = MissingItemAtLayout() + + l.addWidget(b) + + self.assertRaises(RuntimeError, w.setLayout, l) + + def testQFormLayout(self): + w = QWidget() + formLayout = QFormLayout() + spacer = QSpacerItem(100, 30) + formLayout.setItem(0, QFormLayout.SpanningRole, spacer) + w.setLayout(formLayout) + w.show() + QTimer.singleShot(10, w.close) + self.app.exec_() + del w + self.assertRaises(RuntimeError, spacer.isEmpty) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qlcdnumber_test.py b/sources/pyside2/tests/QtWidgets/qlcdnumber_test.py new file mode 100644 index 000000000..56a983d0d --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qlcdnumber_test.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtWidgets import QApplication, QLCDNumber + +class QLCDNumberOverflow(unittest.TestCase): + '''Test case for unhandled overflow on QLCDNumber() numDigits argument (see bug #215).''' + + def setUp(self): + self.app = QApplication([]) + + def testnumDigitsOverflow(self): + # NOTE: PyQt4 raises TypeError, but boost.python raises OverflowError + self.assertRaises(OverflowError, QLCDNumber, 840835495615213080) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qlistwidget_test.py b/sources/pyside2/tests/QtWidgets/qlistwidget_test.py new file mode 100644 index 000000000..b89d2f77c --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qlistwidget_test.py @@ -0,0 +1,82 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import sys +from PySide2 import QtWidgets, QtCore +from helper import UsesQApplication + +class QListWidgetTest(UsesQApplication): + + def populateList(self, lst): + o = QtCore.QObject() + o.setObjectName("obj") + + item = QtWidgets.QListWidgetItem("item0") + item.setData(QtCore.Qt.UserRole, o) + #item._data = o + self.assertTrue(sys.getrefcount(o), 3) + self.assertTrue(sys.getrefcount(item), 2) + lst.addItem(item) + self.assertTrue(sys.getrefcount(item), 3) + + def checkCurrentItem(self, lst): + item = lst.currentItem() + self.assertTrue(sys.getrefcount(item), 3) + + def checkItemData(self, lst): + item = lst.currentItem() + o = item.data(QtCore.Qt.UserRole) + self.assertTrue(sys.getrefcount(o), 4) + self.assertEqual(o, item._data) + self.assertTrue(sys.getrefcount(o), 2) + + def testConstructorWithParent(self): + lst = QtWidgets.QListWidget() + self.populateList(lst) + self.checkCurrentItem(lst) + i = lst.item(0) + self.assertTrue(sys.getrefcount(i), 3) + + del lst + self.assertTrue(sys.getrefcount(i), 2) + del i + + def testIt(self): + lst = QtWidgets.QListWidget() + lst.show() + slot = lambda : lst.removeItemWidget(lst.currentItem()) + lst.addItem(QtWidgets.QListWidgetItem("foo")) + QtCore.QTimer.singleShot(0, slot) + QtCore.QTimer.singleShot(0, lst.close) + self.app.exec_() + self.assertEqual(lst.count(), 1) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py b/sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py new file mode 100644 index 000000000..284b5ef83 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py @@ -0,0 +1,56 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2 import QtWidgets + +from helper import UsesQApplication + +class QListWidgetItemConstructor(UsesQApplication): + + def setUp(self): + super(QListWidgetItemConstructor, self).setUp() + self.widgetList = QtWidgets.QListWidget() + + def tearDown(self): + del self.widgetList + super(QListWidgetItemConstructor, self).tearDown() + + def testConstructorWithParent(self): + # Bug 235 - QListWidgetItem constructor not saving ownership + QtWidgets.QListWidgetItem(self.widgetList) + item = self.widgetList.item(0) + self.assertEqual(item.listWidget(), self.widgetList) + + def testConstructorWithNone(self): + # Bug 452 - QListWidgetItem() not casting NoneType to null correctly. + item = QtWidgets.QListWidgetItem(None, 123) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qmainwindow_test.py b/sources/pyside2/tests/QtWidgets/qmainwindow_test.py new file mode 100644 index 000000000..ae1129494 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qmainwindow_test.py @@ -0,0 +1,113 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys +import weakref + +from PySide2 import QtWidgets +from PySide2 import QtCore + +from helper import UsesQApplication + +class MainWindow(QtWidgets.QMainWindow): + def __init__(self): + QtWidgets.QMainWindow.__init__(self) + + self.createToolbar() + + def createToolbar(self): + pointerButton = QtWidgets.QToolButton() + pointerToolbar = self.addToolBar("Pointer type") + pointerToolbar.addWidget(pointerButton) + +class MyButton(QtWidgets.QPushButton): + def __init__(self, parent=None): + QtWidgets.QPushButton.__init__(self) + self._called = False + + def myCallback(self): + self._called = True + + +class TestMainWindow(UsesQApplication): + + def testCreateToolbar(self): + w = MainWindow() + w.show() + QtCore.QTimer.singleShot(1000, self.app.quit) + self.app.exec_() + + def objDel(self, obj): + self.app.quit() + + def testRefCountToNull(self): + w = QtWidgets.QMainWindow() + c = QtWidgets.QWidget() + self.assertEqual(sys.getrefcount(c), 2) + w.setCentralWidget(c) + self.assertEqual(sys.getrefcount(c), 3) + wr = weakref.ref(c, self.objDel) + w.setCentralWidget(None) + c = None + self.app.exec_() + + def testRefCountToAnother(self): + w = QtWidgets.QMainWindow() + c = QtWidgets.QWidget() + self.assertEqual(sys.getrefcount(c), 2) + w.setCentralWidget(c) + self.assertEqual(sys.getrefcount(c), 3) + + c2 = QtWidgets.QWidget() + w.setCentralWidget(c2) + self.assertEqual(sys.getrefcount(c2), 3) + + wr = weakref.ref(c, self.objDel) + w.setCentralWidget(None) + c = None + + self.app.exec_() + + def testSignalDisconect(self): + w = QtWidgets.QMainWindow() + b = MyButton("button") + b.clicked.connect(b.myCallback) + w.setCentralWidget(b) + + b = MyButton("button") + b.clicked.connect(b.myCallback) + w.setCentralWidget(b) + + b.click() + self.assertEqual(b._called, True) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qmenu_test.py b/sources/pyside2/tests/QtWidgets/qmenu_test.py new file mode 100644 index 000000000..f5b9cbd02 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qmenu_test.py @@ -0,0 +1,86 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtWidgets import QMenu +from PySide2.QtGui import QKeySequence, QIcon +from PySide2.QtCore import SLOT + +from helper import UsesQApplication + +class QMenuAddAction(UsesQApplication): + + def setUp(self): + super(QMenuAddAction, self).setUp() + self.menu = QMenu() + + def tearDown(self): + del self.menu + super(QMenuAddAction, self).tearDown() + + def testAddActionWithoutKeySequenceCallable(self): + # bug #280 + action = self.menu.addAction(self.app.tr('aaa'), lambda : 1) + + def testAddActionKeySequenceCallable(self): + # bug #228 + action = self.menu.addAction(self.app.tr('aaa'), lambda : 1, + QKeySequence(self.app.tr('Ctrl+O'))) + + def testAddActionKeySequenceSlot(self): + action = self.menu.addAction('Quit', self.app, SLOT('quit()'), + QKeySequence('Ctrl+O')) + +class QMenuAddActionWithIcon(UsesQApplication): + + def setUp(self): + super(QMenuAddActionWithIcon, self).setUp() + self.menu = QMenu() + self.icon = QIcon() + + def tearDown(self): + del self.menu + del self.icon + super(QMenuAddActionWithIcon, self).tearDown() + + def testAddActionWithoutKeySequenceCallable(self): + # bug #280 + action = self.menu.addAction(self.icon, self.app.tr('aaa'), lambda : 1) + + def testAddActionKeySequenceCallable(self): + # bug #228 + action = self.menu.addAction(self.icon, self.app.tr('aaa'), lambda : 1, + QKeySequence(self.app.tr('Ctrl+O'))) + + def testAddActionKeySequenceSlot(self): + action = self.menu.addAction(self.icon, 'Quit', self.app, SLOT('quit()'), + QKeySequence('Ctrl+O')) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qmenuadd_test.py b/sources/pyside2/tests/QtWidgets/qmenuadd_test.py new file mode 100644 index 000000000..39fa50a0d --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qmenuadd_test.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test the QMenu.addAction() method''' + +import unittest +import sys + +from PySide2 import QtWidgets + +from helper import UsesQApplication + +class QMenuAddAction(UsesQApplication): + + def openFile(self, *args): + self.arg = args + + def testQMenuAddAction(self): + fileMenu = QtWidgets.QMenu("&File") + + addNewAction = fileMenu.addAction("&Open...", self.openFile) + addNewAction.trigger() + self.assertEqual(self.arg, ()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qobject_mi_test.py b/sources/pyside2/tests/QtWidgets/qobject_mi_test.py new file mode 100644 index 000000000..e0c98b2a7 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qobject_mi_test.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for multiple inheritance from 2 QObjects''' + +import unittest + +from PySide2.QtCore import QObject +from PySide2.QtGui import * +from PySide2.QtWidgets import * + +from helper import UsesQApplication + +class WidgetValidator(QWidget, QIntValidator): + def __init__(self, parent=None): + QWidget.__init__(self, parent) + QIntValidator.__init__(self, parent) + + +class DoubleQObjectInheritanceTest(UsesQApplication): + + def testDouble(self): + '''Double inheritance from QObject classes''' + + obj = WidgetValidator() + + #QObject methods + obj.setObjectName('aaaa') + self.assertEqual(obj.objectName(), 'aaaa') + + #QWidget methods + obj.setVisible(False) + self.assertFalse(obj.isVisible()) + + #QIntValidator methods + state, string, number = obj.validate('aaaa', 0) + self.assertEqual(state, QValidator.Invalid) + state, string, number = obj.validate('33', 0) + self.assertEqual(state, QValidator.Acceptable) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qpen_test.py b/sources/pyside2/tests/QtWidgets/qpen_test.py new file mode 100644 index 000000000..75c728884 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qpen_test.py @@ -0,0 +1,72 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from helper import UsesQApplication + +from PySide2.QtCore import Qt, QTimer +from PySide2.QtGui import QPen, QPainter +from PySide2.QtWidgets import QWidget + +class Painting(QWidget): + def __init__(self): + QWidget.__init__(self) + self.penFromEnum = None + self.penFromInteger = None + + def paintEvent(self, event): + painter = QPainter(self) + painter.setPen(Qt.NoPen) + self.penFromEnum = painter.pen() + painter.setPen(int(Qt.NoPen)) + self.penFromInteger = painter.pen() + + +class QPenTest(UsesQApplication): + + def testCtorWithCreatedEnums(self): + '''A simple case of QPen creation using created enums.''' + width = 0 + style = Qt.PenStyle(0) + cap = Qt.PenCapStyle(0) + join = Qt.PenJoinStyle(0) + pen = QPen(Qt.blue, width, style, cap, join) + + def testSetPenWithPenStyleEnum(self): + '''Calls QPainter.setPen with both enum and integer. Bug #511.''' + w = Painting() + w.show() + QTimer.singleShot(1000, self.app.quit) + self.app.exec_() + self.assertEqual(w.penFromEnum.style(), Qt.NoPen) + self.assertEqual(w.penFromInteger.style(), Qt.SolidLine) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qpicture_test.py b/sources/pyside2/tests/QtWidgets/qpicture_test.py new file mode 100644 index 000000000..15a527f6b --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qpicture_test.py @@ -0,0 +1,66 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import os +from helper import UsesQApplication +from PySide2.QtCore import QTimer +from PySide2.QtGui import QPicture, QPainter +from PySide2.QtWidgets import QWidget + +class MyWidget(QWidget): + def paintEvent(self, e): + p = QPainter(self) + p.drawPicture(0, 0, self._picture) + self._app.quit() + +class QPictureTest(UsesQApplication): + def testFromData(self): + picture = QPicture() + painter = QPainter() + painter.begin(picture) + painter.drawEllipse(10,20, 80,70) + painter.end() + + data = picture.data() + picture2 = QPicture() + picture2.setData(data) + + self.assertEqual(picture2.data(), picture.data()) + + w = MyWidget() + w._picture = picture2 + w._app = self.app + + QTimer.singleShot(300, w.show) + self.app.exec_() + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qpixmap_constructor.py b/sources/pyside2/tests/QtWidgets/qpixmap_constructor.py new file mode 100644 index 000000000..9ae7d0fcf --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qpixmap_constructor.py @@ -0,0 +1,279 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QPixmap +from PySide2.QtWidgets import QLabel + +from helper import UsesQApplication + +xpm = [ + "27 22 206 2", + " c None", + ". c #FEFEFE", + "+ c #FFFFFF", + "@ c #F9F9F9", + "# c #ECECEC", + "$ c #D5D5D5", + "% c #A0A0A0", + "& c #767676", + "* c #525252", + "= c #484848", + "- c #4E4E4E", + "; c #555555", + "> c #545454", + ", c #5A5A5A", + "' c #4B4B4B", + ") c #4A4A4A", + "! c #4F4F4F", + "~ c #585858", + "{ c #515151", + "] c #4C4C4C", + "^ c #B1B1B1", + "/ c #FCFCFC", + "( c #FDFDFD", + "_ c #C1C1C1", + ": c #848484", + "< c #616161", + "[ c #5E5E5E", + "} c #CECECE", + "| c #E2E2E2", + "1 c #E4E4E4", + "2 c #DFDFDF", + "3 c #D2D2D2", + "4 c #D8D8D8", + "5 c #D4D4D4", + "6 c #E6E6E6", + "7 c #F1F1F1", + "8 c #838383", + "9 c #8E8E8E", + "0 c #8F8F8F", + "a c #CBCBCB", + "b c #CCCCCC", + "c c #E9E9E9", + "d c #F2F2F2", + "e c #EDEDED", + "f c #B5B5B5", + "g c #A6A6A6", + "h c #ABABAB", + "i c #BBBBBB", + "j c #B0B0B0", + "k c #EAEAEA", + "l c #6C6C6C", + "m c #BCBCBC", + "n c #F5F5F5", + "o c #FAFAFA", + "p c #B6B6B6", + "q c #F3F3F3", + "r c #CFCFCF", + "s c #FBFBFB", + "t c #CDCDCD", + "u c #DDDDDD", + "v c #999999", + "w c #F0F0F0", + "x c #2B2B2B", + "y c #C3C3C3", + "z c #A4A4A4", + "A c #D7D7D7", + "B c #E7E7E7", + "C c #6E6E6E", + "D c #9D9D9D", + "E c #BABABA", + "F c #AEAEAE", + "G c #898989", + "H c #646464", + "I c #BDBDBD", + "J c #CACACA", + "K c #2A2A2A", + "L c #212121", + "M c #B7B7B7", + "N c #F4F4F4", + "O c #737373", + "P c #828282", + "Q c #4D4D4D", + "R c #000000", + "S c #151515", + "T c #B2B2B2", + "U c #D6D6D6", + "V c #D3D3D3", + "W c #2F2F2F", + "X c #636363", + "Y c #A1A1A1", + "Z c #BFBFBF", + "` c #E0E0E0", + " . c #6A6A6A", + ".. c #050505", + "+. c #A3A3A3", + "@. c #202020", + "#. c #5F5F5F", + "$. c #B9B9B9", + "%. c #C7C7C7", + "&. c #D0D0D0", + "*. c #3E3E3E", + "=. c #666666", + "-. c #DBDBDB", + ";. c #424242", + ">. c #C2C2C2", + ",. c #1A1A1A", + "'. c #2C2C2C", + "). c #F6F6F6", + "!. c #AAAAAA", + "~. c #DCDCDC", + "{. c #2D2D2D", + "]. c #2E2E2E", + "^. c #A7A7A7", + "/. c #656565", + "(. c #333333", + "_. c #464646", + ":. c #C4C4C4", + "<. c #B8B8B8", + "[. c #292929", + "}. c #979797", + "|. c #EFEFEF", + "1. c #909090", + "2. c #8A8A8A", + "3. c #575757", + "4. c #676767", + "5. c #C5C5C5", + "6. c #7A7A7A", + "7. c #797979", + "8. c #989898", + "9. c #EEEEEE", + "0. c #707070", + "a. c #C8C8C8", + "b. c #111111", + "c. c #AFAFAF", + "d. c #474747", + "e. c #565656", + "f. c #E3E3E3", + "g. c #494949", + "h. c #5B5B5B", + "i. c #222222", + "j. c #353535", + "k. c #D9D9D9", + "l. c #0A0A0A", + "m. c #858585", + "n. c #E5E5E5", + "o. c #0E0E0E", + "p. c #9A9A9A", + "q. c #6F6F6F", + "r. c #868686", + "s. c #060606", + "t. c #1E1E1E", + "u. c #E8E8E8", + "v. c #A5A5A5", + "w. c #0D0D0D", + "x. c #030303", + "y. c #272727", + "z. c #131313", + "A. c #1F1F1F", + "B. c #757575", + "C. c #F7F7F7", + "D. c #414141", + "E. c #080808", + "F. c #6B6B6B", + "G. c #313131", + "H. c #C0C0C0", + "I. c #C9C9C9", + "J. c #0B0B0B", + "K. c #232323", + "L. c #434343", + "M. c #3D3D3D", + "N. c #282828", + "O. c #7C7C7C", + "P. c #252525", + "Q. c #3A3A3A", + "R. c #F8F8F8", + "S. c #1B1B1B", + "T. c #949494", + "U. c #3B3B3B", + "V. c #242424", + "W. c #383838", + "X. c #6D6D6D", + "Y. c #818181", + "Z. c #939393", + "`. c #9E9E9E", + " + c #929292", + ".+ c #7D7D7D", + "++ c #ADADAD", + "@+ c #DADADA", + "#+ c #919191", + "$+ c #E1E1E1", + "%+ c #BEBEBE", + "&+ c #ACACAC", + "*+ c #9C9C9C", + "=+ c #B3B3B3", + "-+ c #808080", + ";+ c #A8A8A8", + ">+ c #393939", + ",+ c #747474", + "'+ c #7F7F7F", + ")+ c #D1D1D1", + "!+ c #606060", + "~+ c #5C5C5C", + "{+ c #686868", + "]+ c #7E7E7E", + "^+ c #787878", + "/+ c #595959", + ". . . + @ # $ % & * = - ; > , ' ) ! ~ { ] ^ / . . + + ", + ". ( + _ : < [ & } | 1 2 $ 3 4 5 3 6 7 + + 8 9 + . + . ", + ". + 0 9 a ( 3 a b c d e c f g h i g j $ k + l m + . + ", + "+ 2 8 n o p | ( q r s . # t + + + u ^ v e w + x + + + ", + "+ y z . @ A k B 7 n + ( s | p 8 C D 2 E 4 + + F G + . ", + "# H I $ J G K L - M N . 2 O P Q R R S T U s s V W j + ", + "X Y Z @ o ` _ g ...+.( 4 @.#.m G $.%.7 &.X *.=.-.;.&.", + "Q >.C ,.'.} e + ).!.k + . + + . ~.{.> ].x f 7 ^./.k (.", + "_.:.4 @ <.[.}.|.1.2.+ + + >.} 4 B + ( @ _ 3.4.5.6.r 7.", + "3.8.9.~ 0.+ a.Q b.+ + c.d.#.=.$ |.b #.e.z ^ ; ^. .f.g.", + "-.h.+ i.S M + # p j.% n 9.5.k.H l.m.V ^.n.o.M + M p.q.", + "7 r.N s.1.R t.<.|.| u.v.~ w.x.E + s y.z.A.B.C.+ 5 D.q ", + ").p.2 E.0.9 F.%.O {._ @.+ + i { [ i.G.H.P I.+ s q.} + ", + ").p.6 J.R b.K.L.M.A.! b.g.K [.R M k + N.I + + >.O.+ . ", + ").8.9.N.P...R R R R E.t.W n.+ Q.R.6 @.| + . + S.+ + . ", + "n }.w T.U.B.<.i.@ Y + + U.+ c u V.= B B 7 u.W.c + . + ", + "N T.# + }.X.Y.,.8.F.8 Z.[.`. +.+}.4 ++@+O.< ~.+ ( . + ", + "d #+1 + _ ~.u.$+b $.y @+| $+%+I.&+k.h W +.9.+ ( . + . ", + "w 0 |.*+. >.<.=+++++p a.p -+;+5.k.>+,+@ + . . + . + + ", + "q '+9.R.^ I.t b %.I.)+4 $+n.I.,+ .|.+ . . . + . + + + ", + ". p !+( + + + + + + E 0. .-+8.f.+ + . . + + . + + + + ", + ". ( A ~+{+]+^+l > /+D f.c q . + . . + + . + + + + + + " +] + +class QStringSequenceTest(UsesQApplication): + def testQPixmapConstructor(self): + label = QLabel() + pixmap1 = QPixmap(xpm) + self.assertFalse(pixmap1.isNull()) + self.assertEqual(pixmap1.width(), 27) + self.assertEqual(pixmap1.height(), 22) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qpushbutton_test.py b/sources/pyside2/tests/QtWidgets/qpushbutton_test.py new file mode 100644 index 000000000..7039a8e3f --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qpushbutton_test.py @@ -0,0 +1,69 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from helper import UsesQApplication +from PySide2.QtWidgets import QPushButton, QMenu, QWidget +from PySide2.QtCore import QTimer + +class MyWidget(QWidget): + def __init__(self): + QWidget.__init__(self) + + m = QMenu(self) + b = QPushButton("Hello", self) + b.setMenu(m) + + +class QPushButtonTest(UsesQApplication): + def createMenu(self, button): + m = QMenu() + button.setMenu(m) + + def testSetMenu(self): + w = MyWidget() + w.show() + + timer = QTimer.singleShot(100, self.app.quit) + self.app.exec_() + + def buttonCb(self, checked): + self._clicked = True + + def testBoolinSignal(self): + b = QPushButton() + b.setCheckable(True) + self._clicked = False + b.toggled[bool].connect(self.buttonCb) + b.toggle() + self.assertTrue(self._clicked) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qshortcut_test.py b/sources/pyside2/tests/QtWidgets/qshortcut_test.py new file mode 100644 index 000000000..0cf749ebd --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qshortcut_test.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test the QShortcut constructor''' + +import unittest +import sys + +from PySide2 import QtCore, QtGui, QtWidgets + +class Foo(QtWidgets.QWidget): + def __init__(self): + QtWidgets.QWidget.__init__(self) + self.ok = False + self.copy = False + + def slot_of_foo(self): + self.ok = True + + def slot_of_copy(self): + self.copy = True + +class MyShortcut(QtWidgets.QShortcut): + def __init__(self, keys, wdg, slot): + QtWidgets.QShortcut.__init__(self, keys, wdg, slot) + + def emit_signal(self): + self.emit(QtCore.SIGNAL("activated()")) + +class QAppPresence(unittest.TestCase): + + def testQShortcut(self): + self.qapp = QtWidgets.QApplication([]) + f = Foo() + + self.sc = MyShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return), f, f.slot_of_foo) + self.scstd = MyShortcut(QtGui.QKeySequence.Copy, f, f.slot_of_copy) + QtCore.QTimer.singleShot(0, self.init); + self.qapp.exec_() + self.assertEqual(f.ok, True) + self.assertEqual(f.copy, True) + + def init(self): + self.sc.emit_signal(); + self.scstd.emit_signal(); + self.qapp.quit() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qsplitter_test.py b/sources/pyside2/tests/QtWidgets/qsplitter_test.py new file mode 100644 index 000000000..f90663155 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qsplitter_test.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtWidgets import QSplitter + +from helper import UsesQApplication + +class QSplitterTest(UsesQApplication): + + def testGetRange(self): + splitter = QSplitter() + _min, _max = splitter.getRange(0) + self.assertTrue(isinstance(_min, int)) + self.assertTrue(isinstance(_max, int)) + +if __name__ == "__main__": + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py b/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py new file mode 100644 index 000000000..2e9d260a3 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py @@ -0,0 +1,112 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys + +from PySide2.QtGui import QStandardItemModel, QStandardItem +from PySide2.QtWidgets import QWidget +try: + # the normal call with installed PySide2 + from PySide2 import shiboken2 as shiboken +except ImportError: + try: + # When running make test on macOS, shiboken2 is not part of the PySide2 module, + # so it needs to be imported as a standalone module. + import shiboken2 as shiboken + except ImportError: + # sys.path is set a bit weird during tests, so we help a little to find shiboken2. + sys.path.append("../../..") + # the special call with testrunner.py + from shiboken2.shibokenmodule import shiboken2 as shiboken +from helper import UsesQApplication + + +class QStandardItemModelTest(UsesQApplication): + + def setUp(self): + super(QStandardItemModelTest, self).setUp() + self.window = QWidget() + self.model = QStandardItemModel(0, 3, self.window) + + def tearDown(self): + del self.window + del self.model + super(QStandardItemModelTest, self).tearDown() + + def testInsertRow(self): + # bug #227 + self.model.insertRow(0) + + def testClear(self): + + model = QStandardItemModel() + root = model.invisibleRootItem() + model.clear() + self.assertFalse(shiboken.isValid(root)) + + +class QStandardItemModelRef(UsesQApplication): + def testRefCount(self): + model = QStandardItemModel(5, 5) + items = [] + for r in range(5): + row = [] + for c in range(5): + row.append(QStandardItem("%d,%d" % (r,c)) ) + self.assertEqual(sys.getrefcount(row[c]), 2) + + model.insertRow(r, row) + + for c in range(5): + ref_after = sys.getrefcount(row[c]) + # check if the ref count was incremented after insertRow + self.assertEqual(ref_after, 3) + + items.append(row) + row = None + + for r in range(3): + my_row = model.takeRow(0) + my_row = None + for c in range(5): + # only rest 1 reference + self.assertEqual(sys.getrefcount(items[r][c]), 2) + + my_i = model.item(0,0) + # ref(my_i) + parent_ref + items list ref + self.assertEqual(sys.getrefcount(my_i), 4) + + model.clear() + # ref(my_i) + self.assertEqual(sys.getrefcount(my_i), 3) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py new file mode 100644 index 000000000..ed4c5ad00 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py @@ -0,0 +1,61 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Tests conversions of QString to and from QKeySequence.''' + +import unittest +import py3kcompat as py3k +from helper import UsesQApplication + +from PySide2.QtGui import QKeySequence +from PySide2.QtWidgets import QAction + +class QStringQKeySequenceTest(UsesQApplication): + '''Tests conversions of QString to and from QKeySequence.''' + + def testQStringFromQKeySequence(self): + '''Creates a QString from a QKeySequence.''' + keyseq = 'Ctrl+A' + a = QKeySequence(keyseq) + self.assertEqual(a, keyseq) + + def testPythonStringAsQKeySequence(self): + '''Passes a Python string to an argument expecting a QKeySequence.''' + keyseq = py3k.unicode_('Ctrl+A') + action = QAction(None) + action.setShortcut(keyseq) + shortcut = action.shortcut() + self.assertTrue(isinstance(shortcut, QKeySequence)) + self.assertEqual(shortcut.toString(), keyseq) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qstyle_test.py b/sources/pyside2/tests/QtWidgets/qstyle_test.py new file mode 100644 index 000000000..0650c96e9 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qstyle_test.py @@ -0,0 +1,59 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from helper import UsesQApplication + +from PySide2.QtWidgets import QWidget, QLabel, QFontComboBox, QStyleFactory + +class SetStyleTest(UsesQApplication): + '''Tests setting the same QStyle for all objects in a UI hierarchy.''' + + def testSetStyle(self): + '''All this test have to do is not break with some invalid Python wrapper.''' + + def setStyleHelper(widget, style): + widget.setStyle(style) + widget.setPalette(style.standardPalette()) + for child in widget.children(): + if isinstance(child, QWidget): + setStyleHelper(child, style) + + container = QWidget() + # QFontComboBox is used because it has an QLineEdit created in C++ inside it, + # and if the QWidget.setStyle(style) steals the ownership of the style + # for the C++ originated widget everything will break. + fontComboBox = QFontComboBox(container) + label = QLabel(container) + label.setText('Label') + style = QStyleFactory.create(QStyleFactory.keys()[0]) + setStyleHelper(container, style) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qtableview_test.py b/sources/pyside2/tests/QtWidgets/qtableview_test.py new file mode 100644 index 000000000..f7d0f4c4e --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qtableview_test.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QAbstractTableModel +from PySide2.QtWidgets import QTableWidget +from helper import UsesQApplication + +class QPenTest(UsesQApplication): + + def testItemModel(self): + tv = QTableWidget() + + self.assertEqual(type(tv.model()), QAbstractTableModel) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qtabwidget_test.py b/sources/pyside2/tests/QtWidgets/qtabwidget_test.py new file mode 100644 index 000000000..b36310ed0 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qtabwidget_test.py @@ -0,0 +1,56 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtWidgets import * +from helper import TimedQApplication + +def makeBug643(tab): + button = QPushButton('Foo') + tab.insertTab(0, button, 'Foo') + +class RemoveTabMethod(TimedQApplication): + def setUp(self): + TimedQApplication.setUp(self) + self.tab = QTabWidget() + + def tearDown(self): + del self.tab + TimedQApplication.tearDown(self) + + + def testRemoveTabPresence(self): + self.assertTrue(getattr(self.tab, 'removeTab')) + + def testInsertTab(self): + makeBug643(self.tab) + self.assertEqual(self.tab.count(), 1) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py b/sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py new file mode 100644 index 000000000..f60102806 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py @@ -0,0 +1,65 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2 import QtCore, QtWidgets +from helper import UsesQApplication + +import unittest + +class MyWindow(QtWidgets.QMainWindow): + appendText = QtCore.Signal(str) + + @QtCore.Slot() + def onButtonPressed(self): + self.appendText.emit("PySide") + + def __init__(self, parent=None): + super(MyWindow, self).__init__(parent) + + self.textEdit = QtWidgets.QTextEdit() + self.btn = QtWidgets.QPushButton("ClickMe") + self.btn.clicked.connect(self.onButtonPressed) + self.appendText.connect(self.textEdit.append) + + def start(self): + self.btn.click() + + def text(self): + return self.textEdit.toPlainText() + + +class testSignalWithCPPSlot(UsesQApplication): + + def testEmission(self): + w = MyWindow() + w.start() + self.assertEqual(w.text(), "PySide") + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qtextedit_test.py b/sources/pyside2/tests/QtWidgets/qtextedit_test.py new file mode 100644 index 000000000..f67f8fbe1 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qtextedit_test.py @@ -0,0 +1,60 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QTextEdit and ownership problems.''' + +import unittest +from sys import getrefcount +from PySide2.QtWidgets import QTextEdit + +from helper import UsesQApplication + +class DontTouchReference(UsesQApplication): + '''Check if the QTextTable returned by QTextCursor.insertTable() is not + referenced by the QTextCursor that returns it.''' + + def setUp(self): + super(DontTouchReference, self).setUp() + self.editor = QTextEdit() + self.cursor = self.editor.textCursor() + self.table = self.cursor.insertTable(1, 1) + + def testQTextTable(self): + # methods which return QTextTable should not increment its reference + self.assertEqual(getrefcount(self.table), 2) + f = self.cursor.currentFrame() + del f + self.assertEqual(getrefcount(self.table), 2) + # destroying the cursor should not raise any "RuntimeError: internal + # C++ object already deleted." when accessing the QTextTable + del self.cursor + self.assertEqual(getrefcount(self.table), 2) + cell = self.table.cellAt(0, 0) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py new file mode 100644 index 000000000..fc55d8bfe --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py @@ -0,0 +1,62 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QToolbar''' + +import unittest + +from PySide2.QtWidgets import QToolBar, QMainWindow, QAction + +from helper import UsesQApplication + +class AddActionText(UsesQApplication): + '''Test case for calling QToolbar.addAction passing a text''' + + def setUp(self): + #Acquire resources + super(AddActionText, self).setUp() + self.window = QMainWindow() + self.toolbar = QToolBar() + self.window.addToolBar(self.toolbar) + + def tearDown(self): + #Release resources + super(AddActionText, self).tearDown() + del self.toolbar + del self.window + + def testText(self): + #QToolBar.addAction(text) - add a QToolButton + self.toolbar.addAction('aaaa') + self.assertEqual(len(self.toolbar.actions()), 1) + action = self.toolbar.actions()[0] + self.assertTrue(isinstance(action, QAction)) + self.assertEqual(action.text(), 'aaaa') + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qtoolbox_test.py b/sources/pyside2/tests/QtWidgets/qtoolbox_test.py new file mode 100644 index 000000000..ac6e590d1 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qtoolbox_test.py @@ -0,0 +1,59 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QIcon +from PySide2.QtWidgets import QToolBox, QWidget + +from helper import UsesQApplication + +class OwnershipControl(UsesQApplication): + + def setUp(self): + super(OwnershipControl, self).setUp() + self.toolbox = QToolBox() + + def tearDown(self): + del self.toolbox + super(OwnershipControl, self).tearDown() + + def testAddItem(self): + # Was losing ownership of the widget. + index = self.toolbox.addItem(QWidget(), 'item') + item = self.toolbox.widget(index) + self.assertTrue(isinstance(item, QWidget)) + + def testAddItemWithIcon(self): + index = self.toolbox.addItem(QWidget(), QIcon(), 'item') + item = self.toolbox.widget(index) + self.assertTrue(isinstance(item, QWidget)) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qvalidator_test.py b/sources/pyside2/tests/QtWidgets/qvalidator_test.py new file mode 100644 index 000000000..951d6b2b0 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qvalidator_test.py @@ -0,0 +1,114 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtCore import * +from PySide2.QtGui import * +from PySide2.QtWidgets import * + +import unittest +from helper import UsesQApplication + +class MyValidator1(QValidator): + def fixUp(self, input): + return "fixed" + + def validate(self, input, pos): + return (QValidator.Acceptable, "fixed", 1) + +class MyValidator2(QValidator): + def fixUp(self, input): + return "fixed" + + def validate(self, input, pos): + return (QValidator.Acceptable, "fixed") + +class MyValidator3(QValidator): + def fixUp(self, input): + return "fixed" + + def validate(self, input, pos): + return (QValidator.Acceptable,) + +class MyValidator4(QValidator): + def fixUp(self, input): + return "fixed" + + def validate(self, input, pos): + return QValidator.Acceptable + +class QValidatorTest(UsesQApplication): + def testValidator1(self): + line = QLineEdit() + line.setValidator(MyValidator1()) + line.show() + line.setText("foo") + + QTimer.singleShot(0, line.close) + self.app.exec_() + + self.assertEqual(line.text(), "fixed") + self.assertEqual(line.cursorPosition(), 1) + + def testValidator2(self): + line = QLineEdit() + line.setValidator(MyValidator2()) + line.show() + line.setText("foo") + + QTimer.singleShot(0, line.close) + self.app.exec_() + + self.assertEqual(line.text(), "fixed") + self.assertEqual(line.cursorPosition(), 3) + + def testValidator3(self): + line = QLineEdit() + line.setValidator(MyValidator3()) + line.show() + line.setText("foo") + + QTimer.singleShot(0, line.close) + self.app.exec_() + + self.assertEqual(line.text(), "foo") + self.assertEqual(line.cursorPosition(), 3) + + def testValidator4(self): + line = QLineEdit() + line.setValidator(MyValidator4()) + line.show() + line.setText("foo") + + QTimer.singleShot(0, line.close) + self.app.exec_() + + self.assertEqual(line.text(), "foo") + self.assertEqual(line.cursorPosition(), 3) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qvariant_test.py b/sources/pyside2/tests/QtWidgets/qvariant_test.py new file mode 100644 index 000000000..f80460697 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qvariant_test.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class MyDiagram(QGraphicsScene): + pass + +class MyItem(QGraphicsRectItem): + def itemChange(self, change, value): + return value; + +class QGraphicsSceneOnQVariantTest(unittest.TestCase): + """Test storage ot QGraphicsScene into QVariants""" + def testIt(self): + app = QApplication([]) + s = MyDiagram() + i = MyItem() + s.addItem(i) + self.assertEqual(len(s.items()), 1) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py b/sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py new file mode 100644 index 000000000..fb5bebb53 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py @@ -0,0 +1,61 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtWidgets import QWidget, QVBoxLayout, QPushButton, QApplication, QHBoxLayout +from helper import UsesQApplication + +class QWidgetTest(UsesQApplication): + + def test_setLayout(self): + layout = QVBoxLayout() + btn1 = QPushButton("button_v1") + layout.addWidget(btn1) + + btn2 = QPushButton("button_v2") + layout.addWidget(btn2) + + layout2 = QHBoxLayout() + + btn1 = QPushButton("button_h1") + layout2.addWidget(btn1) + + btn2 = QPushButton("button_h2") + layout2.addWidget(btn2) + + layout.addLayout(layout2) + + widget = QWidget() + widget.setLayout(layout) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/qwidget_test.py b/sources/pyside2/tests/QtWidgets/qwidget_test.py new file mode 100644 index 000000000..22ea82cc6 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qwidget_test.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtWidgets import QWidget, QMainWindow +from helper import UsesQApplication + +class QWidgetInherit(QMainWindow): + def __init__(self): + QWidget.__init__(self) + +class QWidgetTest(UsesQApplication): + + def testInheritance(self): + self.assertRaises(TypeError, QWidgetInherit) + +class QWidgetVisible(UsesQApplication): + + def testBasic(self): + # Also related to bug #244, on existence of setVisible''' + widget = QWidget() + self.assertTrue(not widget.isVisible()) + widget.setVisible(True) + self.assertTrue(widget.isVisible()) + self.assertTrue(widget.winId() is not 0) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/reference_count_test.py b/sources/pyside2/tests/QtWidgets/reference_count_test.py new file mode 100644 index 000000000..9fa51f161 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/reference_count_test.py @@ -0,0 +1,99 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for Reference count when the object is created in c++ side''' + +import unittest + +import sys +import weakref +import gc + + +from PySide2.QtCore import Qt, QPointF +from PySide2.QtGui import QPolygonF +from PySide2.QtWidgets import QApplication, QGraphicsScene, QGraphicsRectItem, QGraphicsPolygonItem, QGraphicsRectItem + +from helper import UsesQApplication + +destroyedRect = False +destroyedPol = False + +def rect_del(o): + global destroyedRect + destroyedRect = True + +def pol_del(o): + global destroyedPol + destroyedPol = True + +class ReferenceCount(UsesQApplication): + + def setUp(self): + super(ReferenceCount, self).setUp() + self.scene = QGraphicsScene() + + def tearDown(self): + super(ReferenceCount, self).tearDown() + + def beforeTest(self): + points = [QPointF(0, 0), QPointF(100, 100), QPointF(0, 100)] + pol = self.scene.addPolygon(QPolygonF(points)) + self.assertTrue(isinstance(pol, QGraphicsPolygonItem)) + self.wrp = weakref.ref(pol, pol_del) + + #refcount need be 3 because one ref for QGraphicsScene, and one to rect obj + self.assertEqual(sys.getrefcount(pol), 3) + + def testReferenceCount(self): + global destroyedRect + global destroyedPol + + self.beforeTest() + + rect = self.scene.addRect(10.0, 10.0, 10.0, 10.0) + self.assertTrue(isinstance(rect, QGraphicsRectItem)) + + self.wrr = weakref.ref(rect, rect_del) + + #refcount need be 3 because one ref for QGraphicsScene, and one to rect obj + self.assertEqual(sys.getrefcount(rect), 3) + + del rect + #not destroyed because one ref continue in QGraphicsScene + self.assertEqual(destroyedRect, False) + self.assertEqual(destroyedPol, False) + + del self.scene + + #QGraphicsScene was destroyed and this destroy internal ref to rect + self.assertEqual(destroyedRect, True) + self.assertEqual(destroyedPol, True) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/returnquadruplesofnumbers_test.py b/sources/pyside2/tests/QtWidgets/returnquadruplesofnumbers_test.py new file mode 100644 index 000000000..6e4cfeb63 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/returnquadruplesofnumbers_test.py @@ -0,0 +1,95 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import unittest +from PySide2.QtGui import QTextCursor +from PySide2.QtPrintSupport import QPrinter +from PySide2.QtWidgets import QLayout, QWidget, QGraphicsLayout, QGraphicsLayoutItem + +from helper import UsesQApplication + +class Layout(QLayout): + def __init__(self): + QLayout.__init__(self) + +class GraphicsLayout(QGraphicsLayout): + def __init__(self): + QGraphicsLayout.__init__(self) + +class GraphicsLayoutItem(QGraphicsLayoutItem): + def __init__(self): + QGraphicsLayoutItem.__init__(self) + +class ReturnsQuadruplesOfNumbers(UsesQApplication): + def compareTuples(self, ta, tb): + for va,vb in zip(ta, tb): + if round(va) != round(vb): + return False + return True + + def testQGraphicsLayoutGetContentsMargins(self): + obj = GraphicsLayout() + values = (10.0, 20.0, 30.0, 40.0) + obj.setContentsMargins(*values) + self.assertTrue(self.compareTuples(obj.getContentsMargins(), values)) + + def testQGraphicsLayoutItemGetContentsMargins(self): + obj = GraphicsLayoutItem() + self.assertTrue(self.compareTuples(obj.getContentsMargins(), (0.0, 0.0, 0.0, 0.0))) + + def testQWidgetGetContentsMargins(self): + obj = QWidget() + values = (10, 20, 30, 40) + obj.setContentsMargins(*values) + self.assertTrue(self.compareTuples(obj.getContentsMargins(), values)) + + def testQLayoutGetContentsMargins(self): + obj = Layout() + values = (10, 20, 30, 40) + obj.setContentsMargins(*values) + self.assertTrue(self.compareTuples(obj.getContentsMargins(), values)) + + def testQTextCursorSelectedTableCells(self): + obj = QTextCursor() + self.assertEqual(obj.selectedTableCells(), (-1, -1, -1, -1)) + + def testQPrinterGetPageMargins(self): + # Bug #742 + obj = QPrinter() + # On macOS the minimum margin of a page is ~12, setting something lower than that will + # actually fail to set all the margins. + values = (15.0, 16.0, 17.0, 18.0, QPrinter.Point) + obj.setPageMargins(*values) + print(obj.getPageMargins(QPrinter.Point), values[:-1]) + self.assertTrue(self.compareTuples(obj.getPageMargins(QPrinter.Point), values[:-1])) + +if __name__ == "__main__": + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/sample.png b/sources/pyside2/tests/QtWidgets/sample.png new file mode 100644 index 000000000..60450f0dc Binary files /dev/null and b/sources/pyside2/tests/QtWidgets/sample.png differ diff --git a/sources/pyside2/tests/QtWidgets/standardpixmap_test.py b/sources/pyside2/tests/QtWidgets/standardpixmap_test.py new file mode 100644 index 000000000..dc93ba354 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/standardpixmap_test.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtGui import QPixmap +from PySide2.QtWidgets import QStyle + +from helper import UsesQApplication + +class StandardPixmapTest(UsesQApplication): + def testDefaultOptions(self): # Bug 253 + pixmap = self.app.style().standardPixmap(QStyle.SP_DirClosedIcon) + self.assertTrue(isinstance(pixmap, QPixmap)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/test_module_template.py b/sources/pyside2/tests/QtWidgets/test_module_template.py new file mode 100644 index 000000000..d5e9db0f0 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/test_module_template.py @@ -0,0 +1,40 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from PySide2.QtWidgets import QWidget +from PySide2.QtCore import QObject + +class MyQObject(QObject): + pass + +class MyQWidget(QWidget): + pass + +class Sentinel(): + value = 10 + diff --git a/sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py b/sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py new file mode 100644 index 000000000..b46ca8c88 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py @@ -0,0 +1,97 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for overriding inherited protected virtual methods''' + +import unittest + +from PySide2.QtCore import QTimerEvent +from PySide2.QtWidgets import QApplication, QSpinBox + +from helper import UsesQApplication + +class MySpinButton(QSpinBox): + '''Simple example class of overriding QObject.timerEvent''' + + def __init__(self, max_runs=5, app=None): + #Creates a new spinbox that will run and quit + super(MySpinButton, self).__init__() + + if app is None: + app = QApplication([]) + + self.app = app + self.max_runs = max_runs + self.runs = 0 + + def timerEvent(self, event): + #Timer event method + self.runs += 1 + + self.setValue(self.runs) + + if self.runs == self.max_runs: + self.app.quit() + + if not isinstance(event, QTimerEvent): + raise TypeError('Invalid event type. Must be TimerEvent') + +class TimerEventTest(UsesQApplication): + '''Test case for running QObject.timerEvent from inherited class''' + + qapplication = True + + def setUp(self): + #Acquire resources + super(TimerEventTest, self).setUp() + self.widget = MySpinButton(app=self.app) + + def tearDown(self): + #Release resources + del self.widget + super(TimerEventTest, self).tearDown() + + def testMethod(self): + #QWidget.timerEvent overrinding (protected inherited) + timer_id = self.widget.startTimer(0) + + self.app.exec_() + + self.widget.killTimer(timer_id) + + self.assertTrue(self.widget.runs >= self.widget.max_runs) + + +if __name__ == '__main__': + unittest.main() + #app = QApplication([]) + #widget = MySpinButton(app=app) + #widget.startTimer(500) + #widget.show() + #app.exec_() + diff --git a/sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py b/sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py new file mode 100644 index 000000000..d7b82d786 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py @@ -0,0 +1,77 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtWidgets import QGraphicsScene, QGraphicsRectItem, QGraphicsView, QApplication +from PySide2.QtGui import QBrush, QColor +from PySide2.QtCore import QTimer +from helper import UsesQApplication + +qgraphics_item_painted = False + +class RoundRectItem(QGraphicsRectItem): + + def __init__(self, x, y, w, h): + QGraphicsRectItem.__init__(self, x, y, w, h) + + def paint(self, painter, qstyleoptiongraphicsitem, qwidget): + global qgraphics_item_painted + qgraphics_item_painted = True + + +class QGraphicsItemTest(UsesQApplication): + + def createRoundRect(self, scene): + item = RoundRectItem(10, 10, 100, 100) + item.setBrush(QBrush(QColor(255, 0, 0))) + scene.addItem(item) + return item + + def quit_app(self): + self.app.quit() + + def test_setParentItem(self): + global qgraphics_item_painted + + scene = QGraphicsScene() + scene.addText("test") + view = QGraphicsView(scene) + + rect = self.createRoundRect(scene) + view.show() + QTimer.singleShot(1000, self.quit_app) + self.app.exec_() + self.assertTrue(qgraphics_item_painted) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtWidgets/wrong_return_test.py b/sources/pyside2/tests/QtWidgets/wrong_return_test.py new file mode 100644 index 000000000..f50420a64 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/wrong_return_test.py @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for Virtual functions with wrong return type''' + +import unittest +import py3kcompat as py3k +from PySide2 import QtWidgets +from helper import UsesQApplication + +import warnings +warnings.simplefilter('error') + + +class MyWidget(QtWidgets.QWidget): + def __init__(self, parent=None): + super(MyWidget, self).__init__(parent) + + def sizeHint(self): + pass + +class testCase(UsesQApplication): + + def testVirtualReturn(self): + w = MyWidget() + if py3k.IS_PY3K: + self.assertWarns(RuntimeWarning, w.show) + else: + self.assertRaises(RuntimeWarning, w.show) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWinExtras/CMakeLists.txt b/sources/pyside2/tests/QtWinExtras/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtWinExtras/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtWinExtras/this_module_loads_test.py b/sources/pyside2/tests/QtWinExtras/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtWinExtras/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtX11Extras/CMakeLists.txt b/sources/pyside2/tests/QtX11Extras/CMakeLists.txt new file mode 100644 index 000000000..79c5c83a9 --- /dev/null +++ b/sources/pyside2/tests/QtX11Extras/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(this_module_loads_test.py) diff --git a/sources/pyside2/tests/QtX11Extras/this_module_loads_test.py b/sources/pyside2/tests/QtX11Extras/this_module_loads_test.py new file mode 100644 index 000000000..0bf673546 --- /dev/null +++ b/sources/pyside2/tests/QtX11Extras/this_module_loads_test.py @@ -0,0 +1,39 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import os + +modname = os.path.basename(os.path.dirname(__file__)) +try: + exec("from PySide2 import {}".format(modname)) + print("The module {} loads. That is the minimum test, folks :-)".format(modname)) +except ImportError: + print("The module {} did not load! Did you include all classes in CMake?".format(modname)) + raise diff --git a/sources/pyside2/tests/QtXml/CMakeLists.txt b/sources/pyside2/tests/QtXml/CMakeLists.txt new file mode 100644 index 000000000..2c21bf87d --- /dev/null +++ b/sources/pyside2/tests/QtXml/CMakeLists.txt @@ -0,0 +1,2 @@ +PYSIDE_TEST(qdomdocument_test.py) +PYSIDE_TEST(qxmlsimplereader_test.py) diff --git a/sources/pyside2/tests/QtXml/qdomdocument_test.py b/sources/pyside2/tests/QtXml/qdomdocument_test.py new file mode 100644 index 000000000..ca797445f --- /dev/null +++ b/sources/pyside2/tests/QtXml/qdomdocument_test.py @@ -0,0 +1,96 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QByteArray +from PySide2.QtXml import QDomDocument, QDomElement + +class QDomDocumentTest(unittest.TestCase): + + def setUp(self): + self.dom = QDomDocument() + + self.goodXmlData = QByteArray(''' + + + + + ''') + + self.badXmlData = QByteArray(''' + + + + ''') + + def tearDown(self): + del self.dom + del self.goodXmlData + del self.badXmlData + + def testQDomDocumentSetContentWithBadXmlData(self): + '''Sets invalid xml as the QDomDocument contents.''' + ok, errorStr, errorLine, errorColumn = self.dom.setContent(self.badXmlData, True) + self.assertFalse(ok) + self.assertEqual(errorStr, 'tag mismatch') + self.assertEqual(errorLine, 4) + self.assertEqual(errorColumn, 21) + + def testQDomDocumentSetContentWithGoodXmlData(self): + '''Sets valid xml as the QDomDocument contents.''' + ok, errorStr, errorLine, errorColumn = self.dom.setContent(self.goodXmlData, True) + self.assertTrue(ok) + self.assertEqual(errorStr, '') + self.assertEqual(errorLine, 0) + self.assertEqual(errorColumn, 0) + + def testQDomDocumentData(self): + '''Checks the QDomDocument elements for the valid xml contents.''' + + def checkAttribute(element, attribute, value): + self.assertTrue(isinstance(root, QDomElement)) + self.assertFalse(element.isNull()) + self.assertTrue(element.hasAttribute(attribute)) + self.assertEqual(element.attribute(attribute), value) + + ok, errorStr, errorLine, errorColumn = self.dom.setContent(self.goodXmlData, True) + root = self.dom.documentElement() + self.assertEqual(root.tagName(), 'typesystem') + checkAttribute(root, 'package', 'PySide2.QtXml') + + child = root.firstChildElement('value-type') + checkAttribute(child, 'name', 'QDomDocument') + + child = child.nextSiblingElement('value-type') + checkAttribute(child, 'name', 'QDomElement') + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py b/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py new file mode 100644 index 000000000..d5df57953 --- /dev/null +++ b/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py @@ -0,0 +1,64 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtXml import QXmlSimpleReader + +class QXmlSimpleReaderTest(unittest.TestCase): + + def testQXmlSimpleReaderInstatiation(self): + '''QXmlSimpleReader must be a concrete class not an abstract one.''' + reader = QXmlSimpleReader() + + def testQXmlSimpleReaderFeatures(self): + '''Calls the QXmlSimpleReader.features method. The features checked + (at least the first two) can be found in the QXmlSimpleReader documentation: + http://qt.nokia.com/doc/4.6/qxmlsimplereader.html#setFeature + ''' + reader = QXmlSimpleReader() + hasFeature, ok = reader.feature('http://xml.org/sax/features/namespaces') + self.assertEqual((hasFeature, ok), (True, True)) + + hasFeature, ok = reader.feature('http://xml.org/sax/features/namespace-prefixes') + self.assertEqual((hasFeature, ok), (False, True)) + + hasFeature, ok = reader.feature('foobar') + self.assertEqual((hasFeature, ok), (False, False)) + + def testQXmlSimpleReaderProperty(self): + '''Tries to get a non existent property.''' + reader = QXmlSimpleReader() + prop, ok = reader.property('foo') + self.assertEqual((prop, ok), (None, False)) + reader.setProperty('foo', 'Something') + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt b/sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt new file mode 100644 index 000000000..7f570f156 --- /dev/null +++ b/sources/pyside2/tests/QtXmlPatterns/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(import_test.py) diff --git a/sources/pyside2/tests/QtXmlPatterns/import_test.py b/sources/pyside2/tests/QtXmlPatterns/import_test.py new file mode 100644 index 000000000..5c9c3fe5d --- /dev/null +++ b/sources/pyside2/tests/QtXmlPatterns/import_test.py @@ -0,0 +1,58 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * +from PySide2.QtXmlPatterns import QXmlSchema +from helper import UsesQCoreApplication + +class QXmlPatternsTest(UsesQCoreApplication): + + def testSchema(self): + data = QByteArray(''' + + ''') + + buf = QBuffer(data) + buf.open(QIODevice.ReadOnly) + + schema = QXmlSchema() + schema.load(buf) + self.assertTrue(schema.isValid()) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/mac/CMakeLists.txt b/sources/pyside2/tests/mac/CMakeLists.txt new file mode 100644 index 000000000..e1eb1a2fd --- /dev/null +++ b/sources/pyside2/tests/mac/CMakeLists.txt @@ -0,0 +1 @@ +PYSIDE_TEST(qmacstyle_test.py) diff --git a/sources/pyside2/tests/mac/qmacstyle_test.py b/sources/pyside2/tests/mac/qmacstyle_test.py new file mode 100644 index 000000000..47925a435 --- /dev/null +++ b/sources/pyside2/tests/mac/qmacstyle_test.py @@ -0,0 +1,45 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# Qt5: this is gone: from PySide2.QtGui import QMacStyle +from PySide2.QtWidgets import QApplication, QLabel, QStyleFactory +from PySide2.QtCore import QObject + +import unittest + +from helper import UsesQApplication + +QMacStyle = type(QStyleFactory.create('Macintosh')) + +class QMacStyleTest(UsesQApplication): + def testWidgetStyle(self): + w = QLabel('Hello') + self.assertTrue(isinstance(w.style(), QMacStyle)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/manually/README.txt b/sources/pyside2/tests/manually/README.txt new file mode 100644 index 000000000..da20e3824 --- /dev/null +++ b/sources/pyside2/tests/manually/README.txt @@ -0,0 +1,5 @@ +To run these tests is necessary some manuall input (most of then not supported by QTest[1]), +because of that this is not part of automatic test context. + + +[1]http://bugreports.qt.nokia.com/browse/QTBUG-13397 diff --git a/sources/pyside2/tests/manually/bug_841.py b/sources/pyside2/tests/manually/bug_841.py new file mode 100644 index 000000000..dce0a3a75 --- /dev/null +++ b/sources/pyside2/tests/manually/bug_841.py @@ -0,0 +1,79 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import sys + +from PySide2.QtGui import QStandardItem, QStandardItemModel +from PySide2.QtWidgets import QMainWindow, QTreeView, QAbstractItemView, QApplication, QMessageBox + +class Item(QStandardItem): + def __init__(self, text): + super(Item, self).__init__() + self.setText(text) + self.setDragEnabled(True) + self.setDropEnabled(True) + + def clone(self): + ret = Item(self.text()) + return ret + +class Project(QStandardItemModel): + def __init__(self): + super(Project, self).__init__() + self.setItemPrototype(Item("Prototype")) + # add some items so we have stuff to move around + self.appendRow(Item("ABC")) + self.appendRow(Item("DEF")) + self.appendRow(Item("GHI")) + +class MainWindow(QMainWindow): + def __init__(self): + super(MainWindow, self).__init__() + + self.model = Project() + self.view = QTreeView(self) + self.view.setModel(self.model) + self.view.setDragEnabled(True) + self.view.setDragDropMode(QAbstractItemView.InternalMove) + self.setCentralWidget(self.view) + + def mousePressEvent(self, e): + print(e.x(), e.y()) + return QMainWindow.mousePressEvent(self, e) + +def main(): + app = QApplication(sys.argv) + w = MainWindow() + w.show() + QMessageBox.information(None, "Info", "Just drag and drop the items.") + sys.exit(app.exec_()) + +if __name__ == "__main__": + main() diff --git a/sources/pyside2/tests/pysidetest/CMakeLists.txt b/sources/pyside2/tests/pysidetest/CMakeLists.txt new file mode 100644 index 000000000..3a5437e62 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/CMakeLists.txt @@ -0,0 +1,120 @@ +project(pysidetest) +project(testbinding) + +cmake_minimum_required(VERSION 2.6) + +set(QT_USE_QTCORE 1) +# no more supported: include(${QT_USE_FILE}) +add_definitions(${Qt5Core_DEFINITIONS}) +add_definitions(-DQT_SHARED) +add_definitions(-DRXX_ALLOCATOR_INIT_0) + +find_package(Qt5Widgets) + +set(pysidetest_SRC +testobject.cpp +testview.cpp +hiddenobject.cpp +) + +set(pysidetest_MOC_HEADERS +testobject.h +testview.h +hiddenobject.h +) + +qt5_wrap_cpp(pysidetest_MOC_SRC ${pysidetest_MOC_HEADERS}) + +set(testbinding_SRC +${CMAKE_CURRENT_BINARY_DIR}/testbinding/testobject_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/testbinding/intvalue_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/testbinding/pysidecpp_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/testbinding/pysidecpp_testobjectwithnamespace_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/testbinding/pysidecpp2_testobjectwithoutnamespace_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/testbinding/testview_wrapper.cpp +${CMAKE_CURRENT_BINARY_DIR}/testbinding/testbinding_module_wrapper.cpp +) + +make_path(testbinding_include_dirs ${pyside2_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../../PySide2 + ${CMAKE_CURRENT_SOURCE_DIR}/../../libpyside + ${QT_INCLUDE_DIR} + ${QT_INCLUDE_DIR}/QtCore + ${QT_INCLUDE_DIR}/QtGui + ${QT_INCLUDE_DIR}/QtWidgets + ) + +make_path(testbinding_typesystem_path ${CMAKE_CURRENT_SOURCE_DIR} + ${pyside2_SOURCE_DIR} + ${QtCore_SOURCE_DIR} ${QtGui_SOURCE_DIR} ${QtWidgets_SOURCE_DIR} + ${QtCore_BINARY_DIR} ${QtGui_BINARY_DIR} ${QtWidgets_BINARY_DIR} + ) + +add_custom_command(OUTPUT ${testbinding_SRC} +COMMAND ${SHIBOKEN_BINARY} ${GENERATOR_EXTRA_FLAGS} + ${CMAKE_CURRENT_SOURCE_DIR}/pysidetest_global.h + --include-paths=${testbinding_include_dirs} + --typesystem-paths=${testbinding_typesystem_path} + --output-directory=${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_pysidetest.xml + --api-version=${SUPPORTED_QT_VERSION} +WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +COMMENT "Running generator for test binding..." +) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${Qt5Widgets_INCLUDE_DIRS} + ${SHIBOKEN_INCLUDE_DIR} + ${pyside2_SOURCE_DIR} + ${QtCore_GEN_DIR} + ${QtGui_GEN_DIR} + ${QtWidgets_GEN_DIR} + ${libpyside_SOURCE_DIR} + ${SHIBOKEN_PYTHON_INCLUDE_DIR}) + +add_library(pysidetest SHARED ${pysidetest_SRC} ${pysidetest_MOC_SRC}) +target_link_libraries(pysidetest + ${Qt5Core_LIBRARIES} + ${Qt5Gui_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ) + +add_library(testbinding MODULE ${testbinding_SRC}) +set_property(TARGET testbinding PROPERTY PREFIX "") +if(WIN32) + set_target_properties(testbinding PROPERTIES SUFFIX ".pyd") +endif() +target_link_libraries(testbinding + pysidetest + pyside2 + ${PYTHON_LIBRARIES} + ${SHIBOKEN_LIBRARY} + ${Qt5Core_LIBRARIES} + ${Qt5Gui_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${SBK_PYTHON_LIBRARIES}) + +add_dependencies(testbinding pyside2 QtCore libpyside pysidetest) + +PYSIDE_TEST(decoratedslot_test.py) +PYSIDE_TEST(delegatecreateseditor_test.py) +PYSIDE_TEST(enum_test.py) +PYSIDE_TEST(homonymoussignalandmethod_test.py) +PYSIDE_TEST(list_signal_test.py) +PYSIDE_TEST(modelview_test.py) +PYSIDE_TEST(new_inherited_functions_test.py) +PYSIDE_TEST(notify_id.py) +PYSIDE_TEST(qvariant_test.py) +PYSIDE_TEST(signalandnamespace_test.py) +PYSIDE_TEST(signalwithdefaultvalue_test.py) +PYSIDE_TEST(signalemissionfrompython_test.py) +PYSIDE_TEST(version_test.py) +PYSIDE_TEST(typedef_signal_test.py) +PYSIDE_TEST(bug_1016.py) +PYSIDE_TEST(utils_test.py) +PYSIDE_TEST(mixin_signal_slots_test.py) +PYSIDE_TEST(signal_slot_warning.py) diff --git a/sources/pyside2/tests/pysidetest/bug_1016.py b/sources/pyside2/tests/pysidetest/bug_1016.py new file mode 100644 index 000000000..745012248 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/bug_1016.py @@ -0,0 +1,40 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from testbinding import * +import unittest + +class TestBug1016 (unittest.TestCase): + + def testIt(self): + obj = getHiddenObject() + self.assertEqual(obj.callMe(), None) + self.assertTrue(obj.wasCalled()) + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/pysidetest/curr_errors.txt b/sources/pyside2/tests/pysidetest/curr_errors.txt new file mode 100644 index 000000000..83b6e6212 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/curr_errors.txt @@ -0,0 +1,12 @@ +Generating class model... [OK] +Generating enum model... [OK] +Generating namespace model... [OK] +Resolving typedefs... [OK] +Fixing class inheritance... [OK] +Detecting inconsistencies in class model... [OK] +[OK] + type 'QPyTextObject' is specified in typesystem, but not defined. This could potentially lead to compilation errors. + + + +Done, 1 warnings (1051 known issues) diff --git a/sources/pyside2/tests/pysidetest/decoratedslot_test.py b/sources/pyside2/tests/pysidetest/decoratedslot_test.py new file mode 100644 index 000000000..6268f331c --- /dev/null +++ b/sources/pyside2/tests/pysidetest/decoratedslot_test.py @@ -0,0 +1,67 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject +from testbinding import TestObject + +class Receiver(QObject): + def __init__(self): + QObject.__init__(self) + self.called = False + + def ReceiverDecorator(func): + def decoratedFunction(self, *args, **kw): + func(self, *args, **kw) + return decoratedFunction + + # This method with the same name of the internal decorated function + # is here to test the binding capabilities. + def decoratedFunction(self): + pass + + @ReceiverDecorator + def slot(self): + self.called = True + + +class DecoratedSlotTest(unittest.TestCase): + + def testCallingOfDecoratedSlot(self): + obj = TestObject(0) + receiver = Receiver() + obj.staticMethodDouble.connect(receiver.slot) + obj.emitStaticMethodDoubleSignal() + self.assertTrue(receiver.called) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py b/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py new file mode 100644 index 000000000..ec557340a --- /dev/null +++ b/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py @@ -0,0 +1,83 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from helper import UsesQApplication + +from testbinding import TestView +from PySide2.QtCore import Qt +from PySide2.QtWidgets import QAbstractItemDelegate, QComboBox + +id_text = 'This is me' + +class DelegateDoesntKeepReferenceToEditor(QAbstractItemDelegate): + def createEditor(self, parent, option, index): + comboBox = QComboBox(parent) + comboBox.addItem(id_text) + return comboBox + + +class DelegateKeepsReferenceToEditor(QAbstractItemDelegate): + def __init__(self, parent=None): + QAbstractItemDelegate.__init__(self, parent) + self.comboBox = QComboBox() + self.comboBox.addItem(id_text) + + def createEditor(self, parent, option, index): + self.comboBox.setParent(parent) + return self.comboBox + + +class EditorCreatedByDelegateTest(UsesQApplication): + + def testDelegateDoesntKeepReferenceToEditor(self): + view = TestView(None) + delegate = DelegateDoesntKeepReferenceToEditor() + view.setItemDelegate(delegate) + editor = view.getEditorWidgetFromItemDelegate() + self.assertEqual(type(editor), QComboBox) + self.assertEqual(editor.count(), 1) + self.assertEqual(editor.itemData(0, Qt.DisplayRole), id_text) + editor.metaObject() + + def testDelegateKeepsReferenceToEditor(self): + view = TestView(None) + delegate = DelegateKeepsReferenceToEditor() + view.setItemDelegate(delegate) + editor = view.getEditorWidgetFromItemDelegate() + self.assertEqual(type(editor), QComboBox) + self.assertEqual(editor.count(), 1) + self.assertEqual(editor.itemData(0, Qt.DisplayRole), id_text) + editor.metaObject() + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/enum_test.py b/sources/pyside2/tests/pysidetest/enum_test.py new file mode 100644 index 000000000..b3cb4e4d7 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/enum_test.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from testbinding import Enum1, TestObjectWithoutNamespace + +class ListConnectionTest(unittest.TestCase): + + def testEnumVisibility(self): + self.assertEqual(Enum1.Option1, 1) + self.assertEqual(Enum1.Option2, 2) + self.assertEqual(TestObjectWithoutNamespace.Enum2.Option3, 3) + self.assertEqual(TestObjectWithoutNamespace.Enum2.Option4, 4) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/hiddenobject.cpp b/sources/pyside2/tests/pysidetest/hiddenobject.cpp new file mode 100644 index 000000000..da6d0434b --- /dev/null +++ b/sources/pyside2/tests/pysidetest/hiddenobject.cpp @@ -0,0 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "hiddenobject.h" + +void HiddenObject::callMe() +{ + m_called = true; +} + +bool HiddenObject::wasCalled() +{ + return m_called; +} + +QObject* getHiddenObject() +{ + return new HiddenObject(); +} diff --git a/sources/pyside2/tests/pysidetest/hiddenobject.h b/sources/pyside2/tests/pysidetest/hiddenobject.h new file mode 100644 index 000000000..ba96cec9c --- /dev/null +++ b/sources/pyside2/tests/pysidetest/hiddenobject.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HIDDENOBJECT_H +#define HIDDENOBJECT_H + +#ifdef pysidetest_EXPORTS +#define PYSIDE_EXPORTS 1 +#endif +#include "pysidemacros.h" +#include + +// This class shouldn't be exported! +class HiddenObject : public QObject +{ + Q_OBJECT +public: + HiddenObject() : m_called(false) {} + Q_INVOKABLE void callMe(); +public slots: + bool wasCalled(); +private: + bool m_called; +}; + +// Return a instance of HiddenObject +PYSIDE_API QObject* getHiddenObject(); + + +#endif diff --git a/sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py b/sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py new file mode 100644 index 000000000..6be6245f9 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py @@ -0,0 +1,81 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from testbinding import TestObject + +'''Tests the behaviour of homonymous signals and slots.''' + +class HomonymousSignalAndMethodTest(unittest.TestCase): + + def setUp(self): + self.value = 123 + self.called = False + self.obj = TestObject(self.value) + + def tearDown(self): + del self.value + del self.called + del self.obj + + def testIdValueSignalEmission(self): + def callback(idValue): + self.assertEqual(idValue, self.value) + self.obj.idValue.connect(callback) + self.obj.emitIdValueSignal() + + def testStaticMethodDoubleSignalEmission(self): + def callback(): + self.called = True + self.obj.staticMethodDouble.connect(callback) + self.obj.emitStaticMethodDoubleSignal() + self.assertTrue(self.called) + + def testSignalNotCallable(self): + self.assertRaises(TypeError, self.obj.justASignal) + + def testCallingInstanceMethodWithArguments(self): + self.assertRaises(TypeError, TestObject.idValue, 1) + + def testCallingInstanceMethodWithoutArguments(self): + self.assertRaises(TypeError, TestObject.idValue) + + def testHomonymousSignalAndMethod(self): + self.assertEqual(self.obj.idValue(), self.value) + + def testHomonymousSignalAndStaticMethod(self): + self.assertEqual(TestObject.staticMethodDouble(3), 6) + + def testHomonymousSignalAndStaticMethodFromInstance(self): + self.assertEqual(self.obj.staticMethodDouble(4), 8) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/list_signal_test.py b/sources/pyside2/tests/pysidetest/list_signal_test.py new file mode 100644 index 000000000..1a130070e --- /dev/null +++ b/sources/pyside2/tests/pysidetest/list_signal_test.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from testbinding import TestObject +from PySide2.QtCore import QObject + +class ListConnectionTest(unittest.TestCase): + + def childrenChanged(self, children): + self._child = children[0] + + def testConnection(self): + o = TestObject(0) + c = QObject() + c.setObjectName("child") + self._child = None + o.childrenChanged.connect(self.childrenChanged) + o.addChild(c) + self.assertEqual(self._child.objectName(), "child") + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py b/sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py new file mode 100644 index 000000000..cdd9ea19a --- /dev/null +++ b/sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py @@ -0,0 +1,216 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' PYSIDE-315: https://bugreports.qt.io/browse/PYSIDE-315 + Test that all signals and slots of a class (including any mixin classes) + are registered at type parsing time. Also test that the signal and slot + indices do not change after signal connection or emission. ''' + +import unittest +from PySide2 import QtCore + +class Mixin(object): + mixinSignal = QtCore.Signal() + def __init__(self, *args, **kwargs): + super(Mixin,self).__init__(*args, **kwargs) + +class MixinTwo(Mixin): + mixinTwoSignal = QtCore.Signal() + + def __init__(self, *args, **kwargs): + super(MixinTwo,self).__init__(*args, **kwargs) + self.mixinTwoSlotCalled = False + + @QtCore.Slot() + def mixinTwoSlot(self): + self.mixinTwoSlotCalled = True + +class MixinThree(object): + mixinThreeSignal = QtCore.Signal() + + def __init__(self, *args, **kwargs): + super(MixinThree,self).__init__(*args, **kwargs) + self.mixinThreeSlotCalled = False + + @QtCore.Slot() + def mixinThreeSlot(self): + self.mixinThreeSlotCalled = True + +class Derived(Mixin, QtCore.QObject): + derivedSignal = QtCore.Signal(str) + + def __init__(self): + super(Derived,self).__init__() + self.derivedSlotCalled = False + self.derivedSlotString = '' + + @QtCore.Slot(str) + def derivedSlot(self, theString): + self.derivedSlotCalled = True + self.derivedSlotString = theString + +class MultipleDerived(MixinTwo, MixinThree, Mixin, QtCore.QObject): + derivedSignal = QtCore.Signal(str) + + def __init__(self): + super(MultipleDerived,self).__init__() + self.derivedSlotCalled = False + self.derivedSlotString = '' + + @QtCore.Slot(str) + def derivedSlot(self, theString): + self.derivedSlotCalled = True + self.derivedSlotString = theString + + +class MixinTest(unittest.TestCase): + def testMixinSignalSlotRegistration(self): + obj = Derived() + m = obj.metaObject() + + # Should contain 2 signals and 1 slot immediately after type parsing + self.assertEqual(m.methodCount() - m.methodOffset(), 3) + + # Save method indices to check that they do not change + methodIndices = {} + for i in range(m.methodOffset(), m.methodCount()): + signature = m.method(i).methodSignature() + methodIndices[signature] = i + + # Check derivedSignal emission + obj.derivedSignal.connect(obj.derivedSlot) + obj.derivedSignal.emit('emit1') + self.assertTrue(obj.derivedSlotCalled) + obj.derivedSlotCalled = False + + # Check derivedSignal emission after mixingSignal connection + self.outsideSlotCalled = False + @QtCore.Slot() + def outsideSlot(): + self.outsideSlotCalled = True + + obj.mixinSignal.connect(outsideSlot) + obj.derivedSignal.emit('emit2') + self.assertTrue(obj.derivedSlotCalled) + self.assertFalse(self.outsideSlotCalled) + obj.derivedSlotCalled = False + + # Check mixinSignal emission + obj.mixinSignal.emit() + self.assertTrue(self.outsideSlotCalled) + self.assertFalse(obj.derivedSlotCalled) + self.outsideSlotCalled = False + + # Check that method indices haven't changed. + # Make sure to requery for the meta object, to check that a new one was not + # created as a child of the old one. + m = obj.metaObject() + self.assertEqual(m.methodCount() - m.methodOffset(), 3) + for i in range(m.methodOffset(), m.methodCount()): + signature = m.method(i).methodSignature() + self.assertEqual(methodIndices[signature], i) + + + def testMixinSignalSlotRegistrationWithMultipleInheritance(self): + obj = MultipleDerived() + m = obj.metaObject() + + # Should contain 4 signals and 3 slots immediately after type parsing + self.assertEqual(m.methodCount() - m.methodOffset(), 7) + + # Save method indices to check that they do not change + methodIndices = {} + for i in range(m.methodOffset(), m.methodCount()): + signature = m.method(i).methodSignature() + methodIndices[signature] = i + + # Check derivedSignal emission + obj.derivedSignal.connect(obj.derivedSlot) + obj.derivedSignal.emit('emit1') + self.assertTrue(obj.derivedSlotCalled) + self.assertFalse(obj.mixinTwoSlotCalled) + self.assertFalse(obj.mixinThreeSlotCalled) + obj.derivedSlotCalled = False + + # Check derivedSignal emission after mixinThreeSignal connection + self.outsideSlotCalled = False + @QtCore.Slot() + def outsideSlot(): + self.outsideSlotCalled = True + + obj.mixinThreeSignal.connect(obj.mixinThreeSlot) + obj.mixinThreeSignal.connect(outsideSlot) + obj.derivedSignal.emit('emit2') + self.assertTrue(obj.derivedSlotCalled) + self.assertFalse(obj.mixinTwoSlotCalled) + self.assertFalse(obj.mixinThreeSlotCalled) + self.assertFalse(self.outsideSlotCalled) + obj.derivedSlotCalled = False + + # Check mixinThreeSignal emission + obj.mixinThreeSignal.emit() + self.assertTrue(self.outsideSlotCalled) + self.assertTrue(obj.mixinThreeSlotCalled) + self.assertFalse(obj.derivedSlotCalled) + self.assertFalse(obj.mixinTwoSlotCalled) + self.outsideSlotCalled = False + obj.mixinThreeSlotCalled = False + + # Check mixinTwoSignal emission + obj.mixinTwoSignal.connect(obj.mixinTwoSlot) + obj.mixinTwoSignal.emit() + self.assertTrue(obj.mixinTwoSlotCalled) + self.assertFalse(obj.mixinThreeSlotCalled) + self.assertFalse(obj.derivedSlotCalled) + self.assertFalse(self.outsideSlotCalled) + obj.mixinTwoSlotCalled = False + + # Check mixinSignal emission + obj.mixinSignal.connect(outsideSlot) + obj.mixinSignal.emit() + self.assertTrue(self.outsideSlotCalled) + self.assertFalse(obj.mixinTwoSlotCalled) + self.assertFalse(obj.mixinThreeSlotCalled) + self.assertFalse(obj.derivedSlotCalled) + self.outsideSlotCalled = False + + # Check that method indices haven't changed. + # Make sure to requery for the meta object, to check that a new one was not + # created as a child of the old one. + m = obj.metaObject() + self.assertEqual(m.methodCount() - m.methodOffset(), 7) + for i in range(m.methodOffset(), m.methodCount()): + signature = m.method(i).methodSignature() + self.assertEqual(methodIndices[signature], i) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/modelview_test.py b/sources/pyside2/tests/pysidetest/modelview_test.py new file mode 100644 index 000000000..3a02946dc --- /dev/null +++ b/sources/pyside2/tests/pysidetest/modelview_test.py @@ -0,0 +1,99 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import py3kcompat as py3k +from testbinding import TestView +from PySide2.QtCore import QAbstractListModel, QObject, QModelIndex + +'''Tests model/view relationship.''' + +object_name = 'test object' + +class MyObject(QObject): + pass + +class ListModelKeepsReference(QAbstractListModel): + def __init__(self, parent=None): + QAbstractListModel.__init__(self, parent) + self.obj = MyObject() + self.obj.setObjectName(object_name) + + def rowCount(self, parent=QModelIndex()): + return 1 + + def data(self, index, role): + return self.obj + +class ListModelDoesntKeepsReference(QAbstractListModel): + def rowCount(self, parent=QModelIndex()): + return 1 + + def data(self, index, role): + obj = MyObject() + obj.setObjectName(object_name) + return obj + +class ListModelThatReturnsString(QAbstractListModel): + def rowCount(self, parent=QModelIndex()): + return 1 + + def data(self, index, role): + self.obj = 'string' + return self.obj + + +class ModelViewTest(unittest.TestCase): + + def testListModelDoesntKeepsReference(self): + model = ListModelDoesntKeepsReference() + view = TestView(model) + obj = view.getData() + self.assertEqual(type(obj), MyObject) + self.assertEqual(obj.objectName(), object_name) + obj.metaObject() + + def testListModelKeepsReference(self): + model = ListModelKeepsReference() + view = TestView(model) + obj = view.getData() + self.assertEqual(type(obj), MyObject) + self.assertEqual(obj.objectName(), object_name) + + def testListModelThatReturnsString(self): + model = ListModelThatReturnsString() + view = TestView(model) + obj = view.getData() + self.assertEqual(type(obj), py3k.unicode) + self.assertEqual(obj, 'string') + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py new file mode 100644 index 000000000..bd5db7661 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py @@ -0,0 +1,215 @@ +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions(). For further +## information use the contact form at https://www.qt.io/contact-us(). +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3().0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +import sys +import os +import unittest + +import PySide2.QtCore + +# This test tests the existence and callability of the newly existing functions, +# after the inheritance was made complete in the course of PYSIDE-331. + +def warn_essential(modname): + print(80 * "*") + print("*** Warning: '{}' is an essential module! Are you sure to skip it?" + .format(modname)) + print(80 * "*") + +new_functions = """ + PySide2.QtCore.QAbstractItemModel().parent() + PySide2.QtCore.QAbstractListModel().parent() + PySide2.QtCore.QAbstractTableModel().parent() + PySide2.QtCore.QFile().resize(qint64) + m = PySide2.QtCore.QMutex(); m.tryLock(); m.unlock() # prevent a message "QMutex: destroying locked mutex" + PySide2.QtCore.QSortFilterProxyModel().parent() + PySide2.QtCore.QTemporaryFile(tfarg).open(openMode) +""" +try: + modname = "PySide2.QtGui" + exec("import " + modname) + new_functions += """ + PySide2.QtGui.QBitmap().transformed(qMatrix,transformationMode) + PySide2.QtGui.QStandardItemModel().insertColumn(int,qModelIndex) + PySide2.QtGui.QStandardItemModel().parent() + # PySide2.QtGui.QTextList(qTextDocument).setFormat(qTextFormat) # Segmentation fault: 11 + # PySide2.QtGui.QTextTable(qTextDocument).setFormat(qTextFormat) # Segmentation fault: 11 + """ +except ImportError: + warn_essential(modname) +try: + modname = "PySide2.QtWidgets" + exec("import " + modname) + new_functions += """ + PySide2.QtWidgets.QAbstractItemView().update() + PySide2.QtWidgets.QApplication.palette() + PySide2.QtWidgets.QApplication.setFont(qFont) + PySide2.QtWidgets.QApplication.setPalette(qPalette) + PySide2.QtWidgets.QBoxLayout(direction).addWidget(qWidget) + PySide2.QtWidgets.QColorDialog().open() + PySide2.QtWidgets.QDirModel().index(int,int,qModelIndex) + PySide2.QtWidgets.QDirModel().parent() + PySide2.QtWidgets.QFileDialog().open() + PySide2.QtWidgets.QFileSystemModel().index(int,int,qModelIndex) + PySide2.QtWidgets.QFileSystemModel().parent() + PySide2.QtWidgets.QFontDialog().open() + PySide2.QtWidgets.QGestureEvent([]).accept() + PySide2.QtWidgets.QGestureEvent([]).ignore() + PySide2.QtWidgets.QGestureEvent([]).isAccepted() + PySide2.QtWidgets.QGestureEvent([]).setAccepted(bool) + # PySide2.QtWidgets.QGraphicsView().render(qPaintDevice,qPoint,qRegion,renderFlags) # QPaintDevice: NotImplementedError + PySide2.QtWidgets.QGridLayout().addWidget(qWidget) + PySide2.QtWidgets.QHeaderView(orientation).initStyleOption(qStyleOptionFrame) + PySide2.QtWidgets.QInputDialog().open() + PySide2.QtWidgets.QLineEdit().addAction(qAction) + PySide2.QtWidgets.QListWidget().closePersistentEditor(qModelIndex) + PySide2.QtWidgets.QListWidget().openPersistentEditor(qModelIndex) + PySide2.QtWidgets.QMessageBox().open() + PySide2.QtWidgets.QPlainTextEdit.find(quintptr) + PySide2.QtWidgets.QProgressDialog().open() + PySide2.QtWidgets.QStackedLayout().widget() + # PySide2.QtWidgets.QStylePainter().begin(qPaintDevice) # QPaintDevice: NotImplementedError + PySide2.QtWidgets.QTableWidget().closePersistentEditor(qModelIndex) + PySide2.QtWidgets.QTableWidget().openPersistentEditor(qModelIndex) + PySide2.QtWidgets.QTextEdit.find(quintptr) + PySide2.QtWidgets.QTreeWidget().closePersistentEditor(qModelIndex) + PySide2.QtWidgets.QTreeWidget().openPersistentEditor(qModelIndex) + """ +except ImportError: + warn_essential(modname) +try: + modname = "PySide2.QtPrintSupport" + exec("import " + modname) + new_functions += """ + # PySide2.QtPrintSupport.QPageSetupDialog().open() # Segmentation fault: 11 + # PySide2.QtPrintSupport.QPrintDialog().open() # opens the dialog, but works + PySide2.QtPrintSupport.QPrintDialog().printer() + PySide2.QtPrintSupport.QPrintPreviewDialog().open() # note: this prints something, but really shouldn't ;-) + """ +except ImportError: + warn_essential(modname) +try: + import PySide2.QtHelp + new_functions += """ + PySide2.QtHelp.QHelpContentModel().parent() + # PySide2.QtHelp.QHelpIndexModel().createIndex(int,int,quintptr) # returned NULL without setting an error + # PySide2.QtHelp.QHelpIndexModel().createIndex(int,int,object()) # returned NULL without setting an error + """ +except ImportError: + pass +try: + import PySide2.QtQuick + new_functions += """ + PySide2.QtQuick.QQuickPaintedItem().update() + """ +except ImportError: + pass + + +class MainTest(unittest.TestCase): + + def testNewInheriedFunctionsExist(self): + """ + Run all new method signarures + """ + for app in "QtWidgets.QApplication", "QtGui.QGuiApplication", "QtCore.QCoreApplication": + try: + exec("qApp = PySide2.{0}([]) or PySide2.{0}.instance()".format(app)) + break + except AttributeError: + continue + bool = True + int = 42 + qint64 = 42 + tfarg = os.path.join(PySide2.QtCore.QDir.tempPath(), "XXXXXX.tmp") + orientation = PySide2.QtCore.Qt.Orientation() + openMode = PySide2.QtCore.QIODevice.OpenMode(PySide2.QtCore.QIODevice.ReadOnly) + qModelIndex = PySide2.QtCore.QModelIndex() + transformationMode = PySide2.QtCore.Qt.TransformationMode() + qObject = PySide2.QtCore.QObject() + qPoint = PySide2.QtCore.QPoint() + try: + PySide2.QtGui + #qPaintDevice = PySide2.QtGui.QPaintDevice() # NotImplementedError + qMatrix = PySide2.QtGui.QMatrix() + qTextDocument = PySide2.QtGui.QTextDocument() + qTextFormat = PySide2.QtGui.QTextFormat() + quintptr = long(42) if sys.version_info[0] < 3 else 42 + qFont = PySide2.QtGui.QFont() + qPalette = PySide2.QtGui.QPalette() + except AttributeError: + pass + try: + PySide2.QtWidgets + direction = PySide2.QtWidgets.QBoxLayout.Direction() + qWidget = PySide2.QtWidgets.QWidget() + qStyleOptionFrame = PySide2.QtWidgets.QStyleOptionFrame() + qAction = PySide2.QtWidgets.QAction(qObject) + renderFlags = PySide2.QtWidgets.QWidget.RenderFlags + except AttributeError: + pass + + for func in new_functions.splitlines(): + func = func.strip() + if func.startswith("#"): + # this is a crashing or otherwise untestable function + print(func) + continue + try: + exec(func) + except NotImplementedError: + print(func, "# raises NotImplementedError") + else: + print(func) + + def testQAppSignatures(self): + """ + Verify that qApp.palette owns three signatures, especially + palette() without argument. + """ + try: + qApp = (PySide2.QtWidgets.QApplication.instance() or + PySide2.QtWidgets.QApplication([])) + except AttributeError: + unittest.TestCase().skipTest("this test makes only sense if QtWidgets is available.") + try: + PySide2.QtWidgets.QApplication.palette(42) # raises + except TypeError as e: + lines = e.args[0].splitlines() + heading_pos = lines.index("Supported signatures:") + lines = lines[heading_pos+1:] + self.assertEqual(len(lines), 3) + txt = '\n'.join(lines) + print("Signatures found:") + print(txt) + self.assertTrue("palette()" in txt) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/pysidetest/notify_id.py b/sources/pyside2/tests/pysidetest/notify_id.py new file mode 100644 index 000000000..09226e6e2 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/notify_id.py @@ -0,0 +1,76 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject, Signal, Property, Slot + +'''Tests that the signal notify id of a property is correct, aka corresponds to the initially set +notify method.''' + +class Foo(QObject): + def __init__(self): + QObject.__init__(self) + self._prop = "Empty" + + def getProp(self): + return self._prop + + def setProp(self, value): + if value != self._prop: + self._prop = value + self.propChanged.emit() + + # Inside the dynamic QMetaObject, the methods have to be sorted, so that this slot comes + # after any signals. That means the property notify id has to be updated, to have the correct + # relative method id. + @Slot() + def randomSlot(): + pass + + propChanged = Signal() + prop = Property(str, getProp, setProp, notify=propChanged) + +class NotifyIdSignal(unittest.TestCase): + def setUp(self): + self.obj = Foo() + + def tearDown(self): + del self.obj + + def testSignalEmission(self): + metaObject = self.obj.metaObject() + propertyIndex = metaObject.indexOfProperty("prop") + property = metaObject.property(propertyIndex) + + signalIndex = property.notifySignalIndex() + signal = metaObject.method(signalIndex) + signalName = signal.name() + self.assertEqual(signalName, "propChanged") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/pysidetest/pysidetest_global.h b/sources/pyside2/tests/pysidetest/pysidetest_global.h new file mode 100644 index 000000000..9fc1828e1 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/pysidetest_global.h @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// PySide global.h file +#include "pyside2_global.h" +#include "testobject.h" +#include "testview.h" +#define PYSIDE_API +#include "hiddenobject.h" diff --git a/sources/pyside2/tests/pysidetest/qvariant_test.py b/sources/pyside2/tests/pysidetest/qvariant_test.py new file mode 100644 index 000000000..46c9ddbda --- /dev/null +++ b/sources/pyside2/tests/pysidetest/qvariant_test.py @@ -0,0 +1,45 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from testbinding import TestObject +from PySide2.QtCore import Qt +from PySide2.QtGui import QKeySequence + +from helper import UsesQApplication + +class QVariantTest(UsesQApplication): + + def testQKeySequenceQVariantOperator(self): + # bug #775 + ks = QKeySequence(Qt.SHIFT, Qt.CTRL, Qt.Key_P, Qt.Key_R) + self.assertEqual(TestObject.checkType(ks), 75) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/pysidetest/signal_slot_warning.py b/sources/pyside2/tests/pysidetest/signal_slot_warning.py new file mode 100644 index 000000000..fd3d41b52 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/signal_slot_warning.py @@ -0,0 +1,70 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' PYSIDE-315: https://bugreports.qt.io/browse/PYSIDE-315 + Test that creating a signal in the wrong order triggers a warning. ''' + +from __future__ import print_function + +import unittest +import PySide2.QtCore as QtCore +import sys +import warnings + + +class Whatever(QtCore.QObject): + echoSignal = QtCore.Signal(str) + + def __init__(self): + super(Whatever, self).__init__() + self.echoSignal.connect(self.mySlot) + + def mySlot(self, v): + pass + +class WarningTest(unittest.TestCase): + def testSignalSlotWarning(self): + # we create an object. This gives no warning. + obj = Whatever() + # then we insert a signal after slots have been created. + setattr(Whatever, "foo", QtCore.Signal()) + with warnings.catch_warnings(record=True) as w: + # Cause all warnings to always be triggered. + warnings.simplefilter("always") + # Trigger a warning. + obj.foo.connect(obj.mySlot) + # Verify some things + assert issubclass(w[-1].category, RuntimeWarning) + assert "*** Sort Warning ***" in str(w[-1].message) + # note that this warning cannot be turned into an error (too hard) + + +if __name__ == "__main__": + unittest.main() diff --git a/sources/pyside2/tests/pysidetest/signalandnamespace_test.py b/sources/pyside2/tests/pysidetest/signalandnamespace_test.py new file mode 100644 index 000000000..846e5b2b9 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/signalandnamespace_test.py @@ -0,0 +1,120 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from testbinding import PySideCPP, TestObjectWithoutNamespace + +class ModelViewTest(unittest.TestCase): + + def callback(self, o): + self._called = o + + def testWithoutNamespace(self): + self._called = None + o = PySideCPP.TestObjectWithNamespace(None) + o.emitSignal.connect(self.callback) + o.emitSignal.emit(o) + self.assertTrue(o == self._called) + + self._called = None + o = PySideCPP.TestObjectWithNamespace(None) + o.emitSignal.connect(self.callback) + o.callSignal(o) + self.assertTrue(o == self._called) + + def testWithNamespace(self): + self._called = None + o = PySideCPP.TestObjectWithNamespace(None) + o.emitSignalWithNamespace.connect(self.callback) + o.emitSignalWithNamespace.emit(o) + self.assertTrue(o == self._called) + + self._called = None + o = PySideCPP.TestObjectWithNamespace(None) + o.emitSignalWithNamespace.connect(self.callback) + o.callSignalWithNamespace(o) + self.assertTrue(o == self._called) + + + def testWithoutNamespace1(self): + self._called = None + o = TestObjectWithoutNamespace(None) + o.emitSignal.connect(self.callback) + o.emitSignal.emit(o) + self.assertTrue(o == self._called) + + self._called = None + o = TestObjectWithoutNamespace(None) + o.emitSignal.connect(self.callback) + o.callSignal(o) + self.assertTrue(o == self._called) + + def testWithNamespace1(self): + self._called = None + o = TestObjectWithoutNamespace(None) + o.emitSignalWithNamespace.connect(self.callback) + o.emitSignalWithNamespace.emit(o) + self.assertTrue(o == self._called) + + self._called = None + o = TestObjectWithoutNamespace(None) + o.emitSignalWithNamespace.connect(self.callback) + o.callSignalWithNamespace(o) + self.assertTrue(o == self._called) + + def testTypedfWithouNamespace(self): + self._called = None + o = PySideCPP.TestObjectWithNamespace(None) + o.emitSignalWithTypedef.connect(self.callback) + o.emitSignalWithTypedef.emit(10) + self.assertEqual(10, self._called) + + self._called = None + o = PySideCPP.TestObjectWithNamespace(None) + o.emitSignalWithTypedef.connect(self.callback) + o.callSignalWithTypedef(10) + self.assertEqual(10, self._called) + + def testTypedefWithNamespace(self): + self._called = None + o = TestObjectWithoutNamespace(None) + o.emitSignalWithTypedef.connect(self.callback) + o.emitSignalWithTypedef.emit(10) + self.assertEqual(10, self._called) + + self._called = None + o = TestObjectWithoutNamespace(None) + o.emitSignalWithTypedef.connect(self.callback) + o.callSignalWithTypedef(10) + self.assertEqual(10, self._called) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py b/sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py new file mode 100644 index 000000000..1bd08c071 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py @@ -0,0 +1,107 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from testbinding import TestObject +from PySide2.QtCore import QObject, SIGNAL + +'''Tests the behaviour of signals with default values when emitted from Python.''' + +class SignalEmissionFromPython(unittest.TestCase): + + def setUp(self): + self.obj1 = TestObject(0) + self.obj2 = TestObject(0) + self.one_called = 0 + self.two_called = 0 + + def tearDown(self): + del self.obj1 + del self.obj2 + del self.one_called + del self.two_called + + def testConnectNewStyleEmitVoidSignal(self): + def callbackOne(): + self.one_called += 1 + self.obj2.signalWithDefaultValue.emit() + def callbackTwo(): + self.two_called += 1 + self.obj1.signalWithDefaultValue.connect(callbackOne) + self.obj2.signalWithDefaultValue.connect(callbackTwo) + self.obj1.emitSignalWithDefaultValue_void() + self.obj2.emitSignalWithDefaultValue_void() + self.assertEqual(self.one_called, 1) + self.assertEqual(self.two_called, 2) + + def testConnectOldStyleEmitVoidSignal(self): + def callbackOne(): + self.one_called += 1 + self.obj2.signalWithDefaultValue.emit() + def callbackTwo(): + self.two_called += 1 + QObject.connect(self.obj1, SIGNAL('signalWithDefaultValue()'), callbackOne) + QObject.connect(self.obj2, SIGNAL('signalWithDefaultValue()'), callbackTwo) + self.obj1.emitSignalWithDefaultValue_void() + self.obj2.emitSignalWithDefaultValue_void() + self.assertEqual(self.one_called, 1) + self.assertEqual(self.two_called, 2) + + def testConnectNewStyleEmitBoolSignal(self): + def callbackOne(): + self.one_called += 1 + self.obj2.signalWithDefaultValue[bool].emit(True) + def callbackTwo(): + self.two_called += 1 + self.obj1.signalWithDefaultValue.connect(callbackOne) + self.obj2.signalWithDefaultValue.connect(callbackTwo) + self.obj1.emitSignalWithDefaultValue_void() + self.obj2.emitSignalWithDefaultValue_void() + self.assertEqual(self.one_called, 1) + self.assertEqual(self.two_called, 2) + + def testConnectOldStyleEmitBoolSignal(self): + def callbackOne(): + self.one_called += 1 + self.obj2.signalWithDefaultValue[bool].emit(True) + def callbackTwo(): + self.two_called += 1 + QObject.connect(self.obj1, SIGNAL('signalWithDefaultValue()'), callbackOne) + QObject.connect(self.obj2, SIGNAL('signalWithDefaultValue()'), callbackTwo) + self.obj1.emitSignalWithDefaultValue_void() + self.obj2.emitSignalWithDefaultValue_void() + self.assertEqual(self.one_called, 1) + self.assertEqual(self.two_called, 2) + + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py b/sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py new file mode 100644 index 000000000..8014d4879 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py @@ -0,0 +1,95 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from testbinding import TestObject +from PySide2.QtCore import QObject, SIGNAL + +'''Tests the behaviour of signals with default values.''' + +class SignalWithDefaultValueTest(unittest.TestCase): + + def setUp(self): + self.obj = TestObject(0) + self.void_called = False + self.bool_called = False + + def tearDown(self): + del self.obj + del self.void_called + del self.bool_called + + def testConnectNewStyleEmitVoidSignal(self): + def callbackVoid(): + self.void_called = True + def callbackBool(value): + self.bool_called = True + self.obj.signalWithDefaultValue.connect(callbackVoid) + self.obj.signalWithDefaultValue[bool].connect(callbackBool) + self.obj.emitSignalWithDefaultValue_void() + self.assertTrue(self.void_called) + self.assertTrue(self.bool_called) + + def testConnectNewStyleEmitBoolSignal(self): + def callbackVoid(): + self.void_called = True + def callbackBool(value): + self.bool_called = True + self.obj.signalWithDefaultValue.connect(callbackVoid) + self.obj.signalWithDefaultValue[bool].connect(callbackBool) + self.obj.emitSignalWithDefaultValue_bool() + self.assertTrue(self.void_called) + self.assertTrue(self.bool_called) + + def testConnectOldStyleEmitVoidSignal(self): + def callbackVoid(): + self.void_called = True + def callbackBool(value): + self.bool_called = True + QObject.connect(self.obj, SIGNAL('signalWithDefaultValue()'), callbackVoid) + QObject.connect(self.obj, SIGNAL('signalWithDefaultValue(bool)'), callbackBool) + self.obj.emitSignalWithDefaultValue_void() + self.assertTrue(self.void_called) + self.assertTrue(self.bool_called) + + def testConnectOldStyleEmitBoolSignal(self): + def callbackVoid(): + self.void_called = True + def callbackBool(value): + self.bool_called = True + QObject.connect(self.obj, SIGNAL('signalWithDefaultValue()'), callbackVoid) + QObject.connect(self.obj, SIGNAL('signalWithDefaultValue(bool)'), callbackBool) + self.obj.emitSignalWithDefaultValue_bool() + self.assertTrue(self.void_called) + self.assertTrue(self.bool_called) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/pysidetest/symbols.filter b/sources/pyside2/tests/pysidetest/symbols.filter new file mode 100644 index 000000000..af6c744dd --- /dev/null +++ b/sources/pyside2/tests/pysidetest/symbols.filter @@ -0,0 +1,7 @@ +{ +local: +_ZSt*; +_ZNSt*; +_ZNSs*; +_ZNKSt*; +}; diff --git a/sources/pyside2/tests/pysidetest/testobject.cpp b/sources/pyside2/tests/pysidetest/testobject.cpp new file mode 100644 index 000000000..4fe98461c --- /dev/null +++ b/sources/pyside2/tests/pysidetest/testobject.cpp @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "testobject.h" + +void TestObject::emitIdValueSignal() +{ + emit idValue(m_idValue); +} + +void TestObject::emitStaticMethodDoubleSignal() +{ + emit staticMethodDouble(); +} + +void TestObject::emitSignalWithDefaultValue_void() +{ + emit signalWithDefaultValue(); +} + +void TestObject::emitSignalWithDefaultValue_bool() +{ + emit signalWithDefaultValue(true); +} + +void TestObject::emitSignalWithTypedefValue(int value) +{ + emit signalWithTypedefValue(TypedefValue(value)); +} diff --git a/sources/pyside2/tests/pysidetest/testobject.h b/sources/pyside2/tests/pysidetest/testobject.h new file mode 100644 index 000000000..7e1f46250 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/testobject.h @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TESTOBJECT_H +#define TESTOBJECT_H + +#include +#include +#include +#include +#ifdef pysidetest_EXPORTS +#define PYSIDE_EXPORTS 1 +#endif +#include "pysidemacros.h" + +class IntValue +{ +public: + + IntValue(int val): value(val){}; + IntValue() : value(0) {}; + int value; +}; + +typedef IntValue TypedefValue; + +class PYSIDE_API TestObject : public QObject +{ + Q_OBJECT +public: + static void createApp() { int argc=0; new QApplication(argc, 0); }; + static int checkType(const QVariant& var) { return (int)var.type(); } + + TestObject(int idValue, QObject* parent = 0) : QObject(parent), m_idValue(idValue) {} + int idValue() const { return m_idValue; } + static int staticMethodDouble(int value) { return value * 2; } + void addChild(QObject* c) { m_children.append(c); emit childrenChanged(m_children); } + + void emitIdValueSignal(); + void emitStaticMethodDoubleSignal(); + + void emitSignalWithDefaultValue_void(); + void emitSignalWithDefaultValue_bool(); + + void emitSignalWithTypedefValue(int value); + +signals: + void idValue(int newValue); + void justASignal(); + void staticMethodDouble(); + void childrenChanged(const QList&); + void signalWithDefaultValue(bool value = false); + void signalWithTypedefValue(TypedefValue value); + +private: + int m_idValue; + QList m_children; +}; + + +typedef int PySideInt; + + +namespace PySideCPP { + +class PYSIDE_API TestObjectWithNamespace : public QObject +{ + Q_OBJECT +public: + TestObjectWithNamespace(QObject* parent) : QObject(parent) {} + QString name() { return "TestObjectWithNamespace"; } + + void callSignal(TestObjectWithNamespace* obj) { emitSignal(obj); } + void callSignalWithNamespace(TestObjectWithNamespace* obj) { emitSignalWithNamespace(obj); } + void callSignalWithTypedef(int val) { emitSignalWithTypedef(val); } + +signals: + void emitSignal(TestObjectWithNamespace* obj); + void emitSignalWithNamespace(PySideCPP::TestObjectWithNamespace* obj); + void emitSignalWithTypedef(PySideInt val); +}; + + +} // Namespace PySideCPP + +namespace PySideCPP2 { + +enum Enum1 { Option1 = 1, Option2 = 2 }; + + +typedef long PySideLong; + +class PYSIDE_API TestObjectWithoutNamespace : public QObject +{ + Q_OBJECT +public: + enum Enum2 { Option3 = 3, Option4 = 4}; + TestObjectWithoutNamespace(QObject* parent) : QObject(parent) {} + QString name() { return "TestObjectWithoutNamespace"; } + + void callSignal(TestObjectWithoutNamespace* obj) { emitSignal(obj); } + void callSignalWithNamespace(TestObjectWithoutNamespace* obj) { emitSignalWithNamespace(obj); } + void callSignalWithTypedef(long val) { emitSignalWithTypedef(val); } + +signals: + void emitSignal(TestObjectWithoutNamespace* obj); + void emitSignalWithNamespace(PySideCPP2::TestObjectWithoutNamespace* obj); + void emitSignalWithTypedef(PySideLong val); +}; + + +} // Namespace PySideCPP2 + +#endif // TESTOBJECT_H + diff --git a/sources/pyside2/tests/pysidetest/testview.cpp b/sources/pyside2/tests/pysidetest/testview.cpp new file mode 100644 index 000000000..b974f1fc7 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/testview.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "testview.h" + +#include +#include +#include +#include + +QVariant +TestView::getData() +{ + QModelIndex index; + return m_model->data(index); +} + +QWidget* +TestView::getEditorWidgetFromItemDelegate() const +{ + if (!m_delegate) + return 0; + + QModelIndex index; + QStyleOptionViewItem options; + return m_delegate->createEditor(0, options, index); +} diff --git a/sources/pyside2/tests/pysidetest/testview.h b/sources/pyside2/tests/pysidetest/testview.h new file mode 100644 index 000000000..22caab59f --- /dev/null +++ b/sources/pyside2/tests/pysidetest/testview.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of PySide2. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TESTVIEW_H +#define TESTVIEW_H + +#include +#ifdef pysidetest_EXPORTS +#define PYSIDE_EXPORTS 1 +#endif +#include "pysidemacros.h" + +QT_BEGIN_NAMESPACE +class QWidget; +class QAbstractListModel; +class QAbstractItemDelegate; +QT_END_NAMESPACE + +class PYSIDE_API TestView : public QObject +{ + Q_OBJECT +public: + TestView(QAbstractListModel* model, QObject* parent = 0) : QObject(parent), m_model(model) {} + QAbstractListModel* model() { return m_model; } + QVariant getData(); + + void setItemDelegate(QAbstractItemDelegate* delegate) { m_delegate = delegate; } + QWidget* getEditorWidgetFromItemDelegate() const; + +private: + QAbstractListModel* m_model; + QAbstractItemDelegate* m_delegate; +}; + +#endif // TESTVIEW_H + diff --git a/sources/pyside2/tests/pysidetest/typedef_signal_test.py b/sources/pyside2/tests/pysidetest/typedef_signal_test.py new file mode 100644 index 000000000..7f2f47344 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/typedef_signal_test.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject +from testbinding import TestObject + +class Receiver(QObject): + + def __init__(self): + QObject.__init__(self) + self.received = None + + def slot(self, value): + self.received = value + +class TypedefSignal(unittest.TestCase): + + def testTypedef(self): + obj = TestObject(0) + receiver = Receiver() + + obj.signalWithTypedefValue.connect(receiver.slot) + obj.emitSignalWithTypedefValue(2) + self.assertEqual(receiver.received.value, 2) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/pysidetest/typesystem_pysidetest.xml b/sources/pyside2/tests/pysidetest/typesystem_pysidetest.xml new file mode 100644 index 000000000..4053b7b77 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/typesystem_pysidetest.xml @@ -0,0 +1,64 @@ + + + + + + + + + return %CONVERTTOPYTHON[IntValue](%in); + + + + IntValue value = %CONVERTTOCPP[IntValue](%in); + %out = %OUTTYPE(value); + + + + + + + + + + + + + + Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter<long>(), "PySideLong"); + Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter<long>(), "PySideCPP2::PySideLong"); + qRegisterMetaType<PySideInt>("PySideInt"); + qRegisterMetaType<PySideCPP2::PySideLong>("PySideLong"); + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/pyside2/tests/pysidetest/utils_test.py b/sources/pyside2/tests/pysidetest/utils_test.py new file mode 100644 index 000000000..30f283312 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/utils_test.py @@ -0,0 +1,51 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys +import os + + +if sys.platform == 'win32': + from PySide2._utils import _get_win32_case_sensitive_name + + class Win32UtilsTest(unittest.TestCase): + def testWin32CaseSensitiveName(self): + from tempfile import mkdtemp + caseSensitiveName = 'CaseSensitiveName' + tmpdir = mkdtemp(caseSensitiveName) + try: + path = _get_win32_case_sensitive_name(tmpdir.lower()) + self.assertTrue(path.endswith(caseSensitiveName)) + finally: + if os.path.exists(tmpdir): + os.rmdir(tmpdir) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/pysidetest/version_test.py b/sources/pyside2/tests/pysidetest/version_test.py new file mode 100644 index 000000000..5901a56c1 --- /dev/null +++ b/sources/pyside2/tests/pysidetest/version_test.py @@ -0,0 +1,45 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import __version_info__, __version__, QtCore + +class CheckForVariablesTest(unittest.TestCase): + def testVesions(self): + self.assertTrue(__version_info__ >= (1, 0, 0)) + self.assertTrue(__version_info__ < (99, 99, 99)) + self.assertTrue(__version__) + + self.assertTrue(QtCore.__version_info__ >= (4, 5, 0)) + self.assertTrue(QtCore.__version__) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/run_test.sh b/sources/pyside2/tests/run_test.sh new file mode 100755 index 000000000..a961653a5 --- /dev/null +++ b/sources/pyside2/tests/run_test.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# This is a nasty workaround of a CTest limitation +# of setting the environment variables for the test. + +# $1: LD_LIBRARY_PATH +# $2: $PYTHONPATH +# $3: python executable +# $4: test file + +export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH +export PYTHONPATH=$2:$PYTHONPATH +$3 $4 diff --git a/sources/pyside2/tests/signals/CMakeLists.txt b/sources/pyside2/tests/signals/CMakeLists.txt new file mode 100644 index 000000000..fe06a3430 --- /dev/null +++ b/sources/pyside2/tests/signals/CMakeLists.txt @@ -0,0 +1,40 @@ +PYSIDE_TEST(args_dont_match_test.py) +PYSIDE_TEST(bug_79.py) +PYSIDE_TEST(bug_189.py) +PYSIDE_TEST(bug_311.py) +PYSIDE_TEST(bug_312.py) +PYSIDE_TEST(bug_319.py) +PYSIDE_TEST(decorators_test.py) +PYSIDE_TEST(disconnect_test.py) +PYSIDE_TEST(invalid_callback_test.py) +PYSIDE_TEST(lambda_gui_test.py) +PYSIDE_TEST(lambda_test.py) +PYSIDE_TEST(leaking_signal_test.py) +PYSIDE_TEST(multiple_connections_gui_test.py) +PYSIDE_TEST(multiple_connections_test.py) +PYSIDE_TEST(pysignal_test.py) +PYSIDE_TEST(qobject_destroyed_test.py) +PYSIDE_TEST(qobject_receivers_test.py) +PYSIDE_TEST(qobject_sender_test.py) +PYSIDE_TEST(ref01_test.py) +PYSIDE_TEST(ref02_test.py) +PYSIDE_TEST(ref03_test.py) +PYSIDE_TEST(ref04_test.py) +PYSIDE_TEST(ref05_test.py) +PYSIDE_TEST(ref06_test.py) +PYSIDE_TEST(segfault_proxyparent_test.py) +PYSIDE_TEST(self_connect_test.py) +PYSIDE_TEST(short_circuit_test.py) +PYSIDE_TEST(signal2signal_connect_test.py) +PYSIDE_TEST(signal_autoconnect_test.py) +PYSIDE_TEST(signal_connectiontype_support_test.py) +PYSIDE_TEST(signal_emission_gui_test.py) +PYSIDE_TEST(signal_emission_test.py) +PYSIDE_TEST(signal_func_test.py) +PYSIDE_TEST(signal_manager_refcount_test.py) +PYSIDE_TEST(signal_number_limit_test.py) +PYSIDE_TEST(signal_object_test.py) +PYSIDE_TEST(signal_signature_test.py) +PYSIDE_TEST(signal_with_primitive_type_test.py) +PYSIDE_TEST(slot_reference_count_test.py) +PYSIDE_TEST(static_metaobject_test.py) diff --git a/sources/pyside2/tests/signals/args_dont_match_test.py b/sources/pyside2/tests/signals/args_dont_match_test.py new file mode 100644 index 000000000..03d2ec324 --- /dev/null +++ b/sources/pyside2/tests/signals/args_dont_match_test.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + +class ArgsDontMatch(unittest.TestCase): + + def callback(self, arg1): + self.ok = True + + def testConnectSignalToSlotWithLessArgs(self): + self.ok = False + obj1 = QObject() + QObject.connect(obj1, SIGNAL('the_signal(int, int, int)'), self.callback) + obj1.emit(SIGNAL('the_signal(int, int, int)'), 1, 2, 3) + + self.assertTrue(self.ok) + + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/bug_189.py b/sources/pyside2/tests/signals/bug_189.py new file mode 100644 index 000000000..dc2c314aa --- /dev/null +++ b/sources/pyside2/tests/signals/bug_189.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2 import QtCore, QtWidgets +from helper import UsesQApplication + +class TestBugPYSIDE189(UsesQApplication): + + def testDisconnect(self): + # Disconnecting from a signal owned by a destroyed object + # should raise an exception, not segfault. + def onValueChanged(self, value): + pass + + sld = QtWidgets.QSlider() + sld.valueChanged.connect(onValueChanged) + + sld.deleteLater() + + QtCore.QTimer.singleShot(0, self.app.quit) + self.app.exec_() + + self.assertRaises(RuntimeError, sld.valueChanged.disconnect, onValueChanged) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/bug_311.py b/sources/pyside2/tests/signals/bug_311.py new file mode 100644 index 000000000..0ea066b49 --- /dev/null +++ b/sources/pyside2/tests/signals/bug_311.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import QtCore +from helper import UsesQCoreApplication + +class DerivedDate(QtCore.QDate): + def __init__(self,y,m,d): + super(DerivedDate,self).__init__(y,m,d) + +class Emitter(QtCore.QObject): + dateSignal1 = QtCore.Signal(QtCore.QDate) + dateSignal2 = QtCore.Signal(DerivedDate) + tupleSignal = QtCore.Signal(tuple) + +class SignaltoSignalTest(UsesQCoreApplication): + def myCb(self, dt): + self._dt = dt + + def testBug(self): + e = Emitter() + d = DerivedDate(2010,8,24) + self._dt = None + e.dateSignal1.connect(self.myCb) + e.dateSignal1.emit(d) + self.assertEqual(self._dt, d) + + self._dt = None + e.dateSignal2.connect(self.myCb) + e.dateSignal2.emit(d) + self.assertEqual(self._dt, d) + + myTuple = (5, 6, 7) + self._dt = None + e.tupleSignal.connect(self.myCb) + e.tupleSignal.emit(myTuple) + self.assertEqual(myTuple, self._dt) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/bug_312.py b/sources/pyside2/tests/signals/bug_312.py new file mode 100644 index 000000000..631e224b3 --- /dev/null +++ b/sources/pyside2/tests/signals/bug_312.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import sys +from PySide2.QtCore import QObject, SIGNAL + +MAX_LOOPS = 5 +MAX_OBJECTS = 200 + +class Dummy(object): + def __init__(self, parent): + self._parent = parent + + def callback(self): + self._called = True + +class MultipleSlots(unittest.TestCase): + def myCB(self): + self._count += 1 + + """ + def testUnboundSignal(self): + o = QObject() + self._count = 0 + for i in range(MAX_OBJECTS): + QObject.connect(o, SIGNAL("fire()"), lambda: self.myCB()) + + o.emit(SIGNAL("fire()")) + self.assertEqual(self._count, MAX_OBJECTS) + + """ + def testDisconnectCleanup(self): + for c in range(MAX_LOOPS): + self._count = 0 + self._senders = [] + for i in range(MAX_OBJECTS): + o = QObject() + QObject.connect(o, SIGNAL("fire()"), lambda: self.myCB()) + self._senders.append(o) + o.emit(SIGNAL("fire()")) + + self.assertEqual(self._count, MAX_OBJECTS) + + #delete all senders will disconnect the signals + self._senders = [] + +if __name__ == '__main__': + unittest.main() + + diff --git a/sources/pyside2/tests/signals/bug_319.py b/sources/pyside2/tests/signals/bug_319.py new file mode 100644 index 000000000..637f36bb4 --- /dev/null +++ b/sources/pyside2/tests/signals/bug_319.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import QtCore +from helper import UsesQCoreApplication + +class Listener(QtCore.QObject): + def __init__(self): + QtCore.QObject.__init__(self, None) + self._phrase = [] + + @QtCore.Slot(tuple) + def listen(self, words): + for w in words: + self._phrase.append(w) + +class Communicate(QtCore.QObject): + # create a new signal on the fly and name it 'speak' + speak = QtCore.Signal(tuple) + +class SignaltoSignalTest(UsesQCoreApplication): + def testBug(self): + someone = Communicate() + someone2 = Listener() + # connect signal and slot + someone.speak.connect(someone2.listen) + # emit 'speak' signal + talk = ("one","two","three") + someone.speak.emit(talk) + self.assertEqual(someone2._phrase, list(talk)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/bug_79.py b/sources/pyside2/tests/signals/bug_79.py new file mode 100644 index 000000000..d0a6515f3 --- /dev/null +++ b/sources/pyside2/tests/signals/bug_79.py @@ -0,0 +1,69 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function +import unittest +import sys +import gc + +from PySide2 import QtGui, QtWidgets + +try: + from sys import gettotalrefcount + skiptest = False +except ImportError: + skiptest = True + +class ConnectTest(unittest.TestCase): + + def callback(self, o): + print("callback") + self._called = o + + def testNoLeaks_ConnectAndDisconnect(self): + self._called = None + app = QtWidgets.QApplication([]) + o = QtWidgets.QTreeView() + o.setModel(QtGui.QStandardItemModel()) + o.selectionModel().destroyed.connect(self.callback) + o.selectionModel().destroyed.disconnect(self.callback) + gc.collect() + # if this is no debug build, then we check at least that + # we do not crash any longer. + if not skiptest: + total = sys.gettotalrefcount() + for idx in range(1000): + o.selectionModel().destroyed.connect(self.callback) + o.selectionModel().destroyed.disconnect(self.callback) + gc.collect() + if not skiptest: + self.assertTrue(abs(gettotalrefcount() - total) < 10) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/decorators_test.py b/sources/pyside2/tests/signals/decorators_test.py new file mode 100644 index 000000000..ec43ac825 --- /dev/null +++ b/sources/pyside2/tests/signals/decorators_test.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, Slot, SIGNAL, SLOT + +class MyObject(QObject): + def __init__(self, parent=None): + QObject.__init__(self, parent) + self._slotCalledCount = 0 + + @Slot() + def mySlot(self): + self._slotCalledCount = self._slotCalledCount + 1 + + @Slot(int) + @Slot('QString') + def mySlot2(self, arg0): + self._slotCalledCount = self._slotCalledCount + 1 + + @Slot(name='mySlot3') + def foo(self): + self._slotCalledCount = self._slotCalledCount + 1 + + @Slot(str, int) + def mySlot4(self, a, b): + self._slotCalledCount = self._slotCalledCount + 1 + + @Slot(result=int) + def mySlot5(self): + self._slotCalledCount = self._slotCalledCount + 1 + + @Slot(result=QObject) + def mySlot6(self): + self._slotCalledCount = self._slotCalledCount + 1 + +class StaticMetaObjectTest(unittest.TestCase): + + def testSignalPropagation(self): + o = MyObject() + m = o.metaObject() + self.assertTrue(m.indexOfSlot('mySlot()') > 0) + self.assertTrue(m.indexOfSlot('mySlot2(int)') > 0) + self.assertTrue(m.indexOfSlot('mySlot2(QString)') > 0) + self.assertTrue(m.indexOfSlot('mySlot3()') > 0) + self.assertTrue(m.indexOfSlot('mySlot4(QString,int)') > 0) + + def testEmission(self): + o = MyObject() + o.connect(SIGNAL("mySignal()"), o, SLOT("mySlot()")) + o.emit(SIGNAL("mySignal()")) + self.assertTrue(o._slotCalledCount == 1) + + def testResult(self): + o = MyObject() + mo = o.metaObject() + i = mo.indexOfSlot('mySlot5()') + m = mo.method(i) + self.assertEqual(m.typeName(), "int") + + def testResultObject(self): + o = MyObject() + mo = o.metaObject() + i = mo.indexOfSlot('mySlot6()') + m = mo.method(i) + self.assertEqual(m.typeName(), "QObject*") + +class SlotWithoutArgs(unittest.TestCase): + + def testError(self): + # It should be an error to call the slot without the + # arguments, as just @Slot would end up in a slot + # accepting argument functions + self.assertRaises(TypeError, Slot, lambda: 3) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/disconnect_test.py b/sources/pyside2/tests/signals/disconnect_test.py new file mode 100644 index 000000000..b17caa8e6 --- /dev/null +++ b/sources/pyside2/tests/signals/disconnect_test.py @@ -0,0 +1,88 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import os, sys +sys.path.insert(0, os.path.join("..", "pysidetest")) + +import unittest +from PySide2.QtCore import * +from testbinding import TestObject + + +class Foo(QObject): + bar = Signal() + +class TestDisconnect(unittest.TestCase): + def theSlot1(self): + self.called1 = True + + def theSlot2(self): + self.called2 = True + + def testIt(self): + self.called1 = False + self.called2 = False + f = Foo() + f.bar.connect(self.theSlot1) + f.bar.connect(self.theSlot2) + f.bar.emit() + self.assertTrue(self.called1) + self.assertTrue(self.called2) + + self.called1 = False + self.called2 = False + f.bar.disconnect() + f.bar.emit() + self.assertFalse(self.called1) + self.assertFalse(self.called2) + + def testDuringCallback(self): + """ Test to see if the C++ object for a connection is accessed after the + method returns. This causes a segfault if the memory that was used by the + C++ object has been reused. """ + + self.called = False + obj = TestObject(0) + def callback(): + obj.signalWithDefaultValue.disconnect(callback) + + # Connect more callbacks to try to overwrite memory + for i in range(1000): + obj.signalWithDefaultValue.connect(lambda: None) + + self.called = True + + # A non-None return value is needed + return True + obj.signalWithDefaultValue.connect(callback) + obj.signalWithDefaultValue.emit() + self.assertTrue(self.called) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/invalid_callback_test.py b/sources/pyside2/tests/signals/invalid_callback_test.py new file mode 100644 index 000000000..a6ed2456f --- /dev/null +++ b/sources/pyside2/tests/signals/invalid_callback_test.py @@ -0,0 +1,56 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for passing invalid callbacks to QObject.connect''' + +import unittest + +from PySide2.QtCore import QObject, SIGNAL + +class InvalidCallback(unittest.TestCase): + '''Test case for passing an invalid callback to QObject.connect''' + + def setUp(self): + #Acquire resources + self.obj = QObject() + + def tearDown(self): + #Release resources + try: + del self.obj + except AttributeError: + pass + + def testIntegerCb(self): + #Test passing an int as callback to QObject.connect + self.assertRaises(TypeError, QObject.connect, self.obj, + SIGNAL('destroyed()'), 42) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/lambda_gui_test.py b/sources/pyside2/tests/signals/lambda_gui_test.py new file mode 100644 index 000000000..dc6ef0296 --- /dev/null +++ b/sources/pyside2/tests/signals/lambda_gui_test.py @@ -0,0 +1,73 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Connecting lambda to gui signals''' + +import unittest + +from PySide2.QtCore import QObject, SIGNAL + +try: + from PySide2.QtWidgets import QSpinBox, QPushButton + hasQtGui = True +except ImportError: + hasQtGui = False + +from helper import UsesQApplication + +if hasQtGui: + class Control: + def __init__(self): + self.arg = False + + class QtGuiSigLambda(UsesQApplication): + + def testButton(self): + #Connecting a lambda to a QPushButton.clicked() + obj = QPushButton('label') + ctr = Control() + func = lambda: setattr(ctr, 'arg', True) + QObject.connect(obj, SIGNAL('clicked()'), func) + obj.click() + self.assertTrue(ctr.arg) + QObject.disconnect(obj, SIGNAL('clicked()'), func) + + + def testSpinButton(self): + #Connecting a lambda to a QPushButton.clicked() + obj = QSpinBox() + ctr = Control() + arg = 444 + func = lambda x: setattr(ctr, 'arg', 444) + QObject.connect(obj, SIGNAL('valueChanged(int)'), func) + obj.setValue(444) + self.assertEqual(ctr.arg, arg) + QObject.disconnect(obj, SIGNAL('valueChanged(int)'), func) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/lambda_test.py b/sources/pyside2/tests/signals/lambda_test.py new file mode 100644 index 000000000..9e602e72f --- /dev/null +++ b/sources/pyside2/tests/signals/lambda_test.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Connecting lambda to signals''' + +import sys +import unittest + +from PySide2.QtCore import QObject, SIGNAL, QProcess + +from helper import UsesQCoreApplication + + +class Dummy(QObject): + + def __init__(self, *args): + super(Dummy, self).__init__(*args) + + +class BasicCase(unittest.TestCase): + + def testSimplePythonSignalNoArgs(self): + #Connecting a lambda to a simple python signal without arguments + obj = Dummy() + QObject.connect(obj, SIGNAL('foo()'), + lambda: setattr(obj, 'called', True)) + obj.emit(SIGNAL('foo()')) + self.assertTrue(obj.called) + + def testSimplePythonSignal(self): + #Connecting a lambda to a simple python signal witharguments + obj = Dummy() + arg = 42 + QObject.connect(obj, SIGNAL('foo(int)'), + lambda x: setattr(obj, 'arg', 42)) + obj.emit(SIGNAL('foo(int)'), arg) + self.assertEqual(obj.arg, arg) + + +class QtSigLambda(UsesQCoreApplication): + + qapplication = True + + def testNoArgs(self): + '''Connecting a lambda to a signal without arguments''' + proc = QProcess() + dummy = Dummy() + QObject.connect(proc, SIGNAL('started()'), + lambda: setattr(dummy, 'called', True)) + proc.start(sys.executable, ['-c', '""']) + proc.waitForFinished() + self.assertTrue(dummy.called) + + def testWithArgs(self): + '''Connecting a lambda to a signal with arguments''' + proc = QProcess() + dummy = Dummy() + QObject.connect(proc, SIGNAL('finished(int)'), + lambda x: setattr(dummy, 'called', x)) + proc.start(sys.executable, ['-c', '""']) + proc.waitForFinished() + self.assertEqual(dummy.called, proc.exitCode()) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/leaking_signal_test.py b/sources/pyside2/tests/signals/leaking_signal_test.py new file mode 100644 index 000000000..770e59556 --- /dev/null +++ b/sources/pyside2/tests/signals/leaking_signal_test.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import QtCore +import weakref + +class LeakingSignal(unittest.TestCase): + + def testLeakingSignal(self): + # Was segfaulting when the signal was garbage collected. + class Emitter(QtCore.QObject): + my_signal = QtCore.Signal(object) + + emitter = Emitter() + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/multiple_connections_gui_test.py b/sources/pyside2/tests/signals/multiple_connections_gui_test.py new file mode 100644 index 000000000..28e7867cc --- /dev/null +++ b/sources/pyside2/tests/signals/multiple_connections_gui_test.py @@ -0,0 +1,88 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +import random +from functools import partial + +from PySide2.QtCore import QObject, SIGNAL + +try: + from PySide2.QtWidgets import QPushButton, QSpinBox + hasQtGui = True +except ImportError: + hasQtGui = False + +from helper import BasicPySlotCase, UsesQApplication + +class MultipleSignalConnections(unittest.TestCase): + '''Base class for multiple signal connection testing''' + + def run_many(self, sender, signal, emitter, receivers, args=None): + """Utility method to connect a list of receivers to a signal. + sender - QObject that will emit the signal + signal - string with the signal signature + emitter - the callable that will trigger the signal + receivers - list of BasicPySlotCase instances + args - tuple with the arguments to be sent. + """ + + if args is None: + args = tuple() + + for rec in receivers: + rec.setUp() + QObject.connect(sender, SIGNAL(signal), rec.cb) + rec.args = tuple(args) + + emitter(*args) + + for rec in receivers: + self.assertTrue(rec.called) + + +if hasQtGui: + class QtGuiMultipleSlots(UsesQApplication, MultipleSignalConnections): + '''Multiple connections to QtGui signals''' + + def testButtonClick(self): + """Multiple connections to QPushButton.clicked()""" + sender = QPushButton('button') + receivers = [BasicPySlotCase() for x in range(30)] + self.run_many(sender, 'clicked()', sender.click, receivers) + + def testSpinBoxValueChanged(self): + """Multiple connections to QSpinBox.valueChanged(int)""" + sender = QSpinBox() + #FIXME if number of receivers if higher than 50, segfaults + receivers = [BasicPySlotCase() for x in range(10)] + self.run_many(sender, 'valueChanged(int)', sender.setValue, + receivers, (1,)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/multiple_connections_test.py b/sources/pyside2/tests/signals/multiple_connections_test.py new file mode 100644 index 000000000..39950da5d --- /dev/null +++ b/sources/pyside2/tests/signals/multiple_connections_test.py @@ -0,0 +1,103 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +import unittest +from functools import partial + +from PySide2.QtCore import QObject, SIGNAL, QProcess + +from helper import BasicPySlotCase, UsesQCoreApplication + + +class MultipleSignalConnections(unittest.TestCase): + '''Base class for multiple signal connection testing''' + + def run_many(self, sender, signal, emitter, receivers, args=None): + """Utility method to connect a list of receivers to a signal. + sender - QObject that will emit the signal + signal - string with the signal signature + emitter - the callable that will trigger the signal + receivers - list of BasicPySlotCase instances + args - tuple with the arguments to be sent. + """ + + if args is None: + args = tuple() + for rec in receivers: + rec.setUp() + self.assertTrue(QObject.connect(sender, SIGNAL(signal), rec.cb)) + rec.args = tuple(args) + + emitter(*args) + + for rec in receivers: + self.assertTrue(rec.called) + + +class PythonMultipleSlots(UsesQCoreApplication, MultipleSignalConnections): + '''Multiple connections to python signals''' + + def testPythonSignal(self): + """Multiple connections to a python signal (short-circuit)""" + + class Dummy(QObject): + pass + + sender = Dummy() + receivers = [BasicPySlotCase() for x in range(10)] + self.run_many(sender, 'foobar(int)', partial(sender.emit,SIGNAL('foobar(int)')), receivers, (0, )) + + +class QProcessMultipleSlots(UsesQCoreApplication, MultipleSignalConnections): + '''Multiple connections to QProcess signals''' + + def testQProcessStarted(self): + '''Multiple connections to QProcess.started()''' + sender = QProcess() + receivers = [BasicPySlotCase() for x in range(10)] + + def start_proc(*args): + sender.start(sys.executable, ['-c', '""']) + sender.waitForFinished() + + self.run_many(sender, 'started()', start_proc, receivers) + + def testQProcessFinished(self): + '''Multiple connections to QProcess.finished(int)''' + sender = QProcess() + receivers = [BasicPySlotCase() for x in range(10)] + + def start_proc(*args): + sender.start(sys.executable, ['-c', '""']) + sender.waitForFinished() + + self.run_many(sender, 'finished(int)', start_proc, receivers, (0,)) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/pysignal_test.py b/sources/pyside2/tests/signals/pysignal_test.py new file mode 100644 index 000000000..a42793b02 --- /dev/null +++ b/sources/pyside2/tests/signals/pysignal_test.py @@ -0,0 +1,214 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject, SIGNAL, SLOT, Qt + +try: + from PySide2.QtWidgets import QSpinBox, QApplication, QWidget + hasQtGui = True +except ImportError: + hasQtGui = False + +from helper import UsesQApplication + +class Dummy(QObject): + """Dummy class used in this test.""" + def __init__(self, parent=None): + QObject.__init__(self, parent) + + def callDummy(self): + self.emit(SIGNAL("dummy(PyObject)"), "PyObject") + + def callDummy2(self): + lst = [] + lst.append("item1") + lst.append("item2") + lst.append("item3") + self.emit(SIGNAL("dummy2(PyObject, PyObject)"), "PyObject0", lst) + + +class PyObjectType(UsesQApplication): + def mySlot(self, arg): + self.assertEqual(arg, "PyObject") + self.called = True + self.callCount += 1 + + def mySlot2(self, arg0, arg1): + self.assertEqual(arg0, "PyObject0") + self.assertEqual(arg1[0], "item1") + self.assertEqual(arg1[1], "item2") + self.assertEqual(arg1[2], "item3") + self.callCount += 1 + if self.running: + self.app.quit() + + def setUp(self): + super(PyObjectType, self).setUp() + self.callCount = 0 + self.running = False + + def testWithOneArg(self): + o = Dummy() + o.connect(SIGNAL("dummy(PyObject)"), self.mySlot) + o.callDummy() + self.assertEqual(self.callCount, 1) + + def testWithTwoArg(self): + o = Dummy() + o.connect(SIGNAL("dummy2(PyObject,PyObject)"), self.mySlot2) + o.callDummy2() + self.assertEqual(self.callCount, 1) + + def testAsyncSignal(self): + self.called = False + self.running = True + o = Dummy() + o.connect(SIGNAL("dummy2(PyObject,PyObject)"), self.mySlot2, Qt.QueuedConnection) + o.callDummy2() + self.app.exec_() + self.assertEqual(self.callCount, 1) + + def testTwice(self): + self.called = False + self.running = True + o = Dummy() + o.connect(SIGNAL("dummy2(PyObject,PyObject)"), self.mySlot2, Qt.QueuedConnection) + o.callDummy2() + o.callDummy2() + self.app.exec_() + self.assertEqual(self.callCount, 2) + +class PythonSigSlot(unittest.TestCase): + def setUp(self): + self.called = False + + def tearDown(self): + try: + del self.args + except: + pass + + def callback(self, *args): + if tuple(self.args) == args: + self.called = True + + def testNoArgs(self): + """Python signal and slots without arguments""" + obj1 = Dummy() + + QObject.connect(obj1, SIGNAL('foo()'), self.callback) + self.args = tuple() + obj1.emit(SIGNAL('foo()'), *self.args) + + self.assertTrue(self.called) + + def testWithArgs(self): + """Python signal and slots with integer arguments""" + obj1 = Dummy() + + QObject.connect(obj1, SIGNAL('foo(int)'), self.callback) + self.args = (42,) + obj1.emit(SIGNAL('foo(int)'), *self.args) + + self.assertTrue(self.called) + + + def testDisconnect(self): + obj1 = Dummy() + + QObject.connect(obj1, SIGNAL('foo(int)'), self.callback) + QObject.disconnect(obj1, SIGNAL('foo(int)'), self.callback) + + self.args = (42, ) + obj1.emit(SIGNAL('foo(int)'), *self.args) + + self.assertTrue(not self.called) + + +if hasQtGui: + class SpinBoxPySignal(UsesQApplication): + """Tests the connection of python signals to QSpinBox qt slots.""" + + def setUp(self): + super(SpinBoxPySignal, self).setUp() + self.obj = Dummy() + self.spin = QSpinBox() + self.spin.setValue(0) + + def tearDown(self): + super(SpinBoxPySignal, self).tearDown() + del self.obj + del self.spin + + def testValueChanged(self): + """Emission of a python signal to QSpinBox setValue(int)""" + QObject.connect(self.obj, SIGNAL('dummy(int)'), self.spin, SLOT('setValue(int)')) + self.assertEqual(self.spin.value(), 0) + + self.obj.emit(SIGNAL('dummy(int)'), 4) + self.assertEqual(self.spin.value(), 4) + + def testValueChangedMultiple(self): + """Multiple emissions of a python signal to QSpinBox setValue(int)""" + QObject.connect(self.obj, SIGNAL('dummy(int)'), self.spin, SLOT('setValue(int)')) + self.assertEqual(self.spin.value(), 0) + + self.obj.emit(SIGNAL('dummy(int)'), 4) + self.assertEqual(self.spin.value(), 4) + + self.obj.emit(SIGNAL('dummy(int)'), 77) + self.assertEqual(self.spin.value(), 77) + + +if hasQtGui: + class WidgetPySignal(UsesQApplication): + """Tests the connection of python signals to QWidget qt slots.""" + + def setUp(self): + super(WidgetPySignal, self).setUp() + self.obj = Dummy() + self.widget = QWidget() + + def tearDown(self): + super(WidgetPySignal, self).tearDown() + del self.obj + del self.widget + + def testShow(self): + """Emission of a python signal to QWidget slot show()""" + self.widget.hide() + + QObject.connect(self.obj, SIGNAL('dummy()'), self.widget, SLOT('show()')) + self.assertTrue(not self.widget.isVisible()) + + self.obj.emit(SIGNAL('dummy()')) + self.assertTrue(self.widget.isVisible()) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/qobject_destroyed_test.py b/sources/pyside2/tests/signals/qobject_destroyed_test.py new file mode 100644 index 000000000..776702ee1 --- /dev/null +++ b/sources/pyside2/tests/signals/qobject_destroyed_test.py @@ -0,0 +1,50 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, SIGNAL + +class QObjectDestroyed(unittest.TestCase): + """Very simple test case for the destroyed() signal of QObject""" + + def setUp(self): + self.called = False + + def destroyed_cb(self): + self.called = True + + def testDestroyed(self): + """Emission of QObject.destroyed() to a python slot""" + obj = QObject() + QObject.connect(obj, SIGNAL('destroyed()'), self.destroyed_cb) + del obj + self.assertTrue(self.called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/qobject_receivers_test.py b/sources/pyside2/tests/signals/qobject_receivers_test.py new file mode 100644 index 000000000..8caaa7edb --- /dev/null +++ b/sources/pyside2/tests/signals/qobject_receivers_test.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test case for QObject.receivers()''' + +import unittest +from PySide2.QtCore import * + +def cute_slot(): + pass + +class TestQObjectReceivers(unittest.TestCase): + '''Test case for QObject::receivers''' + + def testBasic(self): + sender = QObject() + receiver1 = QObject() + receiver2 = QObject() + self.assertEqual(sender.receivers(SIGNAL("")), 0) + sender.connect(sender, SIGNAL("destroyed()"), receiver1, SLOT("deleteLater()")) + self.assertEqual(sender.receivers(SIGNAL("destroyed()")), 1) + sender.connect(sender, SIGNAL("destroyed()"), receiver2, SLOT("deleteLater()")) + self.assertEqual(sender.receivers(SIGNAL("destroyed()")), 2) + sender.disconnect(sender, SIGNAL("destroyed()"), receiver2, SLOT("deleteLater()")) + self.assertEqual(sender.receivers(SIGNAL("destroyed()")), 1) + del receiver2 + del receiver1 + del sender + + def testPySlots(self): + sender = QObject() + receiver = QObject() + sender.connect(sender, SIGNAL("destroyed()"), cute_slot) + self.assertEqual(sender.receivers(SIGNAL("destroyed( )")), 1) + sender.connect(sender, SIGNAL("destroyed()"), receiver, SLOT("deleteLater()")) + self.assertEqual(sender.receivers(SIGNAL("destroyed()")), 2) + del sender + del receiver + + def testPySignals(self): + sender = QObject() + receiver = QObject() + sender.connect(sender, SIGNAL("some_dynamic_signal()"), cute_slot) + self.assertEqual(sender.receivers(SIGNAL("some_dynamic_signal( )")), 1) + sender.connect(sender, SIGNAL("some_dynamic_signal()"), receiver, SLOT("deleteLater()")) + self.assertEqual(sender.receivers(SIGNAL("some_dynamic_signal( )")), 2) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/qobject_sender_test.py b/sources/pyside2/tests/signals/qobject_sender_test.py new file mode 100644 index 000000000..dfc8fac83 --- /dev/null +++ b/sources/pyside2/tests/signals/qobject_sender_test.py @@ -0,0 +1,120 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test cases for QObject.sender()''' + +import unittest +from PySide2.QtCore import * +from helper import UsesQCoreApplication + +class ExtQTimer(QTimer): + def __init__(self): + QTimer.__init__(self) + +class Receiver(QObject): + def __init__(self): + QObject.__init__(self) + self.the_sender = None + + def callback(self): + self.the_sender = self.sender() + if QCoreApplication.instance(): + QCoreApplication.instance().exit() + +class ObjectSenderTest(unittest.TestCase): + '''Test case for QObject.sender() method.''' + + def testSenderPythonSignal(self): + sender = QObject() + recv = Receiver() + QObject.connect(sender, SIGNAL('foo()'), recv.callback) + sender.emit(SIGNAL('foo()')) + self.assertEqual(sender, recv.the_sender) + +class ObjectSenderCheckOnReceiverTest(unittest.TestCase): + '''Test case for QObject.sender() method, this one tests the equality on the Receiver object.''' + + def testSenderPythonSignal(self): + sender = QObject() + recv = Receiver() + QObject.connect(sender, SIGNAL('foo()'), recv.callback) + sender.emit(SIGNAL('foo()')) + self.assertEqual(sender, recv.the_sender) + +class ObjectSenderWithQAppTest(UsesQCoreApplication): + '''Test case for QObject.sender() method with QApplication.''' + + def testSenderCppSignal(self): + sender = QTimer() + sender.setObjectName('foo') + recv = Receiver() + QObject.connect(sender, SIGNAL('timeout()'), recv.callback) + sender.start(10) + self.app.exec_() + self.assertEqual(sender, recv.the_sender) + + def testSenderCppSignalSingleShotTimer(self): + recv = Receiver() + QTimer.singleShot(10, recv.callback) + self.app.exec_() + self.assertTrue(isinstance(recv.the_sender, QObject)) + + def testSenderCppSignalWithPythonExtendedClass(self): + sender = ExtQTimer() + recv = Receiver() + QObject.connect(sender, SIGNAL('timeout()'), recv.callback) + sender.start(10) + self.app.exec_() + self.assertEqual(sender, recv.the_sender) + +class ObjectSenderWithQAppCheckOnReceiverTest(UsesQCoreApplication): + '''Test case for QObject.sender() method with QApplication.''' + + def testSenderCppSignal(self): + sender = QTimer() + sender.setObjectName('foo') + recv = Receiver() + QObject.connect(sender, SIGNAL('timeout()'), recv.callback) + sender.start(10) + self.app.exec_() + self.assertEqual(sender, recv.the_sender) + + def testSenderCppSignalWithPythonExtendedClass(self): + sender = ExtQTimer() + recv = Receiver() + QObject.connect(sender, SIGNAL('timeout()'), recv.callback) + sender.start(10) + self.app.exec_() + self.assertEqual(sender, recv.the_sender) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/ref01_test.py b/sources/pyside2/tests/signals/ref01_test.py new file mode 100644 index 000000000..ad56ca45f --- /dev/null +++ b/sources/pyside2/tests/signals/ref01_test.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject, Signal + +class BoundAndUnboundSignalsTest(unittest.TestCase): + + def setUp(self): + self.methods = set(('connect', 'disconnect', 'emit')) + + def tearDown(self): + del self.methods + + def testUnboundSignal(self): + self.assertEqual(type(QObject.destroyed), Signal) + self.assertFalse(self.methods.issubset(dir(QObject.destroyed))) + + def testBoundSignal(self): + obj = QObject() + self.assertNotEqual(type(obj.destroyed), Signal) + self.assertTrue(self.methods.issubset(dir(obj.destroyed))) + +if __name__ == '__main__': + unittest.main() + + diff --git a/sources/pyside2/tests/signals/ref02_test.py b/sources/pyside2/tests/signals/ref02_test.py new file mode 100644 index 000000000..7c16b2c64 --- /dev/null +++ b/sources/pyside2/tests/signals/ref02_test.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QCoreApplication, QTimeLine +from helper import UsesQCoreApplication + +class NativeSignalsTest(UsesQCoreApplication): + + def setUp(self): + UsesQCoreApplication.setUp(self) + self.called = False + self.timeline = QTimeLine(100) + + def tearDown(self): + del self.called + del self.timeline + UsesQCoreApplication.tearDown(self) + + def testSignalWithIntArgument(self): + + def valueChangedSlot(value): + self.called = True + self.assertEqual(type(value), float) + self.app.quit() + + self.timeline.valueChanged.connect(valueChangedSlot) + self.timeline.start() + + self.app.exec_() + self.assertTrue(self.called) + + def testSignalWithoutArguments(self): + + def finishedSlot(): + self.called = True + self.app.quit() + + self.timeline.finished.connect(finishedSlot) + self.timeline.start() + + self.app.exec_() + self.assertTrue(self.called) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/ref03_test.py b/sources/pyside2/tests/signals/ref03_test.py new file mode 100644 index 000000000..1f2d7a055 --- /dev/null +++ b/sources/pyside2/tests/signals/ref03_test.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from sys import getrefcount +from PySide2.QtCore import QObject + +class DisconnectSignalsTest(unittest.TestCase): + + def setUp(self): + self.emitter = QObject() + + def tearDown(self): + del self.emitter + + def testConnectionRefCount(self): + + def destroyedSlot(): + pass + + self.assertEqual(getrefcount(destroyedSlot), 2) + self.emitter.destroyed.connect(destroyedSlot) + self.assertEqual(getrefcount(destroyedSlot), 3) + self.emitter.destroyed.disconnect(destroyedSlot) + self.assertEqual(getrefcount(destroyedSlot), 2) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/ref04_test.py b/sources/pyside2/tests/signals/ref04_test.py new file mode 100644 index 000000000..73ae92124 --- /dev/null +++ b/sources/pyside2/tests/signals/ref04_test.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject, Signal + +class ExtQObject(QObject): + + mySignal = Signal() + + def __init__(self): + QObject.__init__(self) + + +class UserSignalTest(unittest.TestCase): + + def setUp(self): + self.emitter = ExtQObject() + self.counter = 0 + + def tearDown(self): + del self.emitter + del self.counter + + def testConnectEmitDisconnect(self): + + def slot(): + self.counter += 1 + + self.emitter.mySignal.connect(slot) + + self.assertEqual(self.counter, 0) + self.emitter.mySignal.emit() + self.assertEqual(self.counter, 1) + self.emitter.mySignal.emit() + self.assertEqual(self.counter, 2) + + self.emitter.mySignal.disconnect(slot) + + self.emitter.mySignal.emit() + self.assertEqual(self.counter, 2) + +# def testConnectWithConfigureMethod(self): +# +# def slot(): +# self.counter += 1 +# +# self.emitter.pyqtConfigure(mySignal=slot) +# self.assertEqual(self.counter, 0) +# self.emitter.mySignal.emit() +# self.assertEqual(self.counter, 1) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/ref05_test.py b/sources/pyside2/tests/signals/ref05_test.py new file mode 100644 index 000000000..2bd7d79c6 --- /dev/null +++ b/sources/pyside2/tests/signals/ref05_test.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject, QCoreApplication, QTimeLine, Slot +from helper import UsesQCoreApplication + +class ExtQObject(QObject): + + def __init__(self): + QObject.__init__(self) + self.counter = 0 + + @Slot('qreal') + def foo(self, value): + self.counter += 1 + + +class UserSlotTest(UsesQCoreApplication): + + def setUp(self): + UsesQCoreApplication.setUp(self) + self.receiver = ExtQObject() + self.timeline = QTimeLine(100) + + def tearDown(self): + del self.timeline + del self.receiver + UsesQCoreApplication.tearDown(self) + + def testUserSlot(self): + self.timeline.setUpdateInterval(10) + + self.timeline.finished.connect(self.app.quit) + + self.timeline.valueChanged.connect(self.receiver.foo) + self.timeline.start() + + self.app.exec_() + + self.assertTrue(self.receiver.counter > 1) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/ref06_test.py b/sources/pyside2/tests/signals/ref06_test.py new file mode 100644 index 000000000..ee2aa5700 --- /dev/null +++ b/sources/pyside2/tests/signals/ref06_test.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import QObject, QCoreApplication, QTimeLine, Signal, Slot +from helper import UsesQCoreApplication + +class ExtQObject(QObject): + signalbetween = Signal('qreal') + + def __init__(self): + QObject.__init__(self) + self.counter = 0 + + @Slot('qreal') + def foo(self, value): + self.counter += 1 + + +class SignaltoSignalTest(UsesQCoreApplication): + + def setUp(self): + UsesQCoreApplication.setUp(self) + self.receiver = ExtQObject() + self.timeline = QTimeLine(100) + + def tearDown(self): + del self.timeline + del self.receiver + UsesQCoreApplication.tearDown(self) + + def testSignaltoSignal(self): + self.timeline.setUpdateInterval(10) + + self.timeline.finished.connect(self.app.quit) + + self.timeline.valueChanged.connect(self.receiver.signalbetween) + self.receiver.signalbetween.connect(self.receiver.foo) + + self.timeline.start() + + self.app.exec_() + + self.assertTrue(self.receiver.counter > 1) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/segfault_proxyparent_test.py b/sources/pyside2/tests/signals/segfault_proxyparent_test.py new file mode 100644 index 000000000..b45e53579 --- /dev/null +++ b/sources/pyside2/tests/signals/segfault_proxyparent_test.py @@ -0,0 +1,86 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, SIGNAL + +# Description of the problem +# After creating an PyObject that inherits from QObject, connecting it, +# deleting it and later creating another Python QObject-based object, this +# new object will point to the same memory position as the first one. + +# Somehow the underlying QObject also points to the same position. + +# In PyQt4, the connection works fine with the same memory behavior, +# so it looks like specific to SIP. + +class Dummy(QObject): + def __init__(self, parent=None): + QObject.__init__(self, parent) + +class Joe(QObject): + def __init__(self, parent=None): + QObject.__init__(self, parent) + +class SegfaultCase(unittest.TestCase): + """Test case for the segfault happening when parent() is called inside + ProxyObject""" + + def setUp(self): + self.called = False + + def tearDown(self): + try: + del self.args + except: + pass + + def callback(self, *args): + if tuple(self.args) == args: + self.called = True + + def testSegfault(self): + """Regression: Segfault for qobjects in the same memory position.""" + obj = Dummy() + QObject.connect(obj, SIGNAL('bar(int)'), self.callback) + self.args = (33,) + obj.emit(SIGNAL('bar(int)'), self.args[0]) + self.assertTrue(self.called) + del obj + + obj = Joe() + QObject.connect(obj, SIGNAL('bar(int)'), self.callback) + self.args = (33,) + obj.emit(SIGNAL('bar(int)'), self.args[0]) + self.assertTrue(self.called) + + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/self_connect_test.py b/sources/pyside2/tests/signals/self_connect_test.py new file mode 100644 index 000000000..fde5fa885 --- /dev/null +++ b/sources/pyside2/tests/signals/self_connect_test.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Using self.connect(signal, method)''' + +import unittest + +from PySide2.QtCore import QObject, SIGNAL, SLOT +from PySide2.QtWidgets import QPushButton, QWidget + +from helper import UsesQApplication + + +class SelfConnect(UsesQApplication): + + def testButtonClickClose(self): + button = QPushButton() + button.connect(button, SIGNAL('clicked()'), SLOT('close()')) + + button.show() + self.assertTrue(button.isVisible()) + button.click() + self.assertTrue(not button.isVisible()) + + def testWindowButtonClickClose(self): + button = QPushButton() + window = QWidget() + window.connect(button, SIGNAL('clicked()'), SLOT('close()')) + + window.show() + self.assertTrue(window.isVisible()) + button.click() + self.assertTrue(not window.isVisible()) + + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/short_circuit_test.py b/sources/pyside2/tests/signals/short_circuit_test.py new file mode 100644 index 000000000..a47385f5c --- /dev/null +++ b/sources/pyside2/tests/signals/short_circuit_test.py @@ -0,0 +1,91 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, SIGNAL, SLOT + +class Dummy(QObject): + """Dummy class used in this test.""" + def __init__(self, parent=None): + QObject.__init__(self, parent) + +class ShortCircuitSignals(unittest.TestCase): + def setUp(self): + self.called = False + + def tearDown(self): + try: + del self.args + except: + pass + + def callback(self, *args): + if tuple(self.args) == args: + self.called = True + + def testNoArgs(self): + """Short circuit signal without arguments""" + obj1 = Dummy() + QObject.connect(obj1, SIGNAL('foo()'), self.callback) + self.args = tuple() + obj1.emit(SIGNAL('foo()'), *self.args) + self.assertTrue(self.called) + + def testWithArgs(self): + """Short circuit signal with integer arguments""" + obj1 = Dummy() + + QObject.connect(obj1, SIGNAL('foo(int)'), self.callback) + self.args = (42,) + obj1.emit(SIGNAL('foo(int)'), *self.args) + + self.assertTrue(self.called) + + def testMultipleArgs(self): + """Short circuit signal with multiple arguments""" + obj1 = Dummy() + + QObject.connect(obj1, SIGNAL('foo(int,int,QString)'), self.callback) + self.args = (42,33,'char') + obj1.emit(SIGNAL('foo(int,int,QString)'), *self.args) + + self.assertTrue(self.called) + + def testComplexArgs(self): + """Short circuit signal with complex arguments""" + obj1 = Dummy() + + QObject.connect(obj1, SIGNAL('foo(int,QObject*)'), self.callback) + self.args = (42, obj1) + obj1.emit(SIGNAL('foo(int,QObject*)'), *self.args) + + self.assertTrue(self.called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/signal2signal_connect_test.py b/sources/pyside2/tests/signals/signal2signal_connect_test.py new file mode 100644 index 000000000..f088212de --- /dev/null +++ b/sources/pyside2/tests/signals/signal2signal_connect_test.py @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Test case for signal to signal connections.''' + +import unittest +from PySide2.QtCore import * + +def cute_slot(): + pass + +class TestSignal2SignalConnect(unittest.TestCase): + '''Test case for signal to signal connections''' + + def setUp(self): + #Set up the basic resources needed + self.sender = QObject() + self.forwarder = QObject() + self.args = None + self.called = False + + def tearDown(self): + #Delete used resources + try: + del self.sender + except: + pass + try: + del self.forwarder + except: + pass + del self.args + + def callback_noargs(self): + #Default callback without arguments + self.called = True + + def callback_args(self, *args): + #Default callback with arguments + if args == self.args: + self.called = True + else: + raise TypeError("Invalid arguments") + + def callback_qobject(self, *args): + #Default callback for QObject as argument + if args[0].objectName() == self.args[0]: + self.called = True + else: + raise TypeError("Invalid arguments") + + + def testSignalWithoutArguments(self): + QObject.connect(self.sender, SIGNAL("destroyed()"), + self.forwarder, SIGNAL("forward()")) + QObject.connect(self.forwarder, SIGNAL("forward()"), + self.callback_noargs) + del self.sender + self.assertTrue(self.called) + + + def testSignalWithOnePrimitiveTypeArgument(self): + QObject.connect(self.sender, SIGNAL("mysignal(int)"), + self.forwarder, SIGNAL("mysignal(int)")) + QObject.connect(self.forwarder, SIGNAL("mysignal(int)"), + self.callback_args) + self.args = (19,) + self.sender.emit(SIGNAL('mysignal(int)'), *self.args) + self.assertTrue(self.called) + + + def testSignalWithMultiplePrimitiveTypeArguments(self): + QObject.connect(self.sender, SIGNAL("mysignal(int,int)"), + self.forwarder, SIGNAL("mysignal(int,int)")) + QObject.connect(self.forwarder, SIGNAL("mysignal(int,int)"), + self.callback_args) + self.args = (23, 29) + self.sender.emit(SIGNAL('mysignal(int,int)'), *self.args) + self.assertTrue(self.called) + + + def testSignalWithOneStringArgument(self): + QObject.connect(self.sender, SIGNAL("mysignal(QString)"), + self.forwarder, SIGNAL("mysignal(QString)")) + QObject.connect(self.forwarder, SIGNAL("mysignal(QString)"), + self.callback_args) + self.args = ('myargument',) + self.sender.emit(SIGNAL('mysignal(QString)'), *self.args) + self.assertTrue(self.called) + + + def testSignalWithOneQObjectArgument(self): + QObject.connect(self.sender, SIGNAL('destroyed(QObject*)'), + self.forwarder, SIGNAL('forward(QObject*)')) + QObject.connect(self.forwarder, SIGNAL('forward(QObject*)'), + self.callback_qobject) + + obj_name = 'sender' + self.sender.setObjectName(obj_name) + self.args = (obj_name, ) + del self.sender + self.assertTrue(self.called) + + +if __name__ == '__main__': + unittest.main() + + diff --git a/sources/pyside2/tests/signals/signal_autoconnect_test.py b/sources/pyside2/tests/signals/signal_autoconnect_test.py new file mode 100644 index 000000000..e8ff6200e --- /dev/null +++ b/sources/pyside2/tests/signals/signal_autoconnect_test.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import * +from PySide2.QtWidgets import * + +class MyObject(QWidget): + def __init__(self, parent=None): + QWidget.__init__(self, parent) + self._method_called = False + + @Slot() + def on_button_clicked(self): + self._method_called = True + + +class AutoConnectionTest(unittest.TestCase): + + def testConnection(self): + app = QApplication([]) + + win = MyObject() + btn = QPushButton("click", win) + btn.setObjectName("button") + QMetaObject.connectSlotsByName(win) + btn.click() + self.assertTrue(win._method_called) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/signal_connectiontype_support_test.py b/sources/pyside2/tests/signals/signal_connectiontype_support_test.py new file mode 100644 index 000000000..50a24084e --- /dev/null +++ b/sources/pyside2/tests/signals/signal_connectiontype_support_test.py @@ -0,0 +1,55 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QObject, SIGNAL, Qt + +class Dummy(QObject): + """Dummy class used in this test.""" + def __init__(self, parent=None): + QObject.__init__(self, parent) + +class TestConnectionTypeSupport(unittest.TestCase): + def callback(self, *args): + if tuple(self.args) == args: + self.called = True + + def testNoArgs(self): + """Connect signal using a Qt.ConnectionType as argument""" + obj1 = Dummy() + + QObject.connect(obj1, SIGNAL('foo()'), self.callback, Qt.DirectConnection) + self.args = tuple() + obj1.emit(SIGNAL('foo()'), *self.args) + + self.assertTrue(self.called) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/signal_emission_gui_test.py b/sources/pyside2/tests/signals/signal_emission_gui_test.py new file mode 100644 index 000000000..b114351c2 --- /dev/null +++ b/sources/pyside2/tests/signals/signal_emission_gui_test.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +"""Tests covering signal emission and receiving to python slots""" + +import unittest + +from PySide2.QtCore import QObject, SIGNAL, SLOT + +try: + from PySide2.QtWidgets import QSpinBox, QPushButton + hasQtGui = True +except ImportError: + hasQtGui = False + +from helper import BasicPySlotCase, UsesQApplication + +if hasQtGui: + class ButtonPySlot(UsesQApplication, BasicPySlotCase): + """Tests the connection of python slots to QPushButton signals""" + + def testButtonClicked(self): + """Connection of a python slot to QPushButton.clicked()""" + button = QPushButton('Mylabel') + QObject.connect(button, SIGNAL('clicked()'), self.cb) + self.args = tuple() + button.emit(SIGNAL('clicked(bool)'), False) + self.assertTrue(self.called) + + def testButtonClick(self): + """Indirect qt signal emission using the QPushButton.click() method """ + button = QPushButton('label') + QObject.connect(button, SIGNAL('clicked()'), self.cb) + self.args = tuple() + button.click() + self.assertTrue(self.called) + + +if hasQtGui: + class SpinBoxPySlot(UsesQApplication, BasicPySlotCase): + """Tests the connection of python slots to QSpinBox signals""" + + def setUp(self): + super(SpinBoxPySlot, self).setUp() + self.spin = QSpinBox() + + def tearDown(self): + del self.spin + super(SpinBoxPySlot, self).tearDown() + + def testSpinBoxValueChanged(self): + """Connection of a python slot to QSpinBox.valueChanged(int)""" + QObject.connect(self.spin, SIGNAL('valueChanged(int)'), self.cb) + self.args = [3] + self.spin.emit(SIGNAL('valueChanged(int)'), *self.args) + self.assertTrue(self.called) + + def testSpinBoxValueChangedImplicit(self): + """Indirect qt signal emission using QSpinBox.setValue(int)""" + QObject.connect(self.spin, SIGNAL('valueChanged(int)'), self.cb) + self.args = [42] + self.spin.setValue(self.args[0]) + self.assertTrue(self.called) + + def atestSpinBoxValueChangedFewArgs(self): + """Emission of signals with fewer arguments than needed""" + # XXX: PyQt4 crashes on the assertRaises + QObject.connect(self.spin, SIGNAL('valueChanged(int)'), self.cb) + self.args = (554,) + self.assertRaises(TypeError, self.spin.emit, SIGNAL('valueChanged(int)')) + +if hasQtGui: + class QSpinBoxQtSlots(UsesQApplication): + """Tests the connection to QSpinBox qt slots""" + + qapplication = True + + def testSetValueIndirect(self): + """Indirect signal emission: QSpinBox using valueChanged(int)/setValue(int)""" + spinSend = QSpinBox() + spinRec = QSpinBox() + + spinRec.setValue(5) + + QObject.connect(spinSend, SIGNAL('valueChanged(int)'), spinRec, SLOT('setValue(int)')) + self.assertEqual(spinRec.value(), 5) + spinSend.setValue(3) + self.assertEqual(spinRec.value(), 3) + self.assertEqual(spinSend.value(), 3) + + def testSetValue(self): + """Direct signal emission: QSpinBox using valueChanged(int)/setValue(int)""" + spinSend = QSpinBox() + spinRec = QSpinBox() + + spinRec.setValue(5) + spinSend.setValue(42) + + QObject.connect(spinSend, SIGNAL('valueChanged(int)'), spinRec, SLOT('setValue(int)')) + self.assertEqual(spinRec.value(), 5) + self.assertEqual(spinSend.value(), 42) + spinSend.emit(SIGNAL('valueChanged(int)'), 3) + + self.assertEqual(spinRec.value(), 3) + #Direct emission shouldn't change the value of the emitter + self.assertEqual(spinSend.value(), 42) + + spinSend.emit(SIGNAL('valueChanged(int)'), 66) + self.assertEqual(spinRec.value(), 66) + self.assertEqual(spinSend.value(), 42) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/signal_emission_test.py b/sources/pyside2/tests/signals/signal_emission_test.py new file mode 100644 index 000000000..8e36d9826 --- /dev/null +++ b/sources/pyside2/tests/signals/signal_emission_test.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +"""Tests covering signal emission and receiving to python slots""" + +import sys +import unittest +import functools + +from PySide2.QtCore import QObject, SIGNAL, SLOT, QProcess, QTimeLine + +from helper import BasicPySlotCase, UsesQCoreApplication + + +class ArgsOnEmptySignal(UsesQCoreApplication): + '''Trying to emit a signal without arguments passing some arguments''' + + def testArgsToNoArgsSignal(self): + '''Passing arguments to a signal without arguments''' + process = QProcess() + self.assertRaises(TypeError, process.emit, SIGNAL('started()'), 42) + + +class MoreArgsOnEmit(UsesQCoreApplication): + '''Trying to pass more args than needed to emit (signals with args)''' + + def testMoreArgs(self): + '''Passing more arguments than needed''' + process = QProcess() + self.assertRaises(TypeError, process.emit, SIGNAL('finished(int)'), 55, 55) + +class Dummy(QObject): + '''Dummy class''' + pass + +class PythonSignalToCppSlots(UsesQCoreApplication): + '''Connect python signals to C++ slots''' + + def testWithoutArgs(self): + '''Connect python signal to QTimeLine.toggleDirection()''' + timeline = QTimeLine() + dummy = Dummy() + QObject.connect(dummy, SIGNAL('dummy()'), + timeline, SLOT('toggleDirection()')) + + orig_dir = timeline.direction() + dummy.emit(SIGNAL('dummy()')) + new_dir = timeline.direction() + + if orig_dir == QTimeLine.Forward: + self.assertEqual(new_dir, QTimeLine.Backward) + else: + self.assertEqual(new_dir, QTimeLine.Forward) + + def testWithArgs(self): + '''Connect python signals to QTimeLine.setCurrentTime(int)''' + timeline = QTimeLine() + dummy = Dummy() + + QObject.connect(dummy, SIGNAL('dummy(int)'), + timeline, SLOT('setCurrentTime(int)')) + + current = timeline.currentTime() + dummy.emit(SIGNAL('dummy(int)'), current+42) + self.assertEqual(timeline.currentTime(), current+42) + +class CppSignalsToCppSlots(UsesQCoreApplication): + '''Connection between C++ slots and signals''' + + def testWithoutArgs(self): + '''Connect QProcess.started() to QTimeLine.togglePaused()''' + process = QProcess() + timeline = QTimeLine() + + QObject.connect(process, SIGNAL('finished(int, QProcess::ExitStatus)'), + timeline, SLOT('toggleDirection()')) + + orig_dir = timeline.direction() + + process.start(sys.executable, ['-c', '"print 42"']) + process.waitForFinished() + + new_dir = timeline.direction() + + if orig_dir == QTimeLine.Forward: + self.assertEqual(new_dir, QTimeLine.Backward) + else: + self.assertEqual(new_dir, QTimeLine.Forward) + +called = False +def someSlot(args=None): + global called + called = True + +class DynamicSignalsToFuncPartial(UsesQCoreApplication): + + def testIt(self): + global called + called = False + o = QObject() + o.connect(o, SIGNAL("ASignal()"), functools.partial(someSlot, "partial ..")) + o.emit(SIGNAL("ASignal()")) + self.assertTrue(called) + +class EmitUnknownType(UsesQCoreApplication): + def testIt(self): + a = QObject() + a.connect(SIGNAL('foobar(Dummy)'), lambda x: 42) # Just connect with an unknown type + self.assertRaises(TypeError, a.emit, SIGNAL('foobar(Dummy)'), 22) + +class EmitEnum(UsesQCoreApplication): + """Test emission of enum arguments""" + + def slot(self, arg): + self.arg = arg + + def testIt(self): + self.arg = None + p = QProcess() + p.stateChanged.connect(self.slot) + p.stateChanged.emit(QProcess.NotRunning) + self.assertEqual(self.arg, QProcess.NotRunning) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/signal_func_test.py b/sources/pyside2/tests/signals/signal_func_test.py new file mode 100644 index 000000000..80e05a76f --- /dev/null +++ b/sources/pyside2/tests/signals/signal_func_test.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import SIGNAL, SLOT + +class SIGNALSLOTTests(unittest.TestCase): + '''Test the output of SIGNAL and SLOT.''' + + def testSIGNAL(self): + #SIGNAL function + a = "foobar" + self.assertEqual(str(SIGNAL(a)), "2foobar") + + def testSLOT(self): + #SLOT function + a = "foobar" + self.assertEqual(str(SLOT(a)), "1foobar") + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/signal_manager_refcount_test.py b/sources/pyside2/tests/signals/signal_manager_refcount_test.py new file mode 100644 index 000000000..3a1939cc6 --- /dev/null +++ b/sources/pyside2/tests/signals/signal_manager_refcount_test.py @@ -0,0 +1,51 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from sys import getrefcount +import unittest +from PySide2.QtCore import QObject, SIGNAL + +class SignalManagerRefCount(unittest.TestCase): + """Simple test case to check if the signal_manager is erroneously incrementing the object refcounter""" + + def testObjectRefcount(self): + """Emission of QObject.destroyed() to a python slot""" + def callback(): + pass + obj = QObject() + refcount = getrefcount(obj) + QObject.connect(obj, SIGNAL('destroyed()'), callback) + self.assertEqual(refcount, getrefcount(obj)) + QObject.disconnect(obj, SIGNAL('destroyed()'), callback) + self.assertEqual(refcount, getrefcount(obj)) + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/signal_number_limit_test.py b/sources/pyside2/tests/signals/signal_number_limit_test.py new file mode 100644 index 000000000..9850f17ba --- /dev/null +++ b/sources/pyside2/tests/signals/signal_number_limit_test.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2 import QtCore + +class Emitter(QtCore.QObject): + s1 = QtCore.Signal() + s2 = QtCore.Signal() + s3 = QtCore.Signal() + s4 = QtCore.Signal() + s5 = QtCore.Signal() + s6 = QtCore.Signal() + s7 = QtCore.Signal() + s8 = QtCore.Signal() + s9 = QtCore.Signal() + s10 = QtCore.Signal() + s11 = QtCore.Signal() + s12 = QtCore.Signal() + s13 = QtCore.Signal() + s14 = QtCore.Signal() + +class SignalNumberLimitTest(unittest.TestCase): + def myCb(self): + self._count += 1 + + def testBug(self): + e = Emitter() + e.s1.connect(self.myCb) + e.s2.connect(self.myCb) + e.s3.connect(self.myCb) + e.s4.connect(self.myCb) + e.s5.connect(self.myCb) + e.s6.connect(self.myCb) + e.s7.connect(self.myCb) + e.s8.connect(self.myCb) + e.s9.connect(self.myCb) + e.s10.connect(self.myCb) + e.s11.connect(self.myCb) + e.s12.connect(self.myCb) + e.s13.connect(self.myCb) + e.s14.connect(self.myCb) + + self._count = 0 + e.s1.emit() + e.s2.emit() + e.s3.emit() + e.s4.emit() + e.s5.emit() + e.s6.emit() + e.s7.emit() + e.s8.emit() + e.s9.emit() + e.s10.emit() + e.s11.emit() + e.s12.emit() + e.s13.emit() + e.s14.emit() + self.assertEqual(self._count, 14) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/signal_object_test.py b/sources/pyside2/tests/signals/signal_object_test.py new file mode 100644 index 000000000..3247f7c46 --- /dev/null +++ b/sources/pyside2/tests/signals/signal_object_test.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtCore import QTimer, Signal, QObject, Slot, Qt +from helper import UsesQCoreApplication + +class MyObject(QTimer): + sig1 = Signal() + sig2 = Signal(int, name='rangeChanged') + sig3 = Signal(int) + sig4 = Signal((int,), (str,)) + sig5 = Signal((str,), (int,)) + sig6 = Signal(QObject) + + @Slot(int) + def myRange(self, r): + self._range = r + + def slot1(self): + self._called = True + + def slotString(self, s): + self._s = s + + def slotObject(self, o): + self._o = o + + +class SignalObjectTest(UsesQCoreApplication): + def cb(self): + self._cb_called = True + self.app.exit() + + def testsingleConnect(self): + o = MyObject() + o.sig1.connect(o.slot1) + o.sig1.emit() + self.assertTrue(o._called) + + def testSignalWithArgs(self): + o = MyObject() + o.sig3.connect(o.myRange) + o.sig3.emit(10) + self.assertEqual(o._range, 10) + + def testSignatureParse(self): + o = MyObject() + o.sig2.connect(o.myRange) + o.sig2.emit(10) + + def testDictOperator(self): + o = MyObject() + o.sig4[str].connect(o.slotString) + o.sig4[str].emit("PySide") + self.assertEqual(o._s, "PySide") + + def testGeneretedSignal(self): + o = MyObject() + o.timeout.connect(self.cb) + o.start(100) + self.app.exec_() + self.assertTrue(self._cb_called) + + def testConnectionType(self): + o = MyObject() + o.timeout.connect(self.cb, type=Qt.DirectConnection) + o.start(100) + self.app.exec_() + self.assertTrue(self._cb_called) + + def testSignalWithSignal(self): + o = MyObject() + o.sig2.connect(o.myRange) + o.sig5.connect(o.sig2) + o.sig5[int].emit(10) + self.assertEqual(o._range, 10) + + def testSignalWithObject(self): + o = MyObject() + o.sig6.connect(o.slotObject) + arg = QObject() + o.sig6.emit(arg) + self.assertEqual(arg, o._o) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/signal_signature_test.py b/sources/pyside2/tests/signals/signal_signature_test.py new file mode 100644 index 000000000..349619aac --- /dev/null +++ b/sources/pyside2/tests/signals/signal_signature_test.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Test case for signal signature received by QObject::connectNotify().''' + +import unittest +from PySide2.QtCore import * +from helper import UsesQCoreApplication + +class Obj(QObject): + def __init__(self): + QObject.__init__(self) + self.signal = '' + + def connectNotify(self, signal): + self.signal = signal + +def callback(arg=None): + pass + +class TestConnectNotifyWithNewStyleSignals(UsesQCoreApplication): + '''Test case for signal signature received by QObject::connectNotify().''' + + def testOldStyle(self): + sender = Obj() + receiver = QObject() + sender.connect(SIGNAL('destroyed()'), receiver, SLOT('deleteLater()')) + # When connecting to a regular slot, and not a python callback function, QObject::connect + # will use the non-cloned method signature, so connectinc to destroyed() will actually + # connect to destroyed(QObject*). + self.assertEqual(sender.signal.methodSignature(), 'destroyed(QObject*)') + + def testOldStyleWithPythonCallback(self): + sender = Obj() + sender.connect(SIGNAL('destroyed()'), callback) + self.assertEqual(sender.signal.methodSignature(), 'destroyed()') + + def testNewStyle(self): + sender = Obj() + + sender.destroyed.connect(callback) + self.assertEqual(sender.signal.methodSignature(), 'destroyed()') + + sender.destroyed[QObject].connect(callback) + self.assertEqual(sender.signal.methodSignature(), 'destroyed(QObject*)') + +if __name__ == '__main__': + unittest.main() + diff --git a/sources/pyside2/tests/signals/signal_with_primitive_type_test.py b/sources/pyside2/tests/signals/signal_with_primitive_type_test.py new file mode 100644 index 000000000..cf1075051 --- /dev/null +++ b/sources/pyside2/tests/signals/signal_with_primitive_type_test.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest +from PySide2.QtCore import * + + +class SignalPrimitiveTypeTest(unittest.TestCase): + + def signalValueChanged(self, v): + self.called = True + self._app.quit() + + def createTimeLine(self): + self.called = False + tl = QTimeLine(10000) + QObject.connect(tl, SIGNAL("valueChanged(qreal)"), self.signalValueChanged) + return tl + + def testTimeLine(self): + self._valueChangedCount = 0 + self._app = QCoreApplication([]) + tl = self.createTimeLine() + tl.start() + self._app.exec_() + self.assertTrue(self.called) + +if __name__ == '__main__': + unittest.main() + + diff --git a/sources/pyside2/tests/signals/slot_reference_count_test.py b/sources/pyside2/tests/signals/slot_reference_count_test.py new file mode 100644 index 000000000..246c3a5b8 --- /dev/null +++ b/sources/pyside2/tests/signals/slot_reference_count_test.py @@ -0,0 +1,81 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +''' Forced disconnection: Delete one end of the signal connection''' + +import unittest +from sys import getrefcount + +from PySide2.QtCore import QObject, SIGNAL, SLOT + +class Dummy(QObject): + def dispatch(self): + self.emit(SIGNAL('foo()')) + +class PythonSignalRefCount(unittest.TestCase): + + def setUp(self): + self.emitter = Dummy() + + def tearDown(self): + self.emitter + + def testRefCount(self): + def cb(*args): + pass + + self.assertEqual(getrefcount(cb), 2) + + QObject.connect(self.emitter, SIGNAL('foo()'), cb) + self.assertEqual(getrefcount(cb), 3) + + QObject.disconnect(self.emitter, SIGNAL('foo()'), cb) + self.assertEqual(getrefcount(cb), 2) + +class CppSignalRefCount(unittest.TestCase): + + def setUp(self): + self.emitter = QObject() + + def tearDown(self): + self.emitter + + def testRefCount(self): + def cb(*args): + pass + + self.assertEqual(getrefcount(cb), 2) + + QObject.connect(self.emitter, SIGNAL('destroyed()'), cb) + self.assertEqual(getrefcount(cb), 3) + + QObject.disconnect(self.emitter, SIGNAL('destroyed()'), cb) + self.assertEqual(getrefcount(cb), 2) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/signals/static_metaobject_test.py b/sources/pyside2/tests/signals/static_metaobject_test.py new file mode 100644 index 000000000..e0575bc3e --- /dev/null +++ b/sources/pyside2/tests/signals/static_metaobject_test.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +"""Tests covering signal emission and receiving to python slots""" + +import unittest + +from PySide2.QtCore import QObject, SIGNAL, Slot +from helper import UsesQCoreApplication + +class MyObject(QObject): + def __init__(self, parent=None): + QObject.__init__(self, parent) + self._slotCalledCount = 0 + + # this '@Slot()' is needed to get the right sort order in testSharedSignalEmission. + # For some reason, it also makes the tests actually work! + @Slot() + def mySlot(self): + self._slotCalledCount = self._slotCalledCount + 1 + + +class StaticMetaObjectTest(UsesQCoreApplication): + + def testSignalPropagation(self): + o = MyObject() + o2 = MyObject() + + # SIGNAL foo not created yet + self.assertEqual(o.metaObject().indexOfSignal("foo()"), -1) + + o.connect(SIGNAL("foo()"), o2.mySlot) + # SIGNAL foo create after connect + self.assertTrue(o.metaObject().indexOfSignal("foo()") > 0) + + # SIGNAL does not propagate to others objects of the same type + self.assertEqual(o2.metaObject().indexOfSignal("foo()"), -1) + + del o + del o2 + o = MyObject() + # The SIGNAL was destroyed with old objects + self.assertEqual(o.metaObject().indexOfSignal("foo()"), -1) + + + def testSharedSignalEmission(self): + o = QObject() + m = MyObject() + + o.connect(SIGNAL("foo2()"), m.mySlot) + m.connect(SIGNAL("foo2()"), m.mySlot) + o.emit(SIGNAL("foo2()")) + self.assertEqual(m._slotCalledCount, 1) + del o + m.emit(SIGNAL("foo2()")) + self.assertEqual(m._slotCalledCount, 2) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/tools/list-class-hierarchy.py b/sources/pyside2/tests/tools/list-class-hierarchy.py new file mode 100755 index 000000000..742cd4fa7 --- /dev/null +++ b/sources/pyside2/tests/tools/list-class-hierarchy.py @@ -0,0 +1,117 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + + +# This is a small script printing out Qt binding class hierarchies +# for comparison purposes. +# +# Usage: +# +# ./list-class-hierarchy.py PySide2 > pyside2.list +# ./list-class-hierarchy.py PyQt5 > pyqt5.list +# +# meld pyside.list pyqt5.list + +from __future__ import print_function + +import sys +import pdb +from inspect import isclass + +ignore = ["staticMetaObject", + "pyqtConfigure", + "registerUserData", + "thread", + ] + +def recurse_into(el,obj): + #s = el.split('.')[-1] + #pdb.set_trace() + symbols = [] + for item in sorted(dir(obj)): + if item[0]=='_': + continue + mel = el + '.' + item + try: + mobj = eval(mel) + except Exception: + continue + + if item in ignore: + continue + else: + symbols.append(mel) + + if isclass(mobj): + symbols += recurse_into(mel,mobj) + + return symbols + +if __name__=='__main__': + modules = [ 'QtCore', + 'QtGui', + 'QtHelp', + #'QtMultimedia', + 'QtNetwork', + #'QtOpenGL', + 'QtScript', + 'QtScriptTools', + 'QtSql', + 'QtSvg', + 'QtTest', + #'QtUiTools', + 'QtWebKit', + 'QtXml', + 'QtXmlPatterns' ] + + libraries = ["PySide2", "PyQt5"] + librarySymbols = {} + for l in libraries: + dictionary = [] + if l =="PyQt5": + import sip + sip.setapi('QDate',2) + sip.setapi('QDateTime',2) + sip.setapi('QString',2) + sip.setapi('QTextStream',2) + sip.setapi('QTime',2) + sip.setapi('QUrl',2) + sip.setapi('QVariant',2) + + for m in modules: + exec("from %s import %s" % (l,m), globals(), locals()) + dictionary += recurse_into(m, eval(m)) + librarySymbols[l] = dictionary + + print("PyQt5: ", len(librarySymbols["PyQt5"]), " PySide2: ", len(librarySymbols["PySide2"])) + + for symbol in librarySymbols["PyQt5"]: + if not (symbol in librarySymbols["PySide2"]): + print("Symbol not found in PySide2:", symbol) diff --git a/sources/pyside2/tests/util/color.py b/sources/pyside2/tests/util/color.py new file mode 100644 index 000000000..e7ab84d0e --- /dev/null +++ b/sources/pyside2/tests/util/color.py @@ -0,0 +1,41 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +'''Function to print a colored line to terminal''' + +RED='\033[0;31m%s\033[m' + +def print_colored(message, color=RED): + print(color % message) + +if __name__ == '__main__': + print('42 - the answer') + print_colored("But what's the question?") + print('Hum?') diff --git a/sources/pyside2/tests/util/helper/__init__.py b/sources/pyside2/tests/util/helper/__init__.py new file mode 100644 index 000000000..ff7af6999 --- /dev/null +++ b/sources/pyside2/tests/util/helper/__init__.py @@ -0,0 +1,160 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Helper classes and functions''' + +import os +import unittest + +from random import randint + +from PySide2.QtCore import QCoreApplication, QTimer + +try: + from PySide2.QtWidgets import QApplication +except ImportError: + has_gui = False +else: + has_gui = True + +def adjust_filename(filename, orig_mod_filename): + dirpath = os.path.dirname(os.path.abspath(orig_mod_filename)) + return os.path.join(dirpath, filename) + +class NoQtGuiError(Exception): + def __init__(self): + Exception.__init__(self, 'No QtGui found') + +class BasicPySlotCase(object): + '''Base class that tests python slots and signal emissions. + + Python slots are defined as any callable passed to QObject.connect(). + ''' + def setUp(self): + self.called = False + + def tearDown(self): + try: + del self.args + except: + pass + + def cb(self, *args): + '''Simple callback with arbitrary arguments. + + The test function must setup the 'args' attribute with a sequence + containing the arguments expected to be received by this slot. + Currently only a single connection is supported. + ''' + if tuple(self.args) == args: + self.called = True + else: + raise ValueError('Invalid arguments for callback') + + +_instance = None +_timed_instance = None + +if has_gui: + class UsesQApplication(unittest.TestCase): + '''Helper class to provide QApplication instances''' + + qapplication = True + + def setUp(self): + '''Creates the QApplication instance''' + + # Simple way of making instance a singleton + super(UsesQApplication, self).setUp() + global _instance + if _instance is None: + _instance = QApplication([]) + + self.app = _instance + + def tearDown(self): + '''Deletes the reference owned by self''' + del self.app + super(UsesQApplication, self).tearDown() + + + class TimedQApplication(unittest.TestCase): + '''Helper class with timed QApplication exec loop''' + + def setUp(self, timeout=100): + '''Setups this Application. + + timeout - timeout in milisseconds''' + global _timed_instance + if _timed_instance is None: + _timed_instance = QApplication([]) + + self.app = _timed_instance + QTimer.singleShot(timeout, self.app.quit) + + def tearDown(self): + '''Delete resources''' + del self.app +else: + class UsesQApplication(unittest.TestCase): + def setUp(self): + raise NoQtGuiError() + class TimedQapplication(unittest.TestCase): + def setUp(self): + raise NoQtGuiError() + + +_core_instance = None + +class UsesQCoreApplication(unittest.TestCase): + '''Helper class for test cases that require an QCoreApplication + Just connect or call self.exit_app_cb. When called, will ask + self.app to exit. + ''' + + def setUp(self): + '''Set up resources''' + + global _core_instance + if _core_instance is None: + _core_instance = QCoreApplication([]) + + self.app = _core_instance + + def tearDown(self): + '''Release resources''' + del self.app + + def exit_app_cb(self): + '''Quits the application''' + self.app.exit(0) + + +def random_string(size=5): + '''Generate random string with the given size''' + return ''.join(map(chr, [randint(33, 126) for x in range(size)])) diff --git a/sources/pyside2/tests/util/helper/docmodifier.py b/sources/pyside2/tests/util/helper/docmodifier.py new file mode 100644 index 000000000..16d3e28ad --- /dev/null +++ b/sources/pyside2/tests/util/helper/docmodifier.py @@ -0,0 +1,116 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'''Helper metaclass do 'decorate' docstrings from base test case classes''' + +import types + + +def copy_func(func): + '''Helper function to copy a function object (except docstring)''' + return types.FunctionType(func.func_code, func.func_globals, func.func_name, + func.func_defaults, func.func_closure) + + +class DocModifier(type): + '''Metaclass for modifiying method documentation. + + It allows the managed class to modify the method documentation, adding + prefixes and suffixes to a given set of methods. + + For example, you have some unittest.TestCases that run on different set + of data. These methods could be written once in a base class and the + inheriting class just setup different setUp/tearDown methods with the + proper data. To differentiate the methods when using docstrings, you + can add a suffix or prefix to the docstring. + + Variables in the implementing class: + + doc_prefix - The prefix to the docstring + doc_suffix - The suffix to the docstring + doc_filter - The function to filter the methods. If not provided, this + no docstrings are changed.''' + + def __new__(mcs, name, bases, dct): + + # FIXME currently we have to define doc_filter on each subclass + filter_function = dct.get('doc_filter') + if not filter_function: + filter_function = lambda x: False + + for base in bases: + for attr in [x for x in base.__dict__ if filter_function(x)]: + original = getattr(base, attr) + + if original.__doc__: + copy = copy_func(original) + copy.__doc__ = (dct.get('doc_prefix', '') + + original.__doc__ + + dct.get('doc_suffix', '')) + dct[attr] = copy + + return type.__new__(mcs, name, bases, dct) + + def __init__(mcs, name, bases, dct): + super(DocModifier, mcs).__init__(name, bases, dct) + + +if __name__ == '__main__': + + # tests + class BaseTest(object): + __metaclass__ = DocModifier + + def testBase(self): + '''base''' + + def testWithoutDoc(self): + pass + + class Implementing(BaseTest): + + doc_filter = lambda x: x.startswith('test') + doc_prefix = 'prefix' + doc_suffix = 'suffix' + + class OnlyPrefix(BaseTest): + + doc_filter = lambda x: x.startswith('test') + doc_prefix = 'prefix' + + class OnlySuffix(BaseTest): + + doc_filter = lambda x: x.startswith('test') + doc_suffix = 'suffix' + + assert(Implementing.testBase.__doc__ == 'prefixbasesuffix') + assert(Implementing.testWithoutDoc.__doc__ == None) + assert(OnlySuffix.testBase.__doc__ == 'basesuffix') + assert(OnlySuffix.testWithoutDoc.__doc__ == None) + assert(OnlyPrefix.testBase.__doc__ == 'prefixbase') + assert(OnlyPrefix.testWithoutDoc.__doc__ == None) diff --git a/sources/pyside2/tests/util/httpd.py b/sources/pyside2/tests/util/httpd.py new file mode 100644 index 000000000..8214cf033 --- /dev/null +++ b/sources/pyside2/tests/util/httpd.py @@ -0,0 +1,177 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import os +import sys +import threading +import select +import random +import py3kcompat as py3k + +if py3k.IS_PY3K: + import socketserver as SocketServer + import http.server as BaseHTTPServer +else: + import SocketServer + import BaseHTTPServer + +class TestHandler(BaseHTTPServer.BaseHTTPRequestHandler): + DATA = "PySide Server" + allow_reuse_address = True + + def do_GET(self): + self.send_head() + self.wfile.write(TestHandler.DATA) + + def do_HEAD(self): + self.send_head() + + def send_head(self): + self.send_response(200) + self.send_header("Content-type", "text/plain") + self.send_header("Content-Length", str(len(TestHandler.DATA))) + self.end_headers() + +class TestSecureHandler(BaseHTTPServer.BaseHTTPRequestHandler): + DATA = "PySide" + allow_reuse_address = True + + def do_GET(self): + self.send_head() + self.wfile.write(py3k.b(TestHandler.DATA)) + + def do_HEAD(self): + self.send_head() + + def send_head(self): + try: + handler = self.marshall_handler() + handler.do_request(self) + except: + self.send_response(401) + self.send_header("WWW-Authenticate", "Basic realm='Secure Area'") + self.send_header("Content-type", "text/plain") + self.send_header("Content-Length", str(len(TestHandler.DATA))) + self.end_headers() + +# Workaround for the missing shutdown method in python2.5 +class CompatTCPServer(SocketServer.TCPServer): + def __init__(self, server_address, RequestHandlerClass): + SocketServer.TCPServer.__init__(self, server_address, RequestHandlerClass) + + self.isPy25 = sys.version_info[0] == 2 and sys.version_info[1] == 5 + if self.isPy25: + self.__is_shut_down = threading.Event() + self.__serving = False + + def serve_forever(self, poll_interval=0.5): + """Handle one request at a time until shutdown. + + Polls for shutdown every poll_interval seconds. Ignores + self.timeout. If you need to do periodic tasks, do them in + another thread. + """ + if self.isPy25: + self.__serving = True + self.__is_shut_down.clear() + while self.__serving: + # XXX: Consider using another file descriptor or + # connecting to the socket to wake this up instead of + # polling. Polling reduces our responsiveness to a + # shutdown request and wastes cpu at all other times. + r, w, e = select.select([self], [], [], poll_interval) + if r: + self.py25_handle_request_noblock() + self.__is_shut_down.set() + else: + SocketServer.TCPServer.serve_forever(self, poll_interval) + + def py25_handle_request_noblock(self): + """Handle one request, without blocking. + + I assume that select.select has returned that the socket is + readable before this function was called, so there should be + no risk of blocking in get_request(). + """ + if self.isPy25: + try: + request, client_address = self.get_request() + except socket.error: + return + if self.verify_request(request, client_address): + try: + self.process_request(request, client_address) + except: + self.handle_error(request, client_address) + self.close_request(request) + + def shutdown(self): + """Stops the serve_forever loop. + + Blocks until the loop has finished. This must be called while + serve_forever() is running in another thread, or it will + deadlock. + """ + if self.isPy25: + self.__serving = False + if not self.__is_shut_down: + self.__is_shut_down.wait() + else: + SocketServer.TCPServer.shutdown(self) + + +class TestServer(threading.Thread): + + def __init__(self, secure=False): + threading.Thread.__init__(self) + + self._port = int(os.getenv("PYSIDE_TESTSERVER_PORT") or 12321) + self.keep_running = True + + if secure: + handle = TestSecureHandler + else: + handle = TestHandler + + while True: + try: + self.httpd = CompatTCPServer(('' , self._port), handle) + break + except: + self._port = self._port + random.randint(1, 100) + + def port(self): + return self._port + + def run(self): + self.httpd.serve_forever() + + def shutdown(self): + self.httpd.shutdown() + self.join() + diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtAssistant.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtAssistant.py new file mode 100644 index 000000000..d0975d51e --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtAssistant.py @@ -0,0 +1,2 @@ + +from PyQt4.QtAssistant import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtCore.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtCore.py new file mode 100644 index 000000000..a6a225649 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtCore.py @@ -0,0 +1,2 @@ + +from PyQt4.QtCore import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtDesigner.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtDesigner.py new file mode 100644 index 000000000..5cf9d5f6d --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtDesigner.py @@ -0,0 +1,2 @@ + +from PyQt4.QtDesigner import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtGui.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtGui.py new file mode 100644 index 000000000..0b8b4e957 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtGui.py @@ -0,0 +1,2 @@ + +from PyQt4.QtGui import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtHelp.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtHelp.py new file mode 100644 index 000000000..dd3fd6cd8 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtHelp.py @@ -0,0 +1,2 @@ + +from PyQt4.QtHelp import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtNetwork.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtNetwork.py new file mode 100644 index 000000000..1a669a421 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtNetwork.py @@ -0,0 +1,2 @@ + +from PyQt4.QtNetwork import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtScript.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtScript.py new file mode 100644 index 000000000..4f6b30e8e --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtScript.py @@ -0,0 +1,2 @@ + +from PyQt4.QtScript import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtSql.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtSql.py new file mode 100644 index 000000000..35dd0a106 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtSql.py @@ -0,0 +1,2 @@ + +from PyQt4.QtSql import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtSvg.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtSvg.py new file mode 100644 index 000000000..f308222b9 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtSvg.py @@ -0,0 +1,2 @@ + +from PyQt4.QtSvg import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtTest.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtTest.py new file mode 100644 index 000000000..95f64006b --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtTest.py @@ -0,0 +1,2 @@ + +from PyQt4.QtTest import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtWebKit.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtWebKit.py new file mode 100644 index 000000000..bffc79968 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtWebKit.py @@ -0,0 +1,2 @@ + +from PyQt4.QtWebKit import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtXml.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtXml.py new file mode 100644 index 000000000..2888a4e49 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtXml.py @@ -0,0 +1,2 @@ + +from PyQt4.QtXml import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/QtXmlPatterns.py b/sources/pyside2/tests/util/module_wrapper/PySide/QtXmlPatterns.py new file mode 100644 index 000000000..6de76d830 --- /dev/null +++ b/sources/pyside2/tests/util/module_wrapper/PySide/QtXmlPatterns.py @@ -0,0 +1,2 @@ + +from PyQt4.QtXmlPatterns import * diff --git a/sources/pyside2/tests/util/module_wrapper/PySide/__init__.py b/sources/pyside2/tests/util/module_wrapper/PySide/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/sources/pyside2/tests/util/processtimer.py b/sources/pyside2/tests/util/processtimer.py new file mode 100644 index 000000000..19206472e --- /dev/null +++ b/sources/pyside2/tests/util/processtimer.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import time,os + +class TimeoutException(Exception): + def __init__(self, msg): + self.msg = msg + + def __str__(self): + return repr(self.msg) + +class ProcessTimer(object): + '''Timeout function for controlling a subprocess.Popen instance. + + Naive implementation using busy loop, see later other means + of doing this. + ''' + + def __init__(self, proc, timeout): + self.proc = proc + self.timeout = timeout + + def waitfor(self): + time_passed = 0 + while(self.proc.poll() is None and time_passed < self.timeout): + time_passed = time_passed + 1 + time.sleep(1) + + if time_passed >= self.timeout: + raise TimeoutException("Timeout expired, possible deadlock") + +if __name__ == "__main__": + #simple example + + from subprocess import Popen + + proc = Popen(['sleep','10']) + t = ProcessTimer(proc,5) + try: + t.waitfor() + except TimeoutException: + print "timeout - PID: %d" % (t.proc.pid) + #TODO: detect SO and kill accordingly + #Linux + os.kill(t.proc.pid, 9) + #Windows (not tested) + #subprocess.Popen("taskkill /F /T /PID %i"%handle.pid , shell=True) + print "exit code: %d" % (t.proc.poll()) + diff --git a/sources/pyside2/tests/util/py2xfunctions.py b/sources/pyside2/tests/util/py2xfunctions.py new file mode 100644 index 000000000..d848c2c61 --- /dev/null +++ b/sources/pyside2/tests/util/py2xfunctions.py @@ -0,0 +1,46 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +def b(s): + return s + +def l(n): + return long(n) + +def unicode_(s): + if type(s) == str: + import codecs + c = codecs.lookup('utf-8') + s2 = c.decode(s, 'ignore') + return s2[0] + return u'%s' % s + +unicode = unicode +unichr = unichr +long = long +buffer = buffer diff --git a/sources/pyside2/tests/util/py3kcompat.py b/sources/pyside2/tests/util/py3kcompat.py new file mode 100644 index 000000000..19e50dc71 --- /dev/null +++ b/sources/pyside2/tests/util/py3kcompat.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys + +IS_PY3K = sys.version_info[0] == 3 + +if IS_PY3K: + from py3xfunctions import b, l, unicode_, unicode, unichr, long, unichr, buffer +else: + from py2xfunctions import b, l, unicode_, unicode, unichr, long, unichr, buffer + diff --git a/sources/pyside2/tests/util/py3xfunctions.py b/sources/pyside2/tests/util/py3xfunctions.py new file mode 100644 index 000000000..e7014e56a --- /dev/null +++ b/sources/pyside2/tests/util/py3xfunctions.py @@ -0,0 +1,54 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +def b(s): + if type(s) == bytes: + return s + return bytes(s, "UTF8") + +def buffer_(s): + if s == None: + return None + elif type(s) == str: + return bytes(s, "UTF8") + elif type(s) == bytes: + return s + else: + memoryview(s) + +def l(n): + return n + +def unicode_(s): + return s + +unicode = str +unichr = chr +long = int +unichr = chr +buffer = buffer_ diff --git a/sources/pyside2/tests/util/pyqt_diff.py b/sources/pyside2/tests/util/pyqt_diff.py new file mode 100644 index 000000000..04e873556 --- /dev/null +++ b/sources/pyside2/tests/util/pyqt_diff.py @@ -0,0 +1,64 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import print_function + +'''Script to show the difference between PyQt5 and ours''' + +import sys + +from color import print_colored + +def check_module_diff(module_name): + '''Difference between PySide2 and PyQt5 versions of qt bindings. + Returns a tuple with the members present only on PySide2 and only on PyQt5''' + shiboken_module = getattr(__import__('PySide2.' + module_name), module_name) + orig_module = getattr(__import__('PyQt5.' + module_name), module_name) + + shiboken_set = set(dir(shiboken_module)) + orig_set = set(dir(orig_module)) + + return sorted(shiboken_set - orig_set), sorted(orig_set - shiboken_set) + + +def main(argv=None): + if argv is None: + argv = sys.argv + + module_name = argv[1] if len(argv) >= 2 else 'QtCore' + + only_shiboken, only_orig = check_module_diff(module_name) + + print_colored('Only on Shiboken version') + print(only_shiboken) + + print_colored('Only on SIP version') + print(only_orig) + +if __name__ == '__main__': + main() diff --git a/sources/pyside2/tests/util/pyqtcheck.py b/sources/pyside2/tests/util/pyqtcheck.py new file mode 100644 index 000000000..7734ea6a7 --- /dev/null +++ b/sources/pyside2/tests/util/pyqtcheck.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import sys +from optparse import OptionParser + +import PyQt4 +from PyQt4 import QtCore, QtGui, QtNetwork + +modules = [QtCore, QtGui, QtNetwork] + +def search(klass, method=None): + for module in modules: + try: + klass_obj = getattr(module, klass) + print "%s *found* on module %s" % (klass, module.__name__) + except AttributeError: + print "%s not found on module %s" % (klass, module.__name__) + continue + + if method is None: + continue + + try: + meth_obj = getattr(klass_obj, method) + + meth_name = ".".join([klass, method]) + klass_name = ".".join([module.__name__, klass]) + print "\"%s\" *found* on class %s" % (meth_name, klass_name) + except AttributeError: + print "\"%s\" not found on class %s" % (method, klass) + + +def main(argv=None): + if argv is None: + argv = sys.argv[1:] + + try: + klass, method = argv[0].split(".") + except: + klass = argv[0] + method = None + + search(klass, method) + +if __name__ == '__main__': + main() diff --git a/sources/pyside2/tests/util/rename_imports.sh b/sources/pyside2/tests/util/rename_imports.sh new file mode 100755 index 000000000..e985a9100 --- /dev/null +++ b/sources/pyside2/tests/util/rename_imports.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +# Rename import statements from .py script to use a specific module name +set -e + +if [ $# -lt 3 ]; then + echo "Usage: $0 " + exit 1 +fi + +old_name=$1; shift +new_name=$1; shift + +find "$@" -name "*.py" -exec sed -ri "s/(import|from) $old_name/\1 $new_name/" '{}' \; diff --git a/sources/pyside2/tests/util/test_processtimer.py b/sources/pyside2/tests/util/test_processtimer.py new file mode 100644 index 000000000..66a2a57db --- /dev/null +++ b/sources/pyside2/tests/util/test_processtimer.py @@ -0,0 +1,93 @@ +############################################################################# +## +## Copyright (C) 2016 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +'Tests for processtimer.py' + +import unittest +import os + +from subprocess import Popen, PIPE +from processtimer import TimeoutException, ProcessTimer + +class TimeoutTest(unittest.TestCase): + + def tearDown(self): + try: + os.kill(self.proc.pid, 9) + except OSError: + pass + + def testRaise(self): + self.proc = Popen(['python2.5', '-c', 'while True: pass' ], stdout=PIPE, stderr=PIPE) + timer = ProcessTimer(self.proc, 1) + self.assertRaises(TimeoutException, timer.waitfor) + +class SimpleTest(unittest.TestCase): + + def tearDown(self): + try: + os.kill(self.proc.pid, 9) + except OSError: + pass + def testSimple(self): + self.proc = Popen(['python2.5', '-c', '"print"'], stdout=PIPE, stderr=PIPE) + timer = ProcessTimer(self.proc, 10) + timer.waitfor() + +class TestEchoOutput(unittest.TestCase): + + def tearDown(self): + try: + os.kill(self.proc.pid, 9) + except OSError: + pass + + def testOutput(self): + self.proc = Popen(['python2.5', '-c', 'print 1',], stdout=PIPE, stderr=PIPE) + timer = ProcessTimer(self.proc, 1) + timer.waitfor() + self.assertEqual(self.proc.stdout.read().strip(), '1') + +class TestRetCode(unittest.TestCase): + + def tearDown(self): + try: + os.kill(self.proc.pid, 9) + except OSError: + pass + + def testSimple(self): + self.proc = Popen(['python2.5', '-c', 'print 1'], stdout=PIPE, stderr=PIPE) + timer = ProcessTimer(self.proc, 10) + timer.waitfor() + + self.assertEqual(self.proc.poll(), 0) + + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/util/use_pyqt4.sh b/sources/pyside2/tests/util/use_pyqt4.sh new file mode 100644 index 000000000..5b88fa5c7 --- /dev/null +++ b/sources/pyside2/tests/util/use_pyqt4.sh @@ -0,0 +1,3 @@ + +OLD_PYTHONPATH=$PYTHONPATH +PYTHONPATH=`pwd`/util/module_wrapper:$PYTHONPATH diff --git a/sources/pyside2/tests/util/use_pyside.sh b/sources/pyside2/tests/util/use_pyside.sh new file mode 100644 index 000000000..516207473 --- /dev/null +++ b/sources/pyside2/tests/util/use_pyside.sh @@ -0,0 +1,3 @@ + +PYTHONPATH=$OLD_PYTHONPATH +unset OLD_PYTHONPATH diff --git a/sources/pyside2/tests/util/valgrind-python.supp b/sources/pyside2/tests/util/valgrind-python.supp new file mode 100644 index 000000000..a54b451b3 --- /dev/null +++ b/sources/pyside2/tests/util/valgrind-python.supp @@ -0,0 +1,349 @@ +# +# This is a valgrind suppression file that should be used when using valgrind. +# +# Here's an example of running valgrind: +# +# cd python/dist/src +# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \ +# ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network +# +# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER +# to use the preferred suppressions with Py_ADDRESS_IN_RANGE. +# +# If you do not want to recompile Python, you can uncomment +# suppressions for PyObject_Free and PyObject_Realloc. +# +# See Misc/README.valgrind for more information. + +# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64) + Memcheck:Value8 + fun:Py_ADDRESS_IN_RANGE +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:Py_ADDRESS_IN_RANGE +} + +# +# Leaks (including possible leaks) +# Hmmm, I wonder if this masks some real leaks. I think it does. +# Will need to fix that. +# + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:realloc + fun:_PyObject_GC_Resize + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_New + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +{ + Handle PyMalloc confusing valgrind (possibly leaked) + Memcheck:Leak + fun:malloc + fun:_PyObject_GC_NewVar + fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING +} + +# +# Non-python specific leaks +# + +{ + Handle pthread issue (possibly leaked) + Memcheck:Leak + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls_storage + fun:_dl_allocate_tls +} + +{ + Handle pthread issue (possibly leaked) + Memcheck:Leak + fun:memalign + fun:_dl_allocate_tls_storage + fun:_dl_allocate_tls +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:PyObject_Free +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Addr4 + fun:PyObject_Realloc +} + +{ + ADDRESS_IN_RANGE/Invalid read of size 4 + Memcheck:Value4 + fun:PyObject_Realloc +} + +{ + ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value + Memcheck:Cond + fun:PyObject_Realloc +} + +### +### All the suppressions below are for errors that occur within libraries +### that Python uses. The problems to not appear to be related to Python's +### use of the libraries. +### + +{ + Generic gentoo ld problems + Memcheck:Cond + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so + obj:/lib/ld-2.3.4.so +} + +{ + DBM problems, see test_dbm + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_close +} + +{ + DBM problems, see test_dbm + Memcheck:Value8 + fun:memmove + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + DBM problems, see test_dbm + Memcheck:Cond + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + DBM problems, see test_dbm + Memcheck:Cond + fun:memmove + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + obj:/usr/lib/libdb1.so.2 + fun:dbm_store + fun:dbm_ass_sub +} + +{ + GDBM problems, see test_gdbm + Memcheck:Param + write(buf) + fun:write + fun:gdbm_open + +} + +{ + ZLIB problems, see test_gzip + Memcheck:Cond + obj:/lib/libz.so.1.2.3 + obj:/lib/libz.so.1.2.3 + fun:deflate +} + +{ + Avoid problems w/readline doing a putenv and leaking on exit + Memcheck:Leak + fun:malloc + fun:xmalloc + fun:sh_set_lines_and_columns + fun:_rl_get_screen_size + fun:_rl_init_terminal_io + obj:/lib/libreadline.so.4.3 + fun:rl_initialize +} + +### +### These occur from somewhere within the SSL, when running +### test_socket_sll. They are too general to leave on by default. +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:memset +###} +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:memset +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Cond +### fun:MD5_Update +###} +### +###{ +### somewhere in SSL stuff +### Memcheck:Value4 +### fun:MD5_Update +###} + +# +# All of these problems come from using test_socket_ssl +# +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_bin2bn +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_num_bits_word +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:BN_num_bits_word +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont_word +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BN_mod_exp_mont +} + +{ + from test_socket_ssl + Memcheck:Param + write(buf) + fun:write + obj:/usr/lib/libcrypto.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:RSA_verify +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:RSA_verify +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_set_key_unchecked +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:DES_encrypt2 +} + +{ + from test_socket_ssl + Memcheck:Cond + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Value4 + obj:/usr/lib/libssl.so.0.9.7 +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:BUF_MEM_grow_clean +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:memcpy + fun:ssl3_read_bytes +} + +{ + from test_socket_ssl + Memcheck:Cond + fun:SHA1_Update +} + +{ + from test_socket_ssl + Memcheck:Value4 + fun:SHA1_Update +} + + -- cgit v1.2.3