提交 4080c362 编写于 作者: C chenxuihui

add hilogndk test

Signed-off-by: Nchenxuihui <chenxuhui2@huawei.com>
上级 344b9881
# Copyright (C) 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.
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",
]
}
oh_moduletest_suite("hilogndktest"){
module_out_path = module_out_path
sources = [ "hilogndktest.cpp" ]
deps = [
"//base/hiviewdfx/hilog/interface/native/kits:libhilog_ndk",
"//base/hiviewdfx/hilog/frameworks/hilog_ndk:hilog_ndk",
"//utils/native/base:utils",
"../../../utils/native:utilskit",
]
configs = [ ":hilogndktest_config" ]
}
\ No newline at end of file
{
"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 "hilog/hilog.h"
#include "file_utils.h"
#include <gtest/gtest.h>
#undef LOG_DOMAIN
#undef LOG_TAG
#define LOG_DOMAIN 0xD003e00
#define LOG_TAG "testtag0testtag0testtag0testta"
using namespace std;
using namespace testing:ext;
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;
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.
先完成此消息的编辑!
想要评论请 注册