Fix to prevent of crash on the unit test.
authorKIM JungYong <jyong2.kim@samsung.com>
Tue, 21 Mar 2017 10:00:43 +0000 (19:00 +0900)
committerUze Choi <uzchoi@samsung.com>
Tue, 4 Apr 2017 12:08:24 +0000 (12:08 +0000)
commit82f3c35881ab1a32c61c26f5ef781e57e7b3cab8
tree7af5d73fb7ca9d17880efb7affa05eba9c26d6ff
parentf7e8c4baef5382597456046984ef9a2d8b2ec690
Fix to prevent of crash on the unit test.

As-Is, Notification unit test sometimes crash on running.

Cause by,
1) When provider unit test running,
it use invalid request information.
this invalid request is not made by stack,
made by inside unit test as uninitialized variables.

2) When consumer was destroyed, task queue was deinitilzed.
but main task thread waitting for mutex unlocking,
when mutex unlock, main thread does not update address of queue.
actually, address of queue is modified,
in this moment, main thread try to reference unmodified queue and crash.

Fixed,
1) Uninitialized variables are initialized.
2) When main thread mutex was unlocked, updating queue.
   Exception handling what data of queue is invalid.

Change-Id: I41cd4a100ea2bb7b3e68be3017475c9ecbfbb144
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18047
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/notification/SConscript
service/notification/src/consumer/NSConsumerScheduler.c
service/notification/unittest/NSConsumerTest2.cpp
service/notification/unittest/NSProviderTest2.cpp