diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-07-21 16:25:00 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-08-28 21:26:21 +0200 |
commit | 86ebe46f591d33dc76e2f764524c988dd72f4437 (patch) | |
tree | d111b4f65b0c93368951de0a04a73b12798be5d1 /tests/auto/corelib/kernel/qtranslator | |
parent | a144820ae775c630bc9aed40c35af3f93518187c (diff) |
Make QTranslator::load() insist that its return value be checked
Add Q_REQUIRED_RESULT to force callers to check the return; the
QTranslator object is unusable if load() fails.
Check the result in QTranslator's own test.
Task-number: QTBUG-85700
Change-Id: I07509c76470cc87626190670665cd3162bfb17e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qtranslator')
-rw-r--r-- | tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp index a2fb035557..1b159e8c9e 100644 --- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -284,7 +284,7 @@ void tst_QTranslator::dependencies() { // load QTranslator tor; - tor.load("dependencies_la"); + QVERIFY(tor.load("dependencies_la")); QVERIFY(!tor.isEmpty()); QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!")); |