<commit_before>import QtQuick 2.0
import QtQuick.Window 2.2
import QtTest 1.0
import QtQml.Models 2.1
import QuickIOS 0.1
import QuickIOS.utils 0.1


Rectangle {
    id: window
    height: 640 // For desktop
    width: 480
    visible: true


    TestCase {
        name : "NavigationBar"
        when : windowShown

        Component {
            id: navigationControllerLongTitleView
            NavigationController {
                id: navigationController
                property alias ruler : rulerItem

                anchors.fill: parent
                initialViewController: ViewController {
                    title : "_______________Example_______________"
                    navigationItem: NavigationItem {

                        leftBarButtonItems: ObjectModel {

                            BarButtonItem {
                                title: "Btn1"
                            }

                            BarButtonItem {
                                title: "Btn2"
                            }

                        }

                        rightBarButtonItems: ObjectModel {
                            BarButtonItem {
                                title : "Btn3"
                            }
                        }
                    }
                }

                Ruler {
                    id: rulerItem
//                    parent: navigationController.navigationBar.currentTitleItem.parent
                    orientation: Qt.Horizontal
//                    anchors.fill: navigationController.navigationBar.currentTitleItem
                }
            }
        }

        // The default title view may shrink the text if it is too long.
        function test_titleView_long() {
            var nc = navigationControllerLongTitleView.createObject(window);
            nc.ruler.parent = nc.navigationBar.currentTitleItem.parent
            nc.ruler.anchors.fill =  nc.navigationBar.currentTitleItem
            wait(500);
            compare(nc.ruler.width,265)
            compare(nc.navigationBar.currentTitleItem.paintedWidth * nc.navigationBar.currentTitleItem.scale  <= nc.ruler.width,true)
            wait(TestEnv.waitTime)
        }

    }

}<commit_msg>Fix broken test case<commit_after>import QtQuick 2.0
import QtQuick.Window 2.2
import QtTest 1.0
import QtQml.Models 2.1
import QuickIOS 0.1
import QuickIOS.utils 0.1


Rectangle {
    id: window
    height: 640 // For desktop
    width: 480
    visible: true


    TestCase {
        name : "NavigationBar"
        when : windowShown

        Component {
            id: navigationControllerLongTitleView
            NavigationController {
                id: navigationController
                property alias ruler : rulerItem

                anchors.fill: parent
                initialViewController: ViewController {
                    title : "_______________Example_______________"
                    navigationItem: NavigationItem {

                        leftBarButtonItems: ObjectModel {

                            BarButtonItem {
                                title: "Btn1"
                            }

                            BarButtonItem {
                                title: "Btn2"
                            }

                        }

                        rightBarButtonItems: ObjectModel {
                            BarButtonItem {
                                title : "Btn3"
                            }
                        }
                    }
                }

                Ruler {
                    id: rulerItem
//                    parent: navigationController.navigationBar.currentTitleItem.parent
                    orientation: Qt.Horizontal
//                    anchors.fill: navigationController.navigationBar.currentTitleItem
                }
            }
        }

        // The default title view may shrink the text if it is too long.
        function test_titleView_long() {
            var nc = navigationControllerLongTitleView.createObject(window);
            nc.ruler.parent = nc.navigationBar.currentTitleItem.parent
            nc.ruler.anchors.fill =  nc.navigationBar.currentTitleItem
            wait(500);
            compare(nc.ruler.width < 270) // Font size can be different in differnet system.
            compare(nc.navigationBar.currentTitleItem.paintedWidth * nc.navigationBar.currentTitleItem.scale  <= nc.ruler.width,true)
            wait(TestEnv.waitTime)
        }

    }

}
{'fraction_non_alphanumeric': 0.05878438331854481, 'fraction_numerical': 0.011978704525288377, 'mean_word_length': 1.1995121951219512, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5005175', 'n_tokens_mistral': 1108, 'n_tokens_neox': 981, 'n_words': 216}