summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-06-30 10:33:48 -0300
committerEuAndreh <eu@euandre.org>2024-06-30 10:33:48 -0300
commit57a51f4b77977a0392e499fa61f9284df9c9c02a (patch)
tree3bee1e5204d80b5e6725aa9a1b35ec0edf7d03f4 /tests
parentsrc/vector.h: Remove const markers that do not influence the interface (diff)
downloadpindaiba-57a51f4b77977a0392e499fa61f9284df9c9c02a.tar.gz
pindaiba-57a51f4b77977a0392e499fa61f9284df9c9c02a.tar.xz
src/util.c: Tolerate be given a NULL pointer
Diffstat (limited to 'tests')
-rw-r--r--tests/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/util.c b/tests/util.c
index bc85b70..a720123 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -41,6 +41,16 @@ test_freeit(void) {
test_ok();
}
+ {
+ testing("tolerate be given a NULL pointer");
+
+ void *p = NULL;
+ freeit(NULL);
+ freeit(p);
+ freeit((void *)&p);
+
+ test_ok();
+ }
rc = 0;
out: