diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2014-10-16 13:22:47 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@digia.com> | 2014-10-16 13:32:33 +0300 |
commit | a24d3628fceb70eb2cba2fa91883f5f3bfa55361 (patch) | |
tree | b9f8885b03d5653b4856be1b4fd12427d18cdb73 /tests/auto/qmltest/surface3d/tst_heightproxy.qml | |
parent | e69acebea5eae430dbf988f379cd26464930ee6b (diff) |
Test for QML proxies
Also added missing default values to some docs.
Task-number: QTRD-3368
Change-Id: I98940a80d6edfe60801c6b2606307b3ec3ab8c39
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
Diffstat (limited to 'tests/auto/qmltest/surface3d/tst_heightproxy.qml')
-rw-r--r-- | tests/auto/qmltest/surface3d/tst_heightproxy.qml | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/tests/auto/qmltest/surface3d/tst_heightproxy.qml b/tests/auto/qmltest/surface3d/tst_heightproxy.qml new file mode 100644 index 00000000..dc6938f8 --- /dev/null +++ b/tests/auto/qmltest/surface3d/tst_heightproxy.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtDataVisualization module. +** +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** +****************************************************************************/ + +import QtQuick 2.0 +import QtDataVisualization 1.2 +import QtTest 1.0 + +Item { + id: top + height: 150 + width: 150 + + HeightMapSurfaceDataProxy { + id: initial + } + + HeightMapSurfaceDataProxy { + id: initialized + heightMapFile: ":/customtexture.jpg" + maxXValue: 10.0 + maxZValue: 10.0 + minXValue: -10.0 + minZValue: -10.0 + } + + HeightMapSurfaceDataProxy { + id: change + } + + TestCase { + name: "HeightMapSurfaceDataProxy Initial" + + function test_initial() { + compare(initial.heightMapFile, "") + compare(initial.maxXValue, 10.0) + compare(initial.maxZValue, 10.0) + compare(initial.minXValue, 0) + compare(initial.minZValue, 0) + + compare(initial.columnCount, 0) + compare(initial.rowCount, 0) + verify(!initial.series) + + compare(initial.type, AbstractDataProxy.DataTypeSurface) + } + } + + TestCase { + name: "HeightMapSurfaceDataProxy Initialized" + + function test_initialized() { + compare(initialized.heightMapFile, ":/customtexture.jpg") + compare(initialized.maxXValue, 10.0) + compare(initialized.maxZValue, 10.0) + compare(initialized.minXValue, -10.0) + compare(initialized.minZValue, -10.0) + + compare(initialized.columnCount, 24) + compare(initialized.rowCount, 24) + } + } + + TestCase { + name: "HeightMapSurfaceDataProxy Change" + + function test_1_change() { + change.heightMapFile = ":/customtexture.jpg" + change.maxXValue = 10.0 + change.maxZValue = 10.0 + change.minXValue = -10.0 + change.minZValue = -10.0 + } + + function test_2_test_change() { + // This test has a dependency to the previous one due to asynchronous item model resolving + compare(change.heightMapFile, ":/customtexture.jpg") + compare(change.maxXValue, 10.0) + compare(change.maxZValue, 10.0) + compare(change.minXValue, -10.0) + compare(change.minZValue, -10.0) + + compare(change.columnCount, 24) + compare(change.rowCount, 24) + } + } +} |