aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlconsole/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlconsole/data')
-rw-r--r--tests/auto/qml/qqmlconsole/data/assert.qml13
-rw-r--r--tests/auto/qml/qqmlconsole/data/categorized_logging.qml9
-rw-r--r--tests/auto/qml/qqmlconsole/data/exception.qml4
-rw-r--r--tests/auto/qml/qqmlconsole/data/logging.qml21
4 files changed, 26 insertions, 21 deletions
diff --git a/tests/auto/qml/qqmlconsole/data/assert.qml b/tests/auto/qml/qqmlconsole/data/assert.qml
index dd580e2a72..9687437c48 100644
--- a/tests/auto/qml/qqmlconsole/data/assert.qml
+++ b/tests/auto/qml/qqmlconsole/data/assert.qml
@@ -29,21 +29,22 @@
import QtQuick 2.0
QtObject {
- property int q:1
+ property int q: 1
+
function assertFail() {
- console.assert(0, "This will fail too")
+ console.assert(0, "This will fail too");
}
Component.onCompleted: {
- var x = 12;
+ const x = 12;
console.assert(x == 12, "This will pass");
try {
- console.assert(x < 12, "This will fail");
+ console.assert(x < 12, "This will fail");
} catch (e) {
console.log(e);
}
- console.assert("x < 12", "This will pass too")
+ console.assert("x < 12", "This will pass too");
assertFail();
- console.assert(1)
+ console.assert(1);
}
}
diff --git a/tests/auto/qml/qqmlconsole/data/categorized_logging.qml b/tests/auto/qml/qqmlconsole/data/categorized_logging.qml
index d593f0dfa1..6d471e7f80 100644
--- a/tests/auto/qml/qqmlconsole/data/categorized_logging.qml
+++ b/tests/auto/qml/qqmlconsole/data/categorized_logging.qml
@@ -40,7 +40,7 @@
import QtQuick 2.12
Item {
- id:root
+ id: root
LoggingCategory {
id: testCategory
@@ -69,8 +69,11 @@ Item {
console.warn(testCategoryStartingFromWarning, "console.warn");
console.error(testCategoryStartingFromWarning, "console.error");
- testCategory.name = "qt.test2";
- testCategory.defaultLogLevel = LoggingCategory.Debug;
+ testCategory.name = "qt.test"; // should be silent
+ testCategoryStartingFromWarning.name = "qt.test.other"; // should issue a warning
+
+ testCategory.defaultLogLevel = LoggingCategory.Debug; // should be silent
+ testCategoryStartingFromWarning.defaultLogLevel = LoggingCategory.Debug; // should issue a warning
console.error(emptyCategory, "console.error");
}
diff --git a/tests/auto/qml/qqmlconsole/data/exception.qml b/tests/auto/qml/qqmlconsole/data/exception.qml
index 63afd18828..b9b83525e8 100644
--- a/tests/auto/qml/qqmlconsole/data/exception.qml
+++ b/tests/auto/qml/qqmlconsole/data/exception.qml
@@ -30,12 +30,12 @@ import QtQuick 2.0
QtObject {
function exceptionFail() {
- console.exception("Exception 2")
+ console.exception("Exception 2");
}
Component.onCompleted: {
try {
- console.exception("Exception 1")
+ console.exception("Exception 1");
} catch (e) {
console.log(e);
}
diff --git a/tests/auto/qml/qqmlconsole/data/logging.qml b/tests/auto/qml/qqmlconsole/data/logging.qml
index f5eaeb442a..ac3884bc8e 100644
--- a/tests/auto/qml/qqmlconsole/data/logging.qml
+++ b/tests/auto/qml/qqmlconsole/data/logging.qml
@@ -30,7 +30,8 @@
import QtQuick 2.0
QtObject {
- id:root
+ id: root
+
required property var customObject
required property var stringListProperty
@@ -49,14 +50,14 @@ QtObject {
consoleCount();
consoleCount();
- var a = [1, 2];
- var b = {a: "hello", d: 1 };
- b.toString = function() { return JSON.stringify(b) }
- var c
- var d = 12;
- var e = function() { return 5;};
- var f = true;
- var g = {toString: function() { throw new Error('toString'); }};
+ const a = [1, 2];
+ const b = { a: "hello", d: 1 };
+ b.toString = function() { return JSON.stringify(b); }
+ let c;
+ const d = 12;
+ const e = function() { return 5; };
+ const f = true;
+ const g = { toString: function() { throw new Error('toString'); } };
console.log(a);
console.log(b);
@@ -79,6 +80,6 @@ QtObject {
return;
}
- throw ("console.log(exception) should have raised an exception");
+ throw "console.log(exception) should have raised an exception";
}
}