projects
/
platform
/
upstream
/
wayland.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5548988
)
tests: Make sure unused malloc() doesn't get optimized away
author
Kristian Høgsberg
<krh@bitplanet.net>
Thu, 19 Apr 2012 16:07:20 +0000
(12:07 -0400)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Thu, 19 Apr 2012 16:07:20 +0000
(12:07 -0400)
tests/sanity-test.c
patch
|
blob
|
history
diff --git
a/tests/sanity-test.c
b/tests/sanity-test.c
index
77b5cee
..
90e55ff
100644
(file)
--- a/
tests/sanity-test.c
+++ b/
tests/sanity-test.c
@@
-36,6
+36,8
@@
FAIL_TEST(sanity_malloc_direct)
void *p;
p = malloc(10); /* memory leak */
+ assert(p); /* assert that we got memory, also prevents
+ * the malloc from getting optimized away. */
free(NULL); /* NULL must not be counted */
}