Ticket #30176: 0001-Add-test-to-verify-that-unused-pointers-are-NULL.patch

File 0001-Add-test-to-verify-that-unused-pointers-are-NULL.patch, 1016 bytes (added by paldium, 2 months ago)
  • src/test/test_containers.c

    From d68fc07e38dbb4f5162d2fe1cec3dc76b433bf0c Mon Sep 17 00:00:00 2001
    From: Tobias Stoeckmann <tobias@stoeckmann.org>
    Date: Sat, 13 Apr 2019 16:54:05 +0200
    Subject: [PATCH 1/2] Add test to verify that unused pointers are NULL.
    
    The smartlist code takes great care to set all unused pointers inside
    the smartlist memory to NULL. Check if this is also the case after
    modifying the smartlist multiple times.
    
    Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
    ---
     src/test/test_containers.c | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/src/test/test_containers.c b/src/test/test_containers.c
    index 7892a0885..ad272eeaf 100644
    a b test_container_smartlist_remove(void *arg) 
    10061006  tt_ptr_op(smartlist_get(sl, 1), OP_EQ, &array[2]);
    10071007  tt_ptr_op(smartlist_get(sl, 2), OP_EQ, &array[1]);
    10081008  tt_ptr_op(smartlist_get(sl, 3), OP_EQ, &array[2]);
     1009  tt_ptr_op(sl->list[4], OP_EQ, NULL);
    10091010
    10101011 done:
    10111012  smartlist_free(sl);