>From d1439911ae9ec1decd188144f3424a747d724842 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sat, 28 Aug 2010 09:08:28 +0200 Subject: [PATCH 2/4] Tests for module 'malloc'. * modules/malloc-tests: New file. * tests/test-malloc.c: New file. --- ChangeLog | 4 ++++ modules/malloc-tests | 11 +++++++++++ tests/test-malloc.c | 24 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 0 deletions(-) create mode 100644 modules/malloc-tests create mode 100644 tests/test-malloc.c diff --git a/ChangeLog b/ChangeLog index 8d376bd..7c399b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-08-28 Ralf Wildenhues + Tests for module 'malloc'. + * modules/malloc-tests: New file. + * tests/test-malloc.c: New file. + Tests for module 'calloc'. * modules/calloc-tests: New file. * tests/test-calloc.c: New file. diff --git a/modules/malloc-tests b/modules/malloc-tests new file mode 100644 index 0000000..6d962cf --- /dev/null +++ b/modules/malloc-tests @@ -0,0 +1,11 @@ +Files: +tests/test-malloc.c + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-malloc +check_PROGRAMS += test-malloc + diff --git a/tests/test-malloc.c b/tests/test-malloc.c new file mode 100644 index 0000000..4668f35 --- /dev/null +++ b/tests/test-malloc.c @@ -0,0 +1,24 @@ +/* Test of malloc function. + Copyright (C) 2010 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +int +main () +{ + return malloc(0) == NULL; +} -- 1.7.2.1.222.g9988