Tk Source Code

View Ticket
Login
Ticket UUID: 119bb094afd86d9590394579e6ea272bc670954c
Title: wm-iconbitmap-1.4 and wm-iconbitmap-2.1 fail on macOS
Type: Bug Version: core-8-6-branch
Submitter: fvogel Created on: 2018-06-28 19:25:22
Subsystem: 86. Test Tools Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2025-01-01 12:03:27
Resolution: Fixed Closed By: fvogel
    Closed on: 2025-01-01 12:03:27
Description:

wm-iconbitmap-1.4 and wm-iconbitmap-2.1 fail on macOS

==== wm-iconbitmap-1.4 usage FAILED
==== Contents of test case:

    wm iconbitmap .t bad-bitmap

---- Test completed normally; Return code was: 0
---- Return code should have been one of: 1
==== wm-iconbitmap-1.4 FAILED


test wm-iconbitmap-2.1 {setting and reading values} -setup {
    set result {}
} -body {
    lappend result [wm iconbitmap .t]
    wm iconbitmap .t hourglass
    lappend result [wm iconbitmap .t]
    wm iconbitmap .t {}
    lappend result [wm iconbitmap .t]
} -result [list {} hourglass {}]

User Comments: fvogel added on 2025-01-01 12:03:27:

For the records, ticket [13ac26b35d] later addressed the cause of the test failure (instead of just constraining the tests to not run on macOS aqua, as was done in the rpesent ticket).


fvogel added on 2018-07-04 07:09:57:
Merged to core-8-6-branch and trunk.

fvogel added on 2018-06-28 19:56:02:

Looking at wm-iconbitmap-2.1 now, following the analysis below, it is clear that since WmSetAttribute(..., WMATT_TITLEPATH, ...) always returns TCL_OK, there is never a bitmap set on macOS.

As a consequence, this test is always false, there is never any name of a bitmap placed in the ObjResult of the interp and TCL_OK is simply returned with an empty result.

Conclusion: On macOS, test wm-iconbitmap-2.1 cannot succeed and should be constrained to Windows and Linux. This is [3691982a19].


fvogel added on 2018-06-28 19:43:48:

On macOS, looking at the relevant code, wm iconbitmap .t bad-bitmap first attempts to set the -titlepath attribute by calling WmSetAttribute with WMATT_TITLEPATH.

It's only when this call returns something else than TCL_OK that a bitmap with the provided name is searched for.

However the call to WmSetAttribute with WMATT_TITLEPATH always returns TCL_OK on macOS.

Conclusion: On macOS, whatever $garbage is given to wm iconbitmap .t $garbage, this incantation will never retrurn an error, and test wm-iconbitmap-1.4 cannot succeed.

The logical resulting action is that the test needs to be constrained to Windows or Linux. This is [4a310eb1cb].