MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / test_cronLateAbort

Function test_cronLateAbort

tests/unit/test_cron.c:287–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287static void test_cronLateAbort() {
288 // reset X = 1
289 // issue a task X += 2
290 // abort task AFTER task been performed
291 // validate X = 3
292
293 X = 1;
294 int Y = 2;
295 AddTaskData data = _AddTaskData_New(add_task, (void *)&Y);
296
297 // issue task X += 2
298 CronTaskHandle task_handle = Cron_AddTask(15, _AddTaskData_Execute, NULL,
299 &data);
300
301 _AddTaskData_Wait(data);
302 _AddTaskData_Free(data);
303
304 // task should have been executed, expecting X = 1
305 TEST_ASSERT(X == 3);
306
307 // abort task, should note hang/crash
308 Cron_AbortTask(task_handle);
309}
310
311static void test_MultiAbort() {
312 // reset X = 1

Callers

nothing calls this directly

Calls 5

_AddTaskData_NewFunction · 0.85
Cron_AddTaskFunction · 0.85
_AddTaskData_WaitFunction · 0.85
_AddTaskData_FreeFunction · 0.85
Cron_AbortTaskFunction · 0.85

Tested by

no test coverage detected