From 5f62acc830f5d6781205e398d996eca8fa3eb91c Mon Sep 17 00:00:00 2001 From: zhuqingxi Date: Mon, 13 Dec 2021 11:39:38 +0000 Subject: [PATCH] update hiviewdfx/hilogtest/libhilogtest/libhilogCtest/libhilogCtest.cpp. Signed-off-by: zhuqingxi --- .../libhilogCtest/libhilogCtest.cpp | 199 +++++++++++------- 1 file changed, 119 insertions(+), 80 deletions(-) diff --git a/hiviewdfx/hilogtest/libhilogtest/libhilogCtest/libhilogCtest.cpp b/hiviewdfx/hilogtest/libhilogtest/libhilogCtest/libhilogCtest.cpp index 0e44b0cb3..683a1b50a 100755 --- a/hiviewdfx/hilogtest/libhilogtest/libhilogCtest/libhilogCtest.cpp +++ b/hiviewdfx/hilogtest/libhilogtest/libhilogCtest/libhilogCtest.cpp @@ -69,8 +69,7 @@ HWTEST_F(LibhilogCtest, HILOG_INFO, Function|MediumTest|Level2) "%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a'); std::string expected{"I 03e00/testtag0testtag0testtag0testta: \ 123456789_1234567890_publicandprivatelogtestis:1,,2.33,,"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); std::cout<<"cmdRunResult = " + cmdRunResult<,2.33,,"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2.33,,"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2.33,,"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2.33,,"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,1,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2147483647,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2000,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,1024,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2147483647,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2147483647,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,4000,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,65535,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,1.010000,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2.147484,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2.15,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,321.1,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,b,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,20,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,23,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,10,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,0x13,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,16,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,19,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,0X1C,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,1F,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,STRING2,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,中文,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2.231000e+10,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,5.676767E-02,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2.231e+10,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,0.0567677,;"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,,,,"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,,,,"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<,2.33,,"}; - sleep(1); - CmdRun("hilog -x| grep testtag0testtag0testtag0testta", cmdRunResult); + CmdRun("timeout 3 hilog | grep testtag0testtag0testtag0testta", cmdRunResult); + std::cout<