29 lines
569 B
C
29 lines
569 B
C
#define DEBUG
|
|
#include "../include/except.h"
|
|
#include "../include/mem.h"
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void){
|
|
printf("\n\n");
|
|
|
|
printf("Testing memory allocation\n");
|
|
char *buf = ALLOC(100);
|
|
TEST(buf != NULL);
|
|
REALLOC(buf,200);
|
|
char *str = NEW(str);
|
|
TEST(str != 0);
|
|
FREE(str);
|
|
char *callocd = NEW0(callocd);
|
|
TEST(callocd != NULL);
|
|
FREE(buf);
|
|
FREE(callocd);
|
|
TEST(str == NULL);
|
|
TEST(callocd == NULL);
|
|
TEST(buf == NULL);
|
|
FREE(buf);
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|