diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-10-21 09:39:18 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-21 09:49:20 +0200 |
commit | dd760b017a561b4c5a005c9b2f4e737debeb65a3 (patch) | |
tree | e095c2c01daebc0a235da7ee9b39e93253bdb53d /tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp | |
parent | f5adde34f125aba66bca46018b31a4f831d2dc05 (diff) | |
download | qtscript-dd760b017a561b4c5a005c9b2f4e737debeb65a3.tar.gz |
Fix test failures when writing invalid enum/flag value
QMetaProperty::write() doesn't accept bogus values anymore,
so the property's old value should remain.
Change-Id: If7fbce37ab58b361d466e1314f6331230ad018b3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp')
-rw-r--r-- | tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp index b0d994f..cc3f528 100644 --- a/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp +++ b/tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp @@ -924,8 +924,7 @@ void tst_QScriptExtQObject::getSetStaticProperty_enum() m_engine->evaluate("myObject.enumProperty = 'BarPolicy'"); QCOMPARE(m_myObject->enumProperty(), MyQObject::BarPolicy); m_engine->evaluate("myObject.enumProperty = 'ScoobyDoo'"); - // ### ouch! Shouldn't QMetaProperty::write() rather not change the value...? - QCOMPARE(m_myObject->enumProperty(), (MyQObject::Policy)-1); + QCOMPARE(m_myObject->enumProperty(), MyQObject::BarPolicy); // enum property with custom conversion qScriptRegisterMetaType<MyQObject::Policy>(m_engine, policyToScriptValue, policyFromScriptValue); m_engine->evaluate("myObject.enumProperty = 'red'"); @@ -956,8 +955,7 @@ void tst_QScriptExtQObject::getSetStaticProperty_qflags() m_engine->evaluate("myObject.flagsProperty = 'BazAbility'"); QCOMPARE(m_myObject->flagsProperty(), MyQObject::BazAbility); m_engine->evaluate("myObject.flagsProperty = 'ScoobyDoo'"); - // ### ouch! Shouldn't QMetaProperty::write() rather not change the value...? - QCOMPARE(m_myObject->flagsProperty(), (MyQObject::Ability)-1); + QCOMPARE(m_myObject->flagsProperty(), MyQObject::BazAbility); } void tst_QScriptExtQObject::getSetStaticProperty_pointerDeref() |