未验证 提交 550dfdbf 编写于 作者: O openharmony_ci 提交者: Gitee

!3585 新增hilogndk接口测试套

Merge pull request !3585 from chenxuihui/master
# Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
module_output_path = "hits/hilogndktest"
config("hilogndktest_config") {
visibility = [ ":*" ]
include_dirs = [
"//base/hiviewdfx/hilog/interface/native/kits/include",
"../../../utils/native",
]
}
ohos_moduletest_suite("hilogndktest") {
module_out_path = module_output_path
sources = [ "hilogndktest.cpp" ]
deps = [
"../../../utils/native:utilskit",
"//base/hiviewdfx/hilog/frameworks/hilog_ndk:hilog_ndk",
"//base/hiviewdfx/hilog/interface/native/kits:libhilog_ndk",
"//utils/native/base:utils",
]
configs = [ ":hilogndktest_config" ]
}
{
"description": "Configuration for hilogndktest demo Tests",
"driver": {
"type": "CppTest",
"native-test-timeout": "120000",
"module-name": "hilogndktest",
"runtime-hint": "ls",
"native-test-device-path": "/data/local/tmp"
},
"kits": [
{
"push": [
"hilogndktest->/data/local/tmp/hilogndktest"
],
"type": "PushKit"
}
]
}
/**
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <gtest/gtest.h>
#include "hilog/hilog.h"
#include "file_utils.h"
#undef LOG_DOMAIN
#undef LOG_TAG
#define LOG_DOMAIN 0xD003e00
using namespace std;
class hilogndktest : public testing::Test {
public:
static void SetUpTestCase();
static void TearDownTestCase();
void SetUp();
void TearDown();
}
/**
* @tc.number : DFX_DFT_HILOGNDK_0100
* @tc.name : HILOGNDK_TEST
* @tc.desc : HILOGNDK_TEST
*/
HWTEST_F(hilogndktest, OH_LOG_Print_CHECK, Function | MediumTest | Level1)
{
LogType type = LOG_APP;
LogLevel level = LOG_ERROR;
int ret = OH_LOG_Print(type, level, 0xD003e00, "%s", "for test");
ASSERT_TRUE(ret == 0);
}
/**
* @tc.number : DFX_DFT_HILOGNDK_0200
* @tc.name : HILOGNDK_TEST
* @tc.desc : HILOGNDK_TEST
*/
HWTEST_F(hilogndktest, OH_LOG_IsLoggable_CHECK, Function | MediumTest | Level1)
{
LogLevel level = LOG_DEBUG;
string LOG_TAG = "testtag0testtag0testtag0testta";
bool res = OH_LOG_IsLoggable(0xD003e00, LOG_TAG, level);
ASSERT_TRUE(res == false);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册