Files
mpp/osal/test/mpp_mem_test.c
Hongjin Li 4692f8bd6b refactor[mpp_mem]: Refactor C++ mpp_mem to C
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com>
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I927346dfdb0edea486b8dda61f379f96059b01ba
2025-06-11 18:33:42 +08:00

37 lines
743 B
C

/* SPDX-License-Identifier: Apache-2.0 OR MIT */
/*
* Copyright (c) 2015 Rockchip Electronics Co., Ltd.
*/
#define MODULE_TAG "mpp_mem_test"
#include "mpp_log.h"
#include "mpp_env.h"
#include "mpp_mem.h"
// TODO: need to add pressure test case and parameter scan case
int main()
{
void *tmp = NULL;
tmp = mpp_calloc(int, 100);
if (tmp) {
mpp_log("calloc success ptr 0x%p\n", tmp);
} else {
mpp_log("calloc failed\n");
}
if (tmp) {
tmp = mpp_realloc(tmp, int, 200);
if (tmp) {
mpp_log("realloc success ptr 0x%p\n", tmp);
} else {
mpp_log("realloc failed\n");
}
}
mpp_free(tmp);
mpp_log("mpp_mem_test done\n");
return 0;
}