!917 fix:修复fuzz用例

Merge pull request !917 from quyihao/master
This commit is contained in:
openharmony_ci 2024-10-22 14:44:02 +00:00 committed by Gitee
commit 03ca8d3c28
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -123,11 +123,14 @@ bool FuzzFfRTTimerSingleSetAndCancel(const uint8_t *rawData, size_t size)
FFRTTask task = [&] {
m /= 2;
};
string timerId(reinterpret_cast<const char*>(rawData + pos), size - pos);
FFRTTimer ffrtTimer;
ffrtTimer.SetTimer(timerId, task);
ffrtTimer.CancelTimer(timerId);
static uint32_t thresHold = 1;
if (thresHold <= 1) {
string timerId = "TimerSingleSetAndCancelId";
FFRTTimer ffrtTimer;
ffrtTimer.SetTimer(timerId, task);
ffrtTimer.CancelTimer(timerId);
thresHold++;
}
return true;
}