提交 4cc34b04 编写于 作者: C chenxuihui

xts code check bug fix

Signed-off-by: Nchenxuihui <chenxuhui2@huawei.com>
上级 6506bdb6
......@@ -19,7 +19,6 @@ module_output_path = "hit/HiAppEventCPPTest"
config("hilogtest_config") {
visibility = [ ":*" ]
include_dirs = [
"../../utils/native",
"//utils/native/base/include/",
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
"//base/hiviewdfx/hiappevent/interfaces/native/kits/include/hiappevent",
......@@ -30,7 +29,6 @@ ohos_moduletest_suite("HiAppEventCPPTest") {
module_out_path = module_output_path
sources = [ "HiAppEventCPPTest.cpp" ]
deps = [
"../../utils/native:utilskit",
"//base/hiviewdfx/hiappevent/frameworks/native/libhiappevent:libhiappevent_base",
"//base/hiviewdfx/hiappevent/frameworks/native/ndk:hiappevent_ndk",
"//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
......
......@@ -43,7 +43,28 @@ namespace {
class HiAppEventCPPTest : public testing::Test {
public:
void TearDown();
int ExecCmdWithRet(string cmd, vector<string> &resvec);
};
int ExecCmdWithRet(string cmd, vector<string> &resvec)
{
cout << "cmd is " + cmd <<endl;
resvec.clear();
FILE *pp = popen(cmd.c_str(), "r");
if (pp == nullptr) {
return -1;
}
char tmp[1024];
while (fgets(tmp, sizeof(tmp), pp) != nullptr) {
if (tmp[strlen(tmp) - 1] == '\n') {
tmp[strlen[tmp] - 1] = '\0';
}
resvec.push_back(tmp);
}
pclose(pp);
return resvec.size();
}
void HiAppEventCPPTest::TearDown()
{
std::cout << "TearDown" << std::endl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册