projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bootstrap for git 1.6.x
[gnulib.git]
/
tests
/
test-safe-alloc.c
diff --git
a/tests/test-safe-alloc.c
b/tests/test-safe-alloc.c
index
420b5e2
..
97d200a
100644
(file)
--- a/
tests/test-safe-alloc.c
+++ b/
tests/test-safe-alloc.c
@@
-22,9
+22,10
@@
#include <config.h>
#include <config.h>
-#include
<stdio.h>
+#include
"safe-alloc.h"
-#include <safe-alloc.h>
+#include <stdio.h>
+#include <stdlib.h>
#define ASSERT(expr) \
do \
#define ASSERT(expr) \
do \
@@
-38,9
+39,11
@@
} \
while (0)
} \
while (0)
-int main()
+int
+main ()
{
{
- struct tst {
+ struct tst
+ {
int a;
int b;
};
int a;
int b;
};
@@
-48,16
+51,18
@@
int main()
struct tst *p = NULL;
int r;
struct tst *p = NULL;
int r;
- r = ALLOC(p);
- ASSERT(r >= 0);
+ r = ALLOC
(p);
+ ASSERT
(r >= 0);
- ASSERT(p->a == 0 && p->b == 0);
+ ASSERT
(p->a == 0 && p->b == 0);
p->a = p->b = 42;
p->a = p->b = 42;
- r = REALLOC_N(p, 5);
+ r = REALLOC_N (p, 5);
+
+ ASSERT (p[0].a == 42 && p[0].b == 42);
- ASSERT(p[0].a == 42 && p[0].b == 42);
+ FREE (p);
+ ASSERT (p == NULL);
- FREE(p);
- ASSERT(p == NULL);
+ return 0;
}
}