diff --git a/tests/src/components/notifier/Notifier.cpp b/tests/src/components/notifier/Notifier.cpp index f95be23eb..39151cd0e 100644 --- a/tests/src/components/notifier/Notifier.cpp +++ b/tests/src/components/notifier/Notifier.cpp @@ -112,7 +112,7 @@ void Notifier::showCallMessage ( ); // Destroy it after timeout. - QTimer::singleShot(timeout, this, [object,this]() { + QTimer::singleShot(timeout, this, [object, this]() { delete object; m_mutex.lock(); diff --git a/tests/ui/modules/Linphone/Notifications/Notification.spec.qml b/tests/ui/modules/Linphone/Notifications/Notification.spec.qml new file mode 100644 index 000000000..1323f496d --- /dev/null +++ b/tests/ui/modules/Linphone/Notifications/Notification.spec.qml @@ -0,0 +1,25 @@ +import QtTest 1.1 + +import Linphone 1.0 +import Utils 1.0 + +// =================================================================== + +// Check defined properties/methods used in `Notifier.cpp`. +TestCase { + Notification { + id: notification + } + + function test_notificationHeightProperty () { + compare(Utils.isInteger(notification.notificationHeight), true) + } + + function test_notificationOffsetProperty () { + compare(Utils.isInteger(notification.notificationOffset), true) + } + + function test_notificationShowMethod () { + compare(Utils.isFunction(notification.show), true) + } +} diff --git a/tests/ui/scripts/Utils/utils.js b/tests/ui/scripts/Utils/utils.js index e8ca823b8..a55a21e36 100644 --- a/tests/ui/scripts/Utils/utils.js +++ b/tests/ui/scripts/Utils/utils.js @@ -365,6 +365,18 @@ function isArray (array) { // ------------------------------------------------------------------- +function isFunction (func) { + return typeof func === 'function' +} + +// ------------------------------------------------------------------- + +function isInteger (integer) { + return integer === parseInt(integer, 10) +} + +// ------------------------------------------------------------------- + function isString (string) { return typeof string === 'string' || string instanceof String }