1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun * Copyright 2015 Rockchip Electronics Co. LTD
3*4882a593Smuzhiyun *
4*4882a593Smuzhiyun * Licensed under the Apache License, Version 2.0 (the "License");
5*4882a593Smuzhiyun * you may not use this file except in compliance with the License.
6*4882a593Smuzhiyun * You may obtain a copy of the License at
7*4882a593Smuzhiyun *
8*4882a593Smuzhiyun * http://www.apache.org/licenses/LICENSE-2.0
9*4882a593Smuzhiyun *
10*4882a593Smuzhiyun * Unless required by applicable law or agreed to in writing, software
11*4882a593Smuzhiyun * distributed under the License is distributed on an "AS IS" BASIS,
12*4882a593Smuzhiyun * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*4882a593Smuzhiyun * See the License for the specific language governing permissions and
14*4882a593Smuzhiyun * limitations under the License.
15*4882a593Smuzhiyun */
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun #define MODULE_TAG "mpp_env_test"
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun #include "mpp_env.h"
20*4882a593Smuzhiyun #include "mpp_log.h"
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun const char env_debug[] = "test_env_debug";
23*4882a593Smuzhiyun const char env_string[] = "test_env_string";
24*4882a593Smuzhiyun char env_test_string[] = "just for debug";
25*4882a593Smuzhiyun
main()26*4882a593Smuzhiyun int main()
27*4882a593Smuzhiyun {
28*4882a593Smuzhiyun RK_U32 env_debug_u32 = 0x100;
29*4882a593Smuzhiyun const char *env_str_out = NULL;
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun mpp_env_set_u32(env_debug, env_debug_u32);
32*4882a593Smuzhiyun mpp_env_set_str(env_string, env_test_string);
33*4882a593Smuzhiyun mpp_log("set env: %s to %u\n", env_debug, env_debug_u32);
34*4882a593Smuzhiyun mpp_log("set env: %s to %s\n", env_string, env_test_string);
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun env_debug_u32 = 0;
37*4882a593Smuzhiyun mpp_log("start reading env:\n");
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun mpp_env_get_u32(env_debug, &env_debug_u32, 0);
40*4882a593Smuzhiyun mpp_env_get_str(env_string, &env_str_out, NULL);
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun mpp_log("get env: %s is %u\n", env_debug, env_debug_u32);
43*4882a593Smuzhiyun mpp_log("get env: %s is %s\n", env_string, env_str_out);
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun return 0;
46*4882a593Smuzhiyun }
47*4882a593Smuzhiyun
48