1 /* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2 
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; version 2 of the License.
6 
7    This program is distributed in the hope that it will be useful,
8    but WITHOUT ANY WARRANTY; without even the implied warranty of
9    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10    GNU General Public License for more details.
11 
12    You should have received a copy of the GNU General Public License
13    along with this program; if not, write to the Free Software
14    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
15 
16 #include <my_global.h>
17 #include <my_sys.h>
18 #include "tap.h"
19 
main(void)20 int main(void)
21 {
22   void *p;
23   MY_INIT("my_malloc-t");
24 
25   plan(4);
26 
27   p= my_malloc(0, MYF(0));
28   ok(p != NULL, "Zero-sized block allocation.");
29 
30   p= my_realloc(p, 32, MYF(0));
31   ok(p != NULL, "Reallocated zero-sized block.");
32 
33   p= my_realloc(p, 16, MYF(0));
34   ok(p != NULL, "Trimmed block.");
35 
36   my_free(p);
37   p= NULL;
38 
39   ok((my_free(p), 1), "Free NULL pointer.");
40 
41   return exit_status();
42 }
43 
44