test: add unit tests for sslconf and manager modules - #765
Conversation
There was a problem hiding this comment.
Sorry @pengfeixx, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Note
详情{
"tests/manager/transferworker_test.cpp": [
{
"line": " QString token = \"invalid.token.value\";",
"line_number": 253,
"rule": "S106",
"reason": "Var naming | 2c1a8db034"
}
]
} |
bf61d0b to
68ce64c
Compare
|
Note
详情{
"tests/manager/transferworker_test.cpp": [
{
"line": " QString token = \"invalid.token.value\";",
"line_number": 253,
"rule": "S106",
"reason": "Var naming | 2c1a8db034"
}
]
} |
68ce64c to
c8837fd
Compare
|
Note
详情{
"tests/manager/transferworker_test.cpp": [
{
"line": " QString token = \"invalid.token.value\";",
"line_number": 253,
"rule": "S106",
"reason": "Var naming | 2c1a8db034"
}
]
} |
c8837fd to
53f1358
Compare
Add 216 unit tests for infrastructure/sslconf (108 tests, coverage 26%->95.7%) and lib/common/manager (108 tests, coverage 27.9%->81.9%). 为 infrastructure/sslconf 和 lib/common/manager 模块补充单元测试, sslconf 覆盖率从 26% 提升至 95.7%,manager 从 27.9% 提升至 81.9%。 Log: 补充 sslconf 和 manager 模块单元测试 Influence: 不影响现有功能,仅新增测试代码,提升模块测试覆盖率至 80% 以上。
53f1358 to
37f9fe2
Compare
deepin pr auto review★ 总体评分:75分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // sessionworker.cpp 修复示例:移除生产代码中的条件编译,统一进行异常捕获
case RPC_ERROR: {
WLOG << "error remote code: " << msg;
int code = 0;
try {
code = std::stoi(msg);
} catch (...) {
ELOG << "invalid error code: " << msg;
emit onConnectChanged(state, addr);
return false;
}
if (asio::error::host_unreachable == code
|| asio::error::timed_out == code) {
ELOG << "ping failed or timeout: " << msg;
}
// ...
}
// transferworker.cpp 修复示例:移除生产代码中的条件编译,统一进行异常捕获
bool TransferWorker::tryStartReceive(QStringList names, QString &ip, int port, QString &accessToken, QString &dirname) {
// ...
std::vector<std::string> webs;
try {
webs = _file_client->parseWeb(accessToken);
} catch (...) {
ELOG << "invalid access token, JWT parse failed";
return false;
}
// ...
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
|
Note
详情{
"tests/manager/transferworker_test.cpp": [
{
"line": " QString token = \"invalid.token.value\";",
"line_number": 256,
"rule": "S106",
"reason": "Var naming | 2c1a8db034"
}
]
} |
Add 216 unit tests for infrastructure/sslconf (108 tests, coverage 26%->95.7%) and lib/common/manager (108 tests, coverage 27.9%->81.9%).
为 infrastructure/sslconf 和 lib/common/manager 模块补充单元测试, sslconf 覆盖率从 26% 提升至 95.7%,manager 从 27.9% 提升至 81.9%。
Log: 补充 sslconf 和 manager 模块单元测试
Influence: 不影响现有功能,仅新增测试代码,提升模块测试覆盖率至 80% 以上。