21 int main(int argc
, char *argv
[]);
31 if (argc
== 2) m
= atoi(argv
[1]);
35 for (i
= 0; i
< 70; i
++) {
36 if (m
& 00001) test6a();
37 if (m
& 00002) test6b();
41 return(-1); /* impossible */
46 /* Test sbrk() and brk(). */
48 char *addr
, *addr2
, *addr3
;
49 int i
, del
, click
, click2
;
53 addr
= sbrk(0); /* force break to a click boundary */
54 for (i
= 0; i
< 10; i
++) sbrk(7 * i
);
55 for (i
= 0; i
< 10; i
++) sbrk(-7 * i
);
56 if (sbrk(0) != addr
) e(1);
58 if (brk(addr
) != 0) e(2);
59 if (sbrk(0) != addr
) e(3);
66 } while (addr2
== addr
);
69 if (sbrk(0) != addr
) e(4);
71 if (sbrk(0) != addr
) e(5);
78 } while (addr3
== addr
);
79 click2
= addr
- addr3
;
81 if (sbrk(0) != addr
) e(6);
83 if (sbrk(0) != addr
) e(8);
84 if (click
!= click2
) e(9);
86 brk(addr
+ 2 * click
);
87 if (sbrk(0) != addr
+ 2 * click
) e(10);
89 if (sbrk(0) != addr
+ 5 * click
) e(11);
91 if (sbrk(0) != addr
) e(12);
99 signal(SIGQUIT
, SIG_IGN
);
101 for (i
= 0; i
< 5000; i
++)
102 if (zilch
[i
] != 0) err
++;
104 kill(getpid(), SIGQUIT
);