summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmenu
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-16 15:29:34 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-16 15:45:28 (GMT)
commitdc2cb80ceb35edd958685189e9075ac1061870f4 (patch)
tree705c27d553caaad06396d2c75cadfcbfcac6ddd6 /tests/auto/qmenu
parent9da9339e4ced8d8c54a4585d3e94cbe6a2d9c574 (diff)
downloadQt-dc2cb80ceb35edd958685189e9075ac1061870f4.zip
Qt-dc2cb80ceb35edd958685189e9075ac1061870f4.tar.gz
Qt-dc2cb80ceb35edd958685189e9075ac1061870f4.tar.bz2
QMenu: do not crash if action is destroyed in the triggered signal.
Task-number: QTBUG-4480 Reviewed-by: Thierry
Diffstat (limited to 'tests/auto/qmenu')
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index f12fa92..f0f69a4 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -101,11 +101,13 @@ private slots:
void menuSizeHint();
void task258920_mouseBorder();
void setFixedWidth();
+ void deleteActionInTriggered();
protected slots:
void onActivated(QAction*);
void onHighlighted(QAction*);
void onStatusMessageChanged(const QString &);
void onStatusTipTimer();
+ void deleteAction(QAction *a) { delete a; }
private:
void createActions();
QMenu *menus[2], *lastMenu;
@@ -858,6 +860,17 @@ void tst_QMenu::setFixedWidth()
QCOMPARE(menu.sizeHint().width(), menu.minimumWidth());
}
+void tst_QMenu::deleteActionInTriggered()
+{
+ // should not crash
+ QMenu m;
+ QObject::connect(&m, SIGNAL(triggered(QAction*)), this, SLOT(deleteAction(QAction*)));
+ QWeakPointer<QAction> a = m.addAction("action");
+ a.data()->trigger();
+ QVERIFY(!a);
+}
+
+
QTEST_MAIN(tst_QMenu)
ogmsg'> Bug fix. Description: Test failed when core and multi VFD is used. SOlution: Failure was because the test file was created with the specified VFD access property but later reopened by default access. That won't work for VFDs such as multi that produced files that are incompatible with the default sec2 file driver. Fixed it by using the same VFD access property when it reopens the same test file. However, it still fails for the core VFD which does not create any real file. It is meaningless to try to reopen its file. Fixed it by adding core to the incompatible list of VFDs so that it would skip the test. Split is already coded as incompatible VFD but I don't understand why it is incompatible in this case. Removed it from the incompatible list. Tested Platforms: Copper in which the daily test failed. * [svn-r13058] Description:Quincey Koziol2006-12-138-89/+74 | | | | | | | | | | | Clean up some shared message operations and other minor tweaks, in the process of trying to solve the messy way that shared object header messages are implemented in general (not James' work - which is fine :-) Tested on: Mac OS X/32 10.4.8 (amazon) FreeBSD/32 4.11 (sleipnir) AIX/32 5.? (copper) * [svn-r13057] Added a copy_file callback for datatype messages. This sets ↵James Laird2006-12-121-1/+45 | | | | | | | | | their location in the destination file, fixing a bug in the (not yet checked-in) shared message copying changes. Tested on kagiso, smirom, copper, and Windows. * [svn-r13056] Description:Quincey Koziol2006-12-128-76/+244 | | | | | | | | | | | | | | Add H5SM_type_shared() internal routine to determine if a particular type of header message is sharable in a file. Correct off-by-one error in computing B-tree record size for densely stored attributes' name index. Further progress toward supporting shared attributes in dense storage. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) * [svn-r13055] update library and DLL project files on windows.MuQun Yang2006-12-122-0/+120 | | | | All C tests get passed with VS6.0. * [svn-r13052] Fixed a bug that occured while eliminating "gaps" in object ↵James Laird2006-12-121-0/+7 | | | | | | | | headers when the gap came immediately before a null message. Tested on smirom, kagiso, and copper. * [svn-r13051] Description:Quincey Koziol2006-12-123-45/+29 | | | | | | | | Minor code neatening, before making snapshot... Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) * [svn-r13050] Purpose: Code cleanupBinh-Minh Ribler2006-12-121-15/+15 | | | | | | | | | | Description: Fixed several mismatched types causing daily test to fail on tg-login. Platforms tested: Linux 2.6 (kagiso) - just to make sure no ill effects. I cannot login to tg-login3 so am going to watch for it on daily test tonight. * [svn-r13048] Description:Quincey Koziol2006-12-122-41/+78 | | | | | | | | | | | | Set up tests for next phase of testing dense attribute operations, with shared attributes. Other minor code cleanups... Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) * [svn-r13047] Description:Quincey Koziol2006-12-128-78/+232 | | | | | | | | | | | | | | Add "attribute exists" internal routine to make verifying that an attribute with the same name doesn't already exist easier. Tweak "trace" script to produce more whitespace in H5TRACE macros, in order to make them easier to read. Minor other whitespace cleanups Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) * [svn-r13046] Description:Quincey Koziol2006-12-122-64/+62 | | | | | | | | Minor editing & code cleanups. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) * [svn-r13045] Description:Quincey Koziol2006-12-1231-477/+1231 | | | | | | | | | | | | | | Switch from using H5L_index_t/H5L_INDEX_<foo> to H5_index_t/H5_INDEX_<foo> in order to accommodate indices on aspects of attributes as well as links. Add basic support for deleting attributes in dense storage (needs more support/tests for shared attributes in dense storage still). Misc. cleanups, etc. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) * [svn-r13044] Updated for the new SVN server location.HDF Tester2006-12-111-1/+1 | * [svn-r13042] Pedro Vicente Nunes2006-12-1121-196/+373 | | | | | added a size of array information when printing differences modified print_pos and diff_datum for having one extra argument *dims * [svn-r13041] Description:Quincey Koziol2006-12-1112-708/+1235 | | | | | | | | | | | Migrate "internalish" attribute operations into new source code file. Add test & basic support for opening attributes in dense storage (shared attributes not tested or supported yet). Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) * [svn-r13039] Purpose: Add testBinh-Minh Ribler2006-12-111-0/+55 | | | | | | | | | | Description: Added test_string_attr to partially test recent fix of Attribute::read. Platforms tested: AIX 5.1 (copper) Linux 2.6 (kagiso) SunOS 5.8 64-bit (sol) * [svn-r13038] Purpose: Fixed user reported bugBinh-Minh Ribler2006-12-112-6/+12 | | | | | | | | | | | | | | | Description: In Attribute::read, H5Aread malloc's memory for the read data buffer, so Attribute::read shouldn't allocate the buffer, but needs to deallocate with HDfree. Fixed a typo in H5StrType.cpp, should pass PredType::C_S1 to "copy" instead of H5T_C_S1. Platforms tested: AIX 5.1 (copper) Linux 2.6 (kagiso) SunOS 5.8 64-bit (sol) * [svn-r13037] Description:Quincey Koziol2006-12-085-120/+209 | | | | | | | Move attribute creation code out of H5Omessage.c and into H5Oattr.c Tested on: FreeBSD/32 4.11 (sleipnir) * [svn-r13036] Description:Elena Pourmal2006-12-081-4/+4 | | | | | | | VMS maintenance: brought command file up-to-date. Platforms tested: VMS server at Boeing * [svn-r13035] Fixed a small problem in Line 782 - buf[6] should be set to 0, too.Raymond Lu2006-12-081-0/+1 | * [svn-r13034] Description:Quincey Koziol2006-12-087-18/+29 | | | | | | | | Take out separate memory type in the file for SOHM objects and create aliases for existing memory types for SOHM use. Tested on: FreeBSD/32 4.11 (sleipnir) * [svn-r13033] Pedro Vicente Nunes2006-12-072-13/+18 | | | | avoid usage to call exit(1), it makes processes to stop in parallel. * [svn-r13032] Pedro Vicente Nunes2006-12-072-119/+122 | | | | introduced a new macro PDIFF to calculate differences for unsigned types * [svn-r13031] Pedro Vicente Nunes2006-12-071-1576/+1575 | | | | introduced more ABS macro use * [svn-r13030] Pedro Vicente Nunes2006-12-071-8/+6 | | | | | | warnings clean ../../../hdf5/tools/h5repack/h5repack_opttable.c:240: warning: passing arg 2 of `aux_tblinsert_layout' as signed due to prototype * [svn-r13029] Pedro Vicente Nunes2006-12-071-7/+7 | | | | | | | | warnings clean ../../../hdf5/tools/h5repack/h5repack_copy.c:615: warning: passing arg 3 of `print_dataset_info' as `float' rather than `double' due to prototype introduced double precision arithmetic * [svn-r13028] Description:Quincey Koziol2006-12-06