xref: /rockchip-linux_mpp/osal/test/mpp_mem_test.c (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */
2 /*
3  * Copyright (c) 2015 Rockchip Electronics Co., Ltd.
4  */
5 
6 #define MODULE_TAG "mpp_mem_test"
7 
8 #include "mpp_log.h"
9 #include "mpp_env.h"
10 #include "mpp_mem.h"
11 
12 // TODO: need to add pressure test case and parameter scan case
13 
main()14 int main()
15 {
16     void *tmp = NULL;
17 
18     tmp = mpp_calloc(int, 100);
19     if (tmp) {
20         mpp_log("calloc  success ptr 0x%p\n", tmp);
21     } else {
22         mpp_log("calloc  failed\n");
23     }
24     if (tmp) {
25         tmp = mpp_realloc(tmp, int, 200);
26         if (tmp) {
27             mpp_log("realloc success ptr 0x%p\n", tmp);
28         } else {
29             mpp_log("realloc failed\n");
30         }
31     }
32     mpp_free(tmp);
33     mpp_log("mpp_mem_test done\n");
34 
35     return 0;
36 }
37