From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Date: Sat, 28 Aug 2010 21:33:01 +0000 (+0200)
Subject: Tests for module 'malloc-gnu'.
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60b3f5cc81824a4bc817ac9cca1a28dba55dee5a;p=pspp

Tests for module 'malloc-gnu'.
* modules/malloc-gnu-tests: New file.
* tests/test-malloc-gnu.c: New file.
---

diff --git a/ChangeLog b/ChangeLog
index 3a125a8dbf..86454464b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	Tests for module 'malloc-gnu'.
+	* modules/malloc-gnu-tests: New file.
+	* tests/test-malloc-gnu.c: New file.
+
 2010-08-28  Bruno Haible  <bruno@clisp.org>
 
 	Rename module 'realloc' -> 'realloc-gnu'.
diff --git a/modules/malloc-gnu-tests b/modules/malloc-gnu-tests
new file mode 100644
index 0000000000..75f7e4f524
--- /dev/null
+++ b/modules/malloc-gnu-tests
@@ -0,0 +1,10 @@
+Files:
+tests/test-malloc-gnu.c
+
+Depends-on:
+
+configure.ac:
+
+Makefile.am:
+TESTS += test-malloc-gnu
+check_PROGRAMS += test-malloc-gnu
diff --git a/tests/test-malloc-gnu.c b/tests/test-malloc-gnu.c
new file mode 100644
index 0000000000..bcddf4746d
--- /dev/null
+++ b/tests/test-malloc-gnu.c
@@ -0,0 +1,29 @@
+/* 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 <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+int
+main ()
+{
+  /* Check that malloc (0) is not a NULL pointer.  */
+  if (malloc (0) == NULL)
+    return 1;
+
+  return 0;
+}