mirror of
https://github.com/albfan/miraclecast.git
synced 2025-03-09 23:38:56 +00:00
test: add valgrind memory checks
Copy over the "make memcheck" target from libshl. It runs the test-suite again via valgrind and fails on any valgrind warnings. This is very useful to find memory-leaks and invalid memory-accesses via the test-suite. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
parent
729acb64ca
commit
9cb0a092c2
4 changed files with 92 additions and 2 deletions
42
test/test_valgrind.c
Normal file
42
test/test_valgrind.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* MiracleCast - Wifi-Display/Miracast Implementation
|
||||
*
|
||||
* Copyright (c) 2013-2014 David Herrmann <dh.herrmann@gmail.com>
|
||||
*
|
||||
* MiracleCast is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MiracleCast is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with MiracleCast; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Dummy which just leaks memory. Used to verify valgrind memcheck. */
|
||||
|
||||
#include "test_common.h"
|
||||
|
||||
START_TEST(test_valgrind)
|
||||
{
|
||||
void *p;
|
||||
|
||||
p = malloc(0x100);
|
||||
ck_assert(!!p);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TEST_DEFINE_CASE(misc)
|
||||
TEST(test_valgrind)
|
||||
TEST_END_CASE
|
||||
|
||||
TEST_DEFINE(
|
||||
TEST_SUITE(valgrind,
|
||||
TEST_CASE(misc),
|
||||
TEST_END
|
||||
)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue