mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-04 00:30:59 -05:00
fcnGenericHash(): emit error message if request hash method isn't available
This commit is contained in:
parent
6665fe0621
commit
6c02dbab22
@ -5065,6 +5065,10 @@ static QVariant fcnGenericHash( const QVariantList &values, const QgsExpressionC
|
||||
hash = fcnHash( str, QCryptographicHash::Keccak_512 );
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
parent->setEvalErrorString( QObject::tr( "Hash method %1 is not available on this system." ).arg( str ) );
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
@ -1476,7 +1476,7 @@ class TestQgsExpression: public QObject
|
||||
QTest::newRow( "md5('QGIS')" ) << QStringLiteral( "md5('QGIS')" ) << false << QVariant( "57470aaa9e22adaefac7f5f342f1c6da" );
|
||||
QTest::newRow( "sha256(NULL)" ) << QStringLiteral( "sha256(NULL)" ) << false << QVariant( );
|
||||
QTest::newRow( "sha256('QGIS')" ) << QStringLiteral( "sha256('QGIS')" ) << false << QVariant( "eb045cba7a797aaa06ac58830846e40c8e8c780bc0676d3393605fae50c05309" );
|
||||
QTest::newRow( "hash('QGIS', 'qsdf')" ) << QStringLiteral( "hash('QGIS', 'qsdf')" ) << false << QVariant();
|
||||
QTest::newRow( "hash('QGIS', 'qsdf')" ) << QStringLiteral( "hash('QGIS', 'qsdf')" ) << true << QVariant();
|
||||
QTest::newRow( "hash('QGIS', 'md4')" ) << QStringLiteral( "hash('QGIS', 'md4')" ) << false << QVariant( "c0fc71c241cdebb6e888cbac0e2b68eb" );
|
||||
QTest::newRow( "hash('QGIS', 'md5')" ) << QStringLiteral( "hash('QGIS', 'md5')" ) << false << QVariant( "57470aaa9e22adaefac7f5f342f1c6da" );
|
||||
QTest::newRow( "hash('QGIS', 'sha1')" ) << QStringLiteral( "hash('QGIS', 'sha1')" ) << false << QVariant( "f87cfb2b74cdd5867db913237024e7001e62b114" );
|
||||
|
Loading…
x
Reference in New Issue
Block a user