summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Kolewa <sascha.kolewa@nokia.com>2011-01-10 17:37:48 +0100
committerSascha Kolewa <sascha.kolewa@nokia.com>2011-01-10 17:37:48 +0100
commit9f2cce2415d1f75565cc5ceff521dc46653ed34a (patch)
tree565a43b99c049afcad879ebab0914f87fbaeac79
parent924c935e8bb56e07eb95c77a3ac28cd6a9d04619 (diff)
Added try catch around JSON.stringify
avoids stopped tests due to exceptions in formatting
-rw-r--r--src/imports/testlib/TestCase.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index ccaad8f..d696f84 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -260,7 +260,11 @@ Item {
return "Qt.vector3d(" + value.x + ", " +
value.y + ", " + value.z + ")"
}
- return JSON.stringify(value)
+ try {
+ return JSON.stringify(value)
+ } catch (ex) {
+ // stringify might fail (e.g. due to circular references)
+ }
}
return value
}