提交 01a2d0fc 编写于 作者: C chenxuihui

hiappevent bug fix

Signed-off-by: Nchenxuihui <chenxuhui2@huawei.com>
上级 2160de49
......@@ -43,28 +43,8 @@ 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.
先完成此消息的编辑!
想要评论请 注册