diff options
author | andreask <andreask> | 2013-01-22 19:30:43 (GMT) |
---|---|---|
committer | andreask <andreask> | 2013-01-22 19:30:43 (GMT) |
commit | 48c9fcb7281cc6aa076113db874c7ae0e105795d (patch) | |
tree | 7187940ff056462bfa41705a2ce04d0ed07d424e /tests/unixMenu.test | |
parent | 41f5d19540b0b3f053da352e1569c9a4ed019dd5 (diff) | |
download | tk-contrib_patrick_fradin_code_cleanup.zip tk-contrib_patrick_fradin_code_cleanup.tar.gz tk-contrib_patrick_fradin_code_cleanup.tar.bz2 |
Contribution by Patrick Fradin <patrick.fradin@planar.com>contrib_patrick_fradin_code_cleanup
Quoting his mail:
<pre>
==========================================================
Hi Jeff,
I spent some of my time to contribute to the TclTk community ! I'm in
late for Christmas gift but like we said in French : "Mieux vaut tard
que jamais". ;-)
I've use TclDevKit 5.3.0 tclchecker to analyse TclTk code in Tcl and
Tk library directories (library, tools and tests) to correct a lot of
warnings and few errors. (encapsulate some expr, use 'chan xxx'
instead of fconfigure, fileevent...)
I've made some improvements too :
Examples :
- Use 'lassign' instead of many 'lindex' of 'foreach/break' loop.
- Use 'in' or 'ni' operators instead of 'lsearch -exact' or to
factorise some eq/ne && / || tests.
- Use 'eq' or 'ne' to tests strings instead of '==' or '!='.
- Use 'unset -nocomplain' to avoid 'catch {unset...}'.
- Remove some useless catch around 'destroy' calls.
- Use expand {*} instead of 'eval'. Don't touch a lot of code because
I don't know all structs and lists. I think it could be a greater
improvement to reduce 'eval' calls.
Due to previous experience, I dot not change any indentation ! ;-)
==========================================================
</pre>
Diffstat (limited to 'tests/unixMenu.test')
-rw-r--r-- | tests/unixMenu.test | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/unixMenu.test b/tests/unixMenu.test index 3d655e4..1b43a9f 100644 --- a/tests/unixMenu.test +++ b/tests/unixMenu.test @@ -12,7 +12,6 @@ namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands - test unixMenu-1.1 {TkpNewMenu - normal menu} -constraints unix -setup { destroy .m1 } -body { @@ -27,13 +26,10 @@ test unixMenu-1.2 {TkpNewMenu - help menu} -constraints unix -setup { list [menu .m1.help] [. configure -menu ""] [destroy .m1] } -returnCodes ok -result {.m1.help {} {}} - test unixMenu-2.1 {TkpDestroyMenu - nothing to do} -constraints unix -body {} - test unixMenu-3.1 {TkpDestroymenuEntry - nothing to do} -constraints unix -body {} - test unixMenu-4.1 {TkpConfigureMenuEntry - non-cascade entry} -constraints { unix } -setup { @@ -54,10 +50,8 @@ test unixMenu-4.2 {TkpConfigureMenuEntry - cascade entry} -constraints { list [.m1 entryconfigure test -menu .m1.foo] [destroy .m1] } -returnCodes ok -result {{} {}} - test unixMenu-5.1 {TkpMenuNewEntry - nothing to do} -constraints unix -body {} - test unixMenu-6.1 {TkpSetWindowMenuBar - null menu} -constraints unix -setup { destroy .m1 } -body { @@ -74,10 +68,8 @@ test unixMenu-6.2 {TkpSetWindowMenuBar - menu} -constraints unix -setup { list [. configure -menu .m1] [. configure -menu ""] [destroy .m1] } -returnCodes ok -result {{} {} {}} - test unixMenu-7.1 {TkpSetMainMenubar - nothing to do} -constraints unix -body {} - test unixMenu-8.1 {GetMenuIndicatorGeometry - indicator off} -constraints { unix } -setup { @@ -183,7 +175,6 @@ test unixMenu-8.9 {GetMenuIndicatorGeometry - hideMargin} -constraints { destroy .m1 } -returnCodes ok - test unixMenu-9.1 {GetMenuAccelGeometry - cascade entry} -constraints { unix } -setup { @@ -213,7 +204,6 @@ test unixMenu-9.3 {GetMenuAccelGeometry - null label} -constraints unix -setup { destroy .m1 } -returnCodes ok - test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} -constraints { unix } -setup { @@ -245,7 +235,6 @@ test unixMenu-10.3 {DrawMenuEntryBackground - non-active} -constraints { list [update] [destroy .m1] } -returnCodes ok -result {{} {}} - test unixMenu-11.1 {DrawMenuEntryAccelerator - menubar} -constraints { unix } -setup { @@ -288,7 +277,6 @@ test unixMenu-11.4 {DrawMenuEntryAccelerator - null entry} -constraints { list [update] [destroy .m1] } -result {{} {}} - test unixMenu-12.1 {DrawMenuEntryIndicator - non-check or radio} -constraints { unix } -setup { @@ -362,7 +350,6 @@ test unixMenu-12.7 {DrawMenuEntryIndicator - radiobutton - selected} -constraint list [update] [destroy .m1] } -result {{} {}} - test unixMenu-13.1 {DrawMenuSeparator - menubar case} -constraints unix -setup { destroy .m1 } -body { @@ -380,7 +367,6 @@ test unixMenu-13.2 {DrawMenuSepartor - normal menu} -constraints unix -setup { list [update] [destroy .m1] } -result {{} {}} - test unixMenu-14.1 {DrawMenuEntryLabel} -constraints unix -setup { destroy .m1 } -body { @@ -390,7 +376,6 @@ test unixMenu-14.1 {DrawMenuEntryLabel} -constraints unix -setup { list [update] [destroy .m1] } -result {{} {}} - test unixMenu-15.1 {DrawMenuUnderline - menubar} -constraints unix -setup { destroy .m1 } -body { @@ -408,7 +393,6 @@ test unixMenu-15.2 {DrawMenuUnderline - no menubar} -constraints unix -setup { list [update] [destroy .m1] } -result {{} {}} - test unixMenu-16.1 {TkpPostMenu} -constraints unix -setup { destroy .m1 } -body { @@ -418,7 +402,6 @@ test unixMenu-16.1 {TkpPostMenu} -constraints unix -setup { destroy .m1 } -returnCodes ok - test unixMenu-17.1 {GetMenuSeparatorGeometry} -constraints unix -setup { destroy .m1 } -body { @@ -428,7 +411,6 @@ test unixMenu-17.1 {GetMenuSeparatorGeometry} -constraints unix -setup { destroy .m1 } -returnCodes ok - test unixMenu-18.1 {GetTearoffEntryGeometry} -constraints { unix nonUnixUserInteraction } -setup { @@ -733,7 +715,6 @@ test unixMenu-19.24 {TkpComputeMenubarGeometry - help item only one} -constraint list [update] [. configure -menu ""] [destroy .m1] } -result {{} {} {}} - test unixMenu-20.1 {DrawTearoffEntry - menubar} -constraints unix -setup { destroy .m1 } -body { @@ -753,10 +734,8 @@ test unixMenu-20.2 {DrawTearoffEntry - non-menubar} -constraints { list [update] [destroy .m1] } -result {{} {}} - test unixMenu-21.1 {TkpInitializeMenuBindings - nothing to do} -constraints unix -body {} - test unixMenu-22.1 {SetHelpMenu - no menubars} -constraints unix -setup { destroy .m1 } -body { @@ -799,7 +778,6 @@ test unixMenu-22.4 {SetHelpMenu - multiple menubars with same help menu} -constr list [menu .m1.help] [. configure -menu ""] [destroy .m1] [destroy .t2] } -result {.m1.help {} {} {}} - test unixMenu-23.1 {TkpDrawMenuEntry - gc for active and not strict motif} -constraints { unix } -setup { @@ -1022,7 +1000,6 @@ test unixMenu-23.22 {TkpDrawMenuEntry - hide margin} -constraints unix -setup { list [update] [destroy .m1] } -result {{} {}} - test unixMenu-24.1 {GetMenuLabelGeometry - image} -constraints { testImageType unix } -setup { @@ -1056,7 +1033,6 @@ test unixMenu-24.4 {GetMenuLabelGeometry - text} -constraints unix -setup { list [update idletasks] [destroy .m1] } -result {{} {}} - test unixMenu-25.1 {TkpComputeStandardMenuGeometry - no entries} -constraints { unix } -setup { @@ -1264,11 +1240,8 @@ test unixMenu-25.20 {TkpComputeStandardMenuGeometry - hide margin} -constraints list [update idletasks] [destroy .m1] } -result {{} {}} - test unixMenu-26.1 {TkpMenuInit - nothing to do} -constraints unix -body {} - - # cleanup deleteWindows cleanupTests |