Launcher crashes in console.warn() with Qt.Test import

Bug #1436088 reported by Tim Peeters
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Confirmed
Medium
Cris Dywan
ubuntu-ui-toolkit (Ubuntu RTM)
New
Undecided
Unassigned

Bug Description

Launching this app with launcher:

import QtQuick 2.4
import Ubuntu.Test 1.0

UbuntuTestCase {
    function test_something() {
        console.warn("hello");
    }
}

will dump core, like this:

tim@ubuntu:~/dev/ubuntu-ui-toolkit/m/35-tstHeaderActions/tests/unit/tst_components$ ../../launcher/launcher tst_header_sections.qml
ASSERT: "QTest::TestLoggers::loggerCount() != 0" in file qtestlog.cpp, line 274
Aborted (core dumped)

Note that you don't have to call console.warn() directly, but it may be called by changing a parameter for testing. The original test (tst_header_sections.qml) crashes because it has this function:

    function test_warn_when_too_many_sections() {
        ignoreWarning("It is not recommended or supported to use more than three sections in Page.head.sections.model.")
        page.head.sections.model = ["1", "2", "3", "4"];
    }

which crashes because PageHeadSections currently has this warning printed:

    onModelChanged: {
        if (model && model.length > 3) {
            console.warn("It is not recommended or supported to use more than three sections in Page.head.sections.model.");
        }
    }

Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
assignee: nobody → Christian Dywan (kalikiana)
importance: Undecided → Critical
summary: - Launcher crashes when console.warn() is called.
+ Launcher crashes in console.warn() with Qt.Test import
Revision history for this message
Tim Peeters (tpeeters) wrote :

when I have "when: windowShown" in the UbuntuTestCase, the crash does not seem to happen.

Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Critical → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.