QML_RUNTIME_TESTING should be disabled by default.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativeecmascript / data / stringArg.qml
1 import QtQuick 2.0
2
3 Item {
4     id: root
5     property bool returnValue: false
6
7     property string first
8     property string second
9     property string third
10     property string fourth
11     property string fifth
12     property string sixth
13     property string seventh
14     property string eighth
15     property string ninth
16
17     function success() {
18         var a = "Value is %1";
19         for (var ii = 0; ii < 10; ++ii) {
20             first = a.arg("string");
21             second = a.arg(1);
22             third = a.arg(true);
23             fourth = a.arg(3.345);
24             fifth = a.arg(undefined);
25             sixth = a.arg(null);
26             seventh = a.arg({"test":5});
27             eighth = a.arg({"test":5, "again":6});
28         }
29
30         if (first != "Value is string") returnValue = false;
31         if (second != "Value is 1") returnValue = false;
32         if (third != "Value is true") returnValue = false;
33         if (fourth != "Value is 3.345") returnValue = false;
34         if (fifth != "Value is undefined") returnValue = false;
35         if (sixth != "Value is null") returnValue = false;
36         if (seventh != "Value is [Object object]") returnValue = false;
37         if (eighth != "Value is [Object object]") returnValue = false;
38         returnValue = true;
39     }
40
41     function failure() {
42         returnValue = true;
43         var a = "Value is %1";
44         for (var ii = 0; ii < 10; ++ii) {
45             ninth = a.arg(1,2,3,4);
46         }
47         returnValue = false;
48     }
49 }