diff options
Diffstat (limited to 'tests/lib/test_heavy_wq.c')
-rw-r--r-- | tests/lib/test_heavy_wq.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/tests/lib/test_heavy_wq.c b/tests/lib/test_heavy_wq.c index 0f474dc5d..00ddc836d 100644 --- a/tests/lib/test_heavy_wq.c +++ b/tests/lib/test_heavy_wq.c @@ -60,18 +60,10 @@ static void heavy_wq_add(struct vty *vty, const char *str, int i) { struct heavy_wq_node *hn; - if ((hn = XCALLOC(MTYPE_WQ_NODE, sizeof(struct heavy_wq_node))) - == NULL) { - zlog_err("%s: unable to allocate hn", __func__); - return; - } + hn = XCALLOC(MTYPE_WQ_NODE, sizeof(struct heavy_wq_node)); hn->i = i; - if (!(hn->str = XSTRDUP(MTYPE_WQ_NODE_STR, str))) { - zlog_err("%s: unable to xstrdup", __func__); - XFREE(MTYPE_WQ_NODE, hn); - return; - } + hn->str = XSTRDUP(MTYPE_WQ_NODE_STR, str); work_queue_add(heavy_wq, hn); @@ -149,10 +141,7 @@ DEFUN (clear_foo, static int heavy_wq_init() { - if (!(heavy_wq = work_queue_new(master, "heavy_work_queue"))) { - zlog_err("%s: could not get new work queue!", __func__); - return -1; - } + heavy_wq = work_queue_new(master, "heavy_work_queue"); heavy_wq->spec.workfunc = &slow_func; heavy_wq->spec.errorfunc = &slow_func_err; |