>From aa2ee33baa45ebef6750fcec0d8f993af81d2e98 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sat, 28 Aug 2010 09:07:47 +0200 Subject: [PATCH 1/4] Tests for module 'calloc'. * modules/calloc-tests: New file. * tests/test-calloc.c: New file. --- ChangeLog | 6 ++++++ modules/calloc-tests | 11 +++++++++++ tests/test-calloc.c | 24 ++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 0 deletions(-) create mode 100644 modules/calloc-tests create mode 100644 tests/test-calloc.c diff --git a/ChangeLog b/ChangeLog index 57759fe..8d376bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-08-28 Ralf Wildenhues + + Tests for module 'calloc'. + * modules/calloc-tests: New file. + * tests/test-calloc.c: New file. + 2010-08-27 Ralf Wildenhues accept4: depend on socklen diff --git a/modules/calloc-tests b/modules/calloc-tests new file mode 100644 index 0000000..fc31e76 --- /dev/null +++ b/modules/calloc-tests @@ -0,0 +1,11 @@ +Files: +tests/test-calloc.c + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-calloc +check_PROGRAMS += test-calloc + diff --git a/tests/test-calloc.c b/tests/test-calloc.c new file mode 100644 index 0000000..24e1774 --- /dev/null +++ b/tests/test-calloc.c @@ -0,0 +1,24 @@ +/* Test of calloc 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 !calloc (0, 0) || calloc ((size_t) -1 / 8 + 1, 8); +} -- 1.7.2.1.222.g9988