mirror of
https://gitee.com/Lamdonn/varch.git
synced 2025-12-06 16:56:42 +08:00
28 lines
527 B
C
28 lines
527 B
C
#include "test.h"
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "valloc.h"
|
|
|
|
void test_main(void)
|
|
{
|
|
void* p = NULL;
|
|
printf("malloc %p\r\n", malloc(0));
|
|
p = realloc(NULL, 100);
|
|
p = malloc(64);
|
|
p = malloc(50);
|
|
printf("realloc %p\r\n", realloc(NULL, 0));
|
|
printf("%d\r\n", *(int *)p);
|
|
free(p);
|
|
|
|
v_check_unfree();
|
|
printf("count = %d\r\n", v_check_count());
|
|
printf("used = %d\r\n", v_check_used());
|
|
}
|
|
|
|
std_return test_init(void)
|
|
{
|
|
test_main();
|
|
|
|
return E_OK;
|
|
} |