提交 da810857 编写于 作者: Z zhuqingxi 提交者: Gitee

update hiviewdfx/hilogtest/libhilogtest/libhilogCPPtest/LibhilogCPPtest.cpp.

Signed-off-by: Nzhuqingxi <zhuqingxi@huawei.com>
上级 94f60129
...@@ -77,6 +77,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INFO_CPP, Function|MediumTest|Level2) ...@@ -77,6 +77,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INFO_CPP, Function|MediumTest|Level2)
"%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a'); "%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a');
std::string expected{"I 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \ std::string expected{"I 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \
123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"}; 123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl; std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl;
std::cout<<"expected = " + expected<<std::endl; std::cout<<"expected = " + expected<<std::endl;
...@@ -103,6 +104,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_DEBUG_CPP, Function|MediumTest|Level0) ...@@ -103,6 +104,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_DEBUG_CPP, Function|MediumTest|Level0)
"%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a'); "%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a');
std::string expected{"D 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \ std::string expected{"D 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \
123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"}; 123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"};
sleep(1);
CmdRun("hilog -L D -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -L D -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl; std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl;
std::cout<<"expected = " + expected<<std::endl; std::cout<<"expected = " + expected<<std::endl;
...@@ -129,6 +131,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_WARNING_CPP, Function|MediumTest|Level2) ...@@ -129,6 +131,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_WARNING_CPP, Function|MediumTest|Level2)
"%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a'); "%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a');
std::string expected{"W 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \ std::string expected{"W 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \
123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"}; 123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl; std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl;
std::cout<<"expected = " + expected<<std::endl; std::cout<<"expected = " + expected<<std::endl;
...@@ -155,6 +158,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_ERROR_CPP, Function|MediumTest|Level2) ...@@ -155,6 +158,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_ERROR_CPP, Function|MediumTest|Level2)
"%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a'); "%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a');
std::string expected{"E 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \ std::string expected{"E 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \
123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"}; 123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl; std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl;
std::cout<<"expected = " + expected<<std::endl; std::cout<<"expected = " + expected<<std::endl;
...@@ -181,6 +185,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FATAL_CPP, Function|MediumTest|Level2) ...@@ -181,6 +185,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FATAL_CPP, Function|MediumTest|Level2)
"%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a'); "%{private}lf,%{public}.2f,%s,%{private}c", i, 1.00001, 2.333333, "sse", 'a');
std::string expected{"F 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \ std::string expected{"F 03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST: \
123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"}; 123456789_1234567890_publicandprivatelogHWTEST_Fis:1,<private>,2.33,<private>,<private>"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl; std::cout<<"cmdRunResult = " + cmdRunResult<<std::endl;
std::cout<<"expected = " + expected<<std::endl; std::cout<<"expected = " + expected<<std::endl;
...@@ -204,6 +209,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_CPP, Function|MediumTest|Level3) ...@@ -204,6 +209,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "INTEGER:%{private}d,%{public}d,%d;", 1, 1, 1); HiLog::Fatal(a, "INTEGER:%{private}d,%{public}d,%d;", 1, 1, 1);
std::string expected{"INTEGER:<private>,1,<private>;"}; std::string expected{"INTEGER:<private>,1,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -225,6 +231,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_LONG_CPP, Function|MediumTest|Level3) ...@@ -225,6 +231,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_LONG_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "INTEGER_long:%{private}ld,%{public}ld,%ld;", 2147483647L, 2147483647L, 2147483647L); HiLog::Fatal(a, "INTEGER_long:%{private}ld,%{public}ld,%ld;", 2147483647L, 2147483647L, 2147483647L);
std::string expected{"INTEGER_long:<private>,2147483647,<private>;"}; std::string expected{"INTEGER_long:<private>,2147483647,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -246,6 +253,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_4_CPP, Function|MediumTest|Level3) ...@@ -246,6 +253,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_4_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "INTEGER_4:%{private}4d,%{public}4d,%4d;", 2000, 2000, 2000); HiLog::Fatal(a, "INTEGER_4:%{private}4d,%{public}4d,%4d;", 2000, 2000, 2000);
std::string expected{"INTEGER_4:<private>,2000,<private>;"}; std::string expected{"INTEGER_4:<private>,2000,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -267,6 +275,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_SHORT_CPP, Function|MediumTest|Level3) ...@@ -267,6 +275,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_SHORT_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "INTEGER_short:%{private}hd,%{public}hd,%hd;", (short)1024, (short)1024, (short)1024); HiLog::Fatal(a, "INTEGER_short:%{private}hd,%{public}hd,%hd;", (short)1024, (short)1024, (short)1024);
std::string expected{"INTEGER_short:<private>,1024,<private>;"}; std::string expected{"INTEGER_short:<private>,1024,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -288,6 +297,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_UN_CPP, Function|MediumTest|Level3) ...@@ -288,6 +297,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_UN_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "INTEGER_un:%{private}u,%{public}u,%u;", 2147483647u, 2147483647u, 2147483647u); HiLog::Fatal(a, "INTEGER_un:%{private}u,%{public}u,%u;", 2147483647u, 2147483647u, 2147483647u);
std::string expected{"INTEGER_un:<private>,2147483647,<private>;"}; std::string expected{"INTEGER_un:<private>,2147483647,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -309,6 +319,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_LONG_UN_CPP, Function|MediumTest|Level3) ...@@ -309,6 +319,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_LONG_UN_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "INTEGER_long_un:%{private}lu,%{public}lu,%lu;", 7483647ul, 2147483647ul, 2147483647ul); HiLog::Fatal(a, "INTEGER_long_un:%{private}lu,%{public}lu,%lu;", 7483647ul, 2147483647ul, 2147483647ul);
std::string expected{"INTEGER_long_un:<private>,2147483647,<private>;"}; std::string expected{"INTEGER_long_un:<private>,2147483647,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -330,6 +341,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_4_UN_CPP, Function|MediumTest|Level3) ...@@ -330,6 +341,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_4_UN_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "INTEGER_4_un:%{private}4u,%{public}4u,%4u;", 4000, 4000, 4000); HiLog::Fatal(a, "INTEGER_4_un:%{private}4u,%{public}4u,%4u;", 4000, 4000, 4000);
std::string expected{"INTEGER_4_un:<private>,4000,<private>;"}; std::string expected{"INTEGER_4_un:<private>,4000,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -352,6 +364,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_SHORT_UN_CPP, Function|MediumTest|Level3 ...@@ -352,6 +364,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_INTEGER_SHORT_UN_CPP, Function|MediumTest|Level3
HiLog::Fatal(a, "INTEGER_short_un:%{private}hu,%{public}hu,%hu;", (unsigned short)65535, HiLog::Fatal(a, "INTEGER_short_un:%{private}hu,%{public}hu,%hu;", (unsigned short)65535,
(unsigned short)65535, (unsigned short)65535); (unsigned short)65535, (unsigned short)65535);
std::string expected{"INTEGER_short_un:<private>,65535,<private>;"}; std::string expected{"INTEGER_short_un:<private>,65535,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -373,6 +386,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FLOAT_CPP, Function|MediumTest|Level3) ...@@ -373,6 +386,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FLOAT_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "FLOAT:%{private}f,%{public}f,%f;", 1.01, 1.01, 1.01); HiLog::Fatal(a, "FLOAT:%{private}f,%{public}f,%f;", 1.01, 1.01, 1.01);
std::string expected{"FLOAT:<private>,1.010000,<private>;"}; std::string expected{"FLOAT:<private>,1.010000,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -394,6 +408,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FLOAT_LONG_CPP, Function|MediumTest|Level3) ...@@ -394,6 +408,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FLOAT_LONG_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "FLOAT_long:%{private}lf,%{public}lf,%lf;", 2.147483647, 2.147483647, 2.147483647); HiLog::Fatal(a, "FLOAT_long:%{private}lf,%{public}lf,%lf;", 2.147483647, 2.147483647, 2.147483647);
std::string expected{"FLOAT_long:<private>,2.147484,<private>;"}; std::string expected{"FLOAT_long:<private>,2.147484,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -417,6 +432,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FLOAT_POINT2_CPP, Function|MediumTest|Level3) ...@@ -417,6 +432,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FLOAT_POINT2_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "FLOAT_.2:%{private}.2f,%{public}.2f,%.2f;", 2.147483647, 2.147483647, 2.147483647); HiLog::Fatal(a, "FLOAT_.2:%{private}.2f,%{public}.2f,%.2f;", 2.147483647, 2.147483647, 2.147483647);
std::string expected{"FLOAT_.2:<private>,2.15,<private>;"}; std::string expected{"FLOAT_.2:<private>,2.15,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -440,6 +456,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FLOAT_3POINT2_CPP, Function|MediumTest|Level3) ...@@ -440,6 +456,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_FLOAT_3POINT2_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "FLOAT_3.2:%{private}3.2f,%{public}4.1f,%2.6f;", 32.147483647, 321.147483647, 23.147483647); HiLog::Fatal(a, "FLOAT_3.2:%{private}3.2f,%{public}4.1f,%2.6f;", 32.147483647, 321.147483647, 23.147483647);
std::string expected{"FLOAT_3.2:<private>,321.1,<private>;"}; std::string expected{"FLOAT_3.2:<private>,321.1,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -461,6 +478,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_CHAR_CPP, Function|MediumTest|Level3) ...@@ -461,6 +478,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_CHAR_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "CHAR:%{private}c,%{public}c,%c;", 'a', 'b', 'c'); HiLog::Fatal(a, "CHAR:%{private}c,%{public}c,%c;", 'a', 'b', 'c');
std::string expected{"CHAR:<private>,b,<private>;"}; std::string expected{"CHAR:<private>,b,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -482,6 +500,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_OCTAL_CPP, Function|MediumTest|Level3) ...@@ -482,6 +500,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_OCTAL_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "OCTAL:%{private}o,%{public}o,%o;", 15, 16, 17); HiLog::Fatal(a, "OCTAL:%{private}o,%{public}o,%o;", 15, 16, 17);
std::string expected{"OCTAL:<private>,20,<private>;"}; std::string expected{"OCTAL:<private>,20,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -503,6 +522,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_OCTAL_LONG_CPP, Function|MediumTest|Level3) ...@@ -503,6 +522,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_OCTAL_LONG_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "OCTAL_long:%{private}lo,%{public}lo,%lo;", 18ul, 19ul, 20ul); HiLog::Fatal(a, "OCTAL_long:%{private}lo,%{public}lo,%lo;", 18ul, 19ul, 20ul);
std::string expected{"OCTAL_long:<private>,23,<private>;"}; std::string expected{"OCTAL_long:<private>,23,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -524,6 +544,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_CPP, Function|MediumTest|Level3) ...@@ -524,6 +544,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "HEX:%{private}x,%{public}x,%x;", 15, 16, 17); HiLog::Fatal(a, "HEX:%{private}x,%{public}x,%x;", 15, 16, 17);
std::string expected{"HEX:<private>,10,<private>;"}; std::string expected{"HEX:<private>,10,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -545,6 +566,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_UPPER_CPP, Function|MediumTest|Level3) ...@@ -545,6 +566,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_UPPER_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "HEX_#:%{private}#x,%{public}#x,%#x;", 18, 19, 20); HiLog::Fatal(a, "HEX_#:%{private}#x,%{public}#x,%#x;", 18, 19, 20);
std::string expected{"HEX_#:<private>,0x13,<private>;"}; std::string expected{"HEX_#:<private>,0x13,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -568,6 +590,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_LONG_CPP, Function|MediumTest|Level3) ...@@ -568,6 +590,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_LONG_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "HEX_long:%{private}lx,%{public}lx,%lx;", 21l, 22l, 23l); HiLog::Fatal(a, "HEX_long:%{private}lx,%{public}lx,%lx;", 21l, 22l, 23l);
std::string expected{"HEX_long:<private>,16,<private>;"}; std::string expected{"HEX_long:<private>,16,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -591,6 +614,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_X_CPP, Function|MediumTest|Level3) ...@@ -591,6 +614,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_X_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "HEX_X:%{private}X,%{public}X,%X;", 24u, 25u, 26u); HiLog::Fatal(a, "HEX_X:%{private}X,%{public}X,%X;", 24u, 25u, 26u);
std::string expected{"HEX_X:<private>,19,<private>;"}; std::string expected{"HEX_X:<private>,19,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -614,6 +638,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_UPPER_X_CPP, Function|MediumTest|Level3) ...@@ -614,6 +638,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_UPPER_X_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "HEX_#X:%{private}#X,%{public}#X,%#X;", 27, 28, 28); HiLog::Fatal(a, "HEX_#X:%{private}#X,%{public}#X,%#X;", 27, 28, 28);
std::string expected{"HEX_#X:<private>,0X1C,<private>;"}; std::string expected{"HEX_#X:<private>,0X1C,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -637,6 +662,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_LONG_UPPER_X_CPP, Function|MediumTest|Level3 ...@@ -637,6 +662,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_HEX_LONG_UPPER_X_CPP, Function|MediumTest|Level3
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "HEX_long_X:%{private}lX,%{public}lX,%lX;", 30ul, 31ul, 32ul); HiLog::Fatal(a, "HEX_long_X:%{private}lX,%{public}lX,%lX;", 30ul, 31ul, 32ul);
std::string expected{"HEX_long_X:<private>,1F,<private>;"}; std::string expected{"HEX_long_X:<private>,1F,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -658,6 +684,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_STR_CPP, Function|MediumTest|Level3) ...@@ -658,6 +684,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_STR_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "STRING:%{private}s,%{public}s,%s;", "STRING1", "STRING2", "STRING3"); HiLog::Fatal(a, "STRING:%{private}s,%{public}s,%s;", "STRING1", "STRING2", "STRING3");
std::string expected{"STRING:<private>,STRING2,<private>;"}; std::string expected{"STRING:<private>,STRING2,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -679,6 +706,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_STR_EMPTY_CPP, Function|MediumTest|Level3) ...@@ -679,6 +706,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_STR_EMPTY_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "STRING_empty:%{private}s,%{public}s,%s;", "", "", ""); HiLog::Fatal(a, "STRING_empty:%{private}s,%{public}s,%s;", "", "", "");
std::string expected{"STRING_empty:<private>,,<private>;"}; std::string expected{"STRING_empty:<private>,,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -700,6 +728,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_STR_CHINESE_CPP, Function|MediumTest|Level3) ...@@ -700,6 +728,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_STR_CHINESE_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "STRING_Chinese:%{private}s,%{public}s,%s;", "中文", "中文", "中文"); HiLog::Fatal(a, "STRING_Chinese:%{private}s,%{public}s,%s;", "中文", "中文", "中文");
std::string expected{"STRING_Chinese:<private>,中文,<private>;"}; std::string expected{"STRING_Chinese:<private>,中文,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -721,6 +750,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_E_DOUBLE_CPP, Function|MediumTest|Level3) ...@@ -721,6 +750,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_E_DOUBLE_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "DOUBLE_e:%{private}e,%{public}e,%e;", 1e-30, 2.231e10, 3.999e-13); HiLog::Fatal(a, "DOUBLE_e:%{private}e,%{public}e,%e;", 1e-30, 2.231e10, 3.999e-13);
std::string expected{"DOUBLE_e:<private>,2.231000e+10,<private>;"}; std::string expected{"DOUBLE_e:<private>,2.231000e+10,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -744,6 +774,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_E_UPPER_DOUBLE_CPP, Function|MediumTest|Level3) ...@@ -744,6 +774,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_E_UPPER_DOUBLE_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "DOUBLE_E:%{private}E,%{public}E,%E;", 4.88E2, 5.676767e-2, 6.17E13); HiLog::Fatal(a, "DOUBLE_E:%{private}E,%{public}E,%E;", 4.88E2, 5.676767e-2, 6.17E13);
std::string expected{"DOUBLE_E:<private>,5.676767E-02,<private>;"}; std::string expected{"DOUBLE_E:<private>,5.676767E-02,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -767,6 +798,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_E_AUTO_CPP, Function|MediumTest|Level3) ...@@ -767,6 +798,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_E_AUTO_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "AUTO:%{private}g,%{public}g,%g;", 1e-30, 2.231e10, 3.999e-13); HiLog::Fatal(a, "AUTO:%{private}g,%{public}g,%g;", 1e-30, 2.231e10, 3.999e-13);
std::string expected{"AUTO:<private>,2.231e+10,<private>;"}; std::string expected{"AUTO:<private>,2.231e+10,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -790,6 +822,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_E_UPPER_AUTO_CPP, Function|MediumTest|Level3) ...@@ -790,6 +822,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_E_UPPER_AUTO_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "AUTO_E:%{private}G,%{public}G,%G;", 4.88E2, 5.676767e-2, 6.17E13); HiLog::Fatal(a, "AUTO_E:%{private}G,%{public}G,%G;", 4.88E2, 5.676767e-2, 6.17E13);
std::string expected{"AUTO_E:<private>,0.0567677,<private>;"}; std::string expected{"AUTO_E:<private>,0.0567677,<private>;"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -812,6 +845,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_PRIVATE_CPP, Function|MediumTest|Level3) ...@@ -812,6 +845,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_PRIVATE_CPP, Function|MediumTest|Level3)
HiLog::Fatal(a, "private:%{private}d,%{private}lf,%{private}.2f,%{private}s,%{private}c", HiLog::Fatal(a, "private:%{private}d,%{private}lf,%{private}.2f,%{private}s,%{private}c",
1, 1.00001, 2.333333, "sse", 'a'); 1, 1.00001, 2.333333, "sse", 'a');
std::string expected{"private:<private>,<private>,<private>,<private>,<private>"}; std::string expected{"private:<private>,<private>,<private>,<private>,<private>"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -834,6 +868,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_PUBLIC_CPP, Function|MediumTest|Level3) ...@@ -834,6 +868,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_PUBLIC_CPP, Function|MediumTest|Level3)
HiLog::Fatal(a, "public:%{public}d,%{public}lf,%{public}.2f,%{public}s,%{public}c", HiLog::Fatal(a, "public:%{public}d,%{public}lf,%{public}.2f,%{public}s,%{public}c",
1, 1.00001, 2.333333, "sse", 'a'); 1, 1.00001, 2.333333, "sse", 'a');
std::string expected{"public:1,1.000010,2.33,sse,a"}; std::string expected{"public:1,1.000010,2.33,sse,a"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -855,6 +890,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_NO_SIGN_CPP, Function|MediumTest|Level3) ...@@ -855,6 +890,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_NO_SIGN_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "no_sign:%d,%lf,%.2f,%s,%c", 1, 1.00001, 2.333333, "sse", 'a'); HiLog::Fatal(a, "no_sign:%d,%lf,%.2f,%s,%c", 1, 1.00001, 2.333333, "sse", 'a');
std::string expected{"no_sign:<private>,<private>,<private>,<private>,<private>"}; std::string expected{"no_sign:<private>,<private>,<private>,<private>,<private>"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -878,6 +914,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_MIX_CPP, Function|MediumTest|Level3) ...@@ -878,6 +914,7 @@ HWTEST_F(LibhilogCPPtest, HILOG_MIX_CPP, Function|MediumTest|Level3)
a.tag = tag; a.tag = tag;
HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a'); HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a');
std::string expected{"MIX:1,<private>,2.33,<private>,<private>"}; std::string expected{"MIX:1,<private>,2.33,<private>,<private>"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -899,6 +936,7 @@ HWTEST_F(LibhilogCPPtest, TAG_CHECK_CPP, Function|MediumTest|Level2) ...@@ -899,6 +936,7 @@ HWTEST_F(LibhilogCPPtest, TAG_CHECK_CPP, Function|MediumTest|Level2)
a.tag = tagNormal; a.tag = tagNormal;
HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a'); HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a');
std::string expected{"03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST:"}; std::string expected{"03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST:"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -921,6 +959,7 @@ HWTEST_F(LibhilogCPPtest, TAG_OVER_CHECK_CPP, Function|MediumTest|Level2) ...@@ -921,6 +959,7 @@ HWTEST_F(LibhilogCPPtest, TAG_OVER_CHECK_CPP, Function|MediumTest|Level2)
a.tag = tagToolong; a.tag = tagToolong;
HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a'); HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a');
std::string expected{"03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST_:"}; std::string expected{"03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST_:"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST_", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST_", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -942,6 +981,7 @@ HWTEST_F(LibhilogCPPtest, DOMAIN_CHECK_CPP, Function|MediumTest|Level1) ...@@ -942,6 +981,7 @@ HWTEST_F(LibhilogCPPtest, DOMAIN_CHECK_CPP, Function|MediumTest|Level1)
a.tag = tagNormal; a.tag = tagNormal;
HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a'); HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a');
std::string expected{"01111/HWTEST_Ftag0HWTEST_Ftag0HWTEST:"}; std::string expected{"01111/HWTEST_Ftag0HWTEST_Ftag0HWTEST:"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
...@@ -963,6 +1003,7 @@ HWTEST_F(LibhilogCPPtest, TYPE_APP_CHECK_CPP, Function|MediumTest|Level2) ...@@ -963,6 +1003,7 @@ HWTEST_F(LibhilogCPPtest, TYPE_APP_CHECK_CPP, Function|MediumTest|Level2)
a.tag = tagNormal; a.tag = tagNormal;
HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a'); HiLog::Fatal(a, "MIX:%{public}d,%{private}lf,%{public}.2f,%s,%{private}c", 1, 1.00001, 2.333333, "sse", 'a');
std::string expected{"03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST:"}; std::string expected{"03200/HWTEST_Ftag0HWTEST_Ftag0HWTEST:"};
sleep(1);
CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult); CmdRun("hilog -x | grep HWTEST_Ftag0HWTEST_Ftag0HWTEST", cmdRunResult);
ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos); ASSERT_TRUE(cmdRunResult.find(expected) != std::string::npos);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册