1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16#ifndef PLUGIN_TEST_ 17#define PLUGIN_TEST_ 18#include <memory.h> 19#include <stdint.h> 20#include <stdio.h> 21 22#include "init_log.h" 23#include "securec.h" 24 25#ifndef PLUGIN_DOMAIN 26#define PLUGIN_DOMAIN (BASE_DOMAIN + 7) 27#endif 28#define READ_DURATION 100000 29#define PLUGIN_LABEL "PLUGIN" 30#define PLUGIN_LOGI(fmt, ...) STARTUP_LOGI(PLUGIN_DOMAIN, PLUGIN_LABEL, fmt, ##__VA_ARGS__) 31#define PLUGIN_LOGE(fmt, ...) STARTUP_LOGE(PLUGIN_DOMAIN, PLUGIN_LABEL, fmt, ##__VA_ARGS__) 32#define PLUGIN_LOGV(fmt, ...) STARTUP_LOGV(PLUGIN_DOMAIN, PLUGIN_LABEL, fmt, ##__VA_ARGS__) 33 34#define PLUGIN_CHECK(ret, exper, ...) \ 35 if (!(ret)) { \ 36 PLUGIN_LOGE(__VA_ARGS__); \ 37 exper; \ 38 } 39#define PLUGIN_ONLY_CHECK(ret, exper, ...) \ 40 if (!(ret)) { \ 41 exper; \ 42 } 43#endif 44