diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-10-06 16:03:35 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-10-09 12:36:08 +0000 |
commit | a00a5a151bb7e98ff81c7a47ab9db507cb348c6c (patch) | |
tree | fdec40f54a2202b3a97247d59e4644a920202ad7 | |
parent | 3f3359aff5a167b22fbec5836ffd8455fde1a14d (diff) | |
download | qtgraphicaleffects-a00a5a151bb7e98ff81c7a47ab9db507cb348c6c.tar.gz |
Test type of double properties
This allows us to sanity-check future changes. The newly added
checks are expected to fail until QTBUG-48625 is fixed.
Change-Id: I9d505ee83ce774a13334c9d2e3c03baea0862237
Task-number: QTBUG-48625
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | tests/auto/tst_qtgraphicaleffects.cpp | 59 |
1 files changed, 55 insertions, 4 deletions
diff --git a/tests/auto/tst_qtgraphicaleffects.cpp b/tests/auto/tst_qtgraphicaleffects.cpp index c676b9c..8c93f9c 100644 --- a/tests/auto/tst_qtgraphicaleffects.cpp +++ b/tests/auto/tst_qtgraphicaleffects.cpp @@ -128,7 +128,9 @@ void tst_qtgraphicaleffects::brightnessContrast() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("brightness").type(), QVariant::Double); QCOMPARE(obj->property("brightness").toDouble(), 0.0); + QCOMPARE(obj->property("contrast").type(), QVariant::Double); QCOMPARE(obj->property("contrast").toDouble(), 0.0); QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("cached").toBool(), false); @@ -153,8 +155,11 @@ void tst_qtgraphicaleffects::colorize() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("hue").type(), QVariant::Double); QCOMPARE(obj->property("hue").toDouble(), 0.0); + QCOMPARE(obj->property("saturation").type(), QVariant::Double); QCOMPARE(obj->property("saturation").toDouble(), 1.0); + QCOMPARE(obj->property("lightness").type(), QVariant::Double); QCOMPARE(obj->property("lightness").toDouble(), 0.0); QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("cached").toBool(), false); @@ -179,6 +184,7 @@ void tst_qtgraphicaleffects::fastBlur() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("radius").type(), QVariant::Double); QCOMPARE(obj->property("radius").toDouble(), 0.0); QCOMPARE(obj->property("transparentBorder").toBool(), false); QCOMPARE(obj->property("source").toInt(), 0); @@ -204,6 +210,7 @@ void tst_qtgraphicaleffects::desaturate() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("desaturation").type(), QVariant::Double); QCOMPARE(obj->property("desaturation").toDouble(), 0.0); QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("cached").toBool(), false); @@ -228,8 +235,11 @@ void tst_qtgraphicaleffects::hueSaturation() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("hue").type(), QVariant::Double); QCOMPARE(obj->property("hue").toDouble(), 0.0); + QCOMPARE(obj->property("saturation").type(), QVariant::Double); QCOMPARE(obj->property("saturation").toDouble(), 0.0); + QCOMPARE(obj->property("lightness").type(), QVariant::Double); QCOMPARE(obj->property("lightness").toDouble(), 0.0); QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("cached").toBool(), false); @@ -279,11 +289,16 @@ void tst_qtgraphicaleffects::radialGradient() // Default values QCOMPARE(obj->property("gradient").toInt(), 0); + QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); + QCOMPARE(obj->property("verticalOffset").type(), QVariant::Double); QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); + QCOMPARE(obj->property("horizontalRadius").type(), QVariant::Double); QCOMPARE(obj->property("horizontalRadius").toDouble(), 50.0); + QCOMPARE(obj->property("verticalRadius").type(), QVariant::Double); QCOMPARE(obj->property("verticalRadius").toDouble(), 50.0); QCOMPARE(obj->property("source").toInt(), 0); + QCOMPARE(obj->property("angle").type(), QVariant::Double); QCOMPARE(obj->property("angle").toDouble(), 0.0); QCOMPARE(obj->property("cached").toBool(), false); @@ -331,9 +346,12 @@ void tst_qtgraphicaleffects::rectangularGlow() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("spread").type(), QVariant::Double); QCOMPARE(obj->property("spread").toDouble(), 0.0); + QCOMPARE(obj->property("glowRadius").type(), QVariant::Double); QCOMPARE(obj->property("glowRadius").toDouble(), 0.0); QCOMPARE(obj->property("color").toString(), QString("#ffffff")); + QCOMPARE(obj->property("cornerRadius").type(), QVariant::Double); QCOMPARE(obj->property("cornerRadius").toDouble(), 0.0); QCOMPARE(obj->property("cached").toBool(), false); @@ -356,9 +374,12 @@ void tst_qtgraphicaleffects::conicalGradient() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("angle").type(), QVariant::Double); QCOMPARE(obj->property("angle").toDouble(), 0.0); QCOMPARE(obj->property("gradient").toInt(), 0); + QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); + QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("cached").toBool(), false); @@ -406,6 +427,7 @@ void tst_qtgraphicaleffects::gaussianBlur() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("radius").type(), QVariant::Double); QCOMPARE(obj->property("radius").toDouble(), 4.0); QCOMPARE(obj->property("samples").toInt(), 9); QCOMPARE(obj->property("transparentBorder").toBool(), false); @@ -435,20 +457,26 @@ void tst_qtgraphicaleffects::dropShadow() QVERIFY(obj != 0); // Default values + QEXPECT_FAIL("", "QTBUG-48625", Continue); + QCOMPARE(obj->property("radius").type(), QVariant::Double); QCOMPARE(obj->property("radius").toDouble(), 4.0); QCOMPARE(obj->property("samples").toInt(), 9); + QEXPECT_FAIL("", "QTBUG-48625", Continue); + QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); + QEXPECT_FAIL("", "QTBUG-48625", Continue); + QCOMPARE(obj->property("verticalOffset").type(), QVariant::Double); QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); QCOMPARE(obj->property("cached").toBool(), false); QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("color").toString(), QString("#000000")); + QCOMPARE(obj->property("spread").type(), QVariant::Double); QCOMPARE(obj->property("spread").toDouble(), 0.0); QCOMPARE(obj->property("transparentBorder").toBool(), true); delete obj; } - void tst_qtgraphicaleffects::innerShadow() { // Creation @@ -466,13 +494,17 @@ void tst_qtgraphicaleffects::innerShadow() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("radius").type(), QVariant::Double); QCOMPARE(obj->property("radius").toDouble(), 0.0); QCOMPARE(obj->property("samples").toInt(), 0); + QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); + QCOMPARE(obj->property("verticalOffset").type(), QVariant::Double); QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); QCOMPARE(obj->property("cached").toBool(), false); QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("color").toString(), QString("#000000")); + QCOMPARE(obj->property("spread").type(), QVariant::Double); QCOMPARE(obj->property("spread").toDouble(), 0.0); QCOMPARE(obj->property("fast").toBool(), false); @@ -497,6 +529,7 @@ void tst_qtgraphicaleffects::gammaAdjust() QVERIFY(obj != 0); // Default values + QCOMPARE(obj->property("gamma").type(), QVariant::Double); QCOMPARE(obj->property("gamma").toDouble(), 1.0); QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("cached").toBool(), false); @@ -525,7 +558,9 @@ void tst_qtgraphicaleffects::thresholdMask() QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("maskSource").toInt(), 0); QCOMPARE(obj->property("cached").toBool(), false); + QCOMPARE(obj->property("threshold").type(), QVariant::Double); QCOMPARE(obj->property("threshold").toDouble(), 0.0); + QCOMPARE(obj->property("spread").type(), QVariant::Double); QCOMPARE(obj->property("spread").toDouble(), 0.0); delete obj; @@ -548,9 +583,12 @@ void tst_qtgraphicaleffects::glow() QVERIFY(obj != 0); // Default values + QEXPECT_FAIL("", "QTBUG-48625", Continue); + QCOMPARE(obj->property("radius").type(), QVariant::Double); QCOMPARE(obj->property("radius").toDouble(), 4.0); QCOMPARE(obj->property("samples").toInt(), 9); QCOMPARE(obj->property("cached").toBool(), false); + QCOMPARE(obj->property("spread").type(), QVariant::Double); QCOMPARE(obj->property("spread").toDouble(), 0.5); QCOMPARE(obj->property("color").toString(), QString("#ffffff")); QCOMPARE(obj->property("transparentBorder").toBool(), true); @@ -605,6 +643,7 @@ void tst_qtgraphicaleffects::displace() QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("displacementSource").toInt(), 0); QCOMPARE(obj->property("cached").toBool(), false); + QCOMPARE(obj->property("displacement").type(), QVariant::Double); QCOMPARE(obj->property("displacement").toDouble(), 0.0); delete obj; @@ -629,7 +668,9 @@ void tst_qtgraphicaleffects::recursiveBlur() // Default values QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("loops").toInt(), 0); + QCOMPARE(obj->property("radius").type(), QVariant::Double); QCOMPARE(obj->property("radius").toDouble(), 0.0); + QCOMPARE(obj->property("progress").type(), QVariant::Double); QCOMPARE(obj->property("progress").toDouble(), 0.0); QCOMPARE(obj->property("transparentBorder").toBool(), false); QCOMPARE(obj->property("cached").toBool(), false); @@ -656,7 +697,9 @@ void tst_qtgraphicaleffects::directionalBlur() // Default values QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("length").toInt(), 0); - QCOMPARE(obj->property("samples").toDouble(), 0.0); + QCOMPARE(obj->property("samples").type(), QVariant::Int); + QCOMPARE(obj->property("samples").toInt(), 0); + QCOMPARE(obj->property("angle").type(), QVariant::Double); QCOMPARE(obj->property("angle").toDouble(), 0.0); QCOMPARE(obj->property("transparentBorder").toBool(), false); QCOMPARE(obj->property("cached").toBool(), false); @@ -682,11 +725,15 @@ void tst_qtgraphicaleffects::radialBlur() // Default values QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("samples").toDouble(), 0.0); + QCOMPARE(obj->property("samples").type(), QVariant::Int); + QCOMPARE(obj->property("samples").toInt(), 0); + QCOMPARE(obj->property("angle").type(), QVariant::Double); QCOMPARE(obj->property("angle").toDouble(), 0.0); QCOMPARE(obj->property("transparentBorder").toBool(), false); QCOMPARE(obj->property("cached").toBool(), false); + QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); + QCOMPARE(obj->property("verticalOffset").type(), QVariant::Double); QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); delete obj; @@ -710,10 +757,13 @@ void tst_qtgraphicaleffects::zoomBlur() // Default values QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("length").toInt(), 0); - QCOMPARE(obj->property("samples").toDouble(), 0.0); + QCOMPARE(obj->property("samples").type(), QVariant::Int); + QCOMPARE(obj->property("samples").toInt(), 0); QCOMPARE(obj->property("transparentBorder").toBool(), false); QCOMPARE(obj->property("cached").toBool(), false); + QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); + QCOMPARE(obj->property("verticalOffset").type(), QVariant::Double); QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); delete obj; @@ -765,6 +815,7 @@ void tst_qtgraphicaleffects::maskedBlur() // Default values QCOMPARE(obj->property("source").toInt(), 0); QCOMPARE(obj->property("maskSource").toInt(), 0); + QCOMPARE(obj->property("radius").type(), QVariant::Double); QCOMPARE(obj->property("radius").toDouble(), 4.0); QCOMPARE(obj->property("samples").toInt(), 9); QCOMPARE(obj->property("cached").toBool(), false); |