Skip to content

补充单元测试#89

Merged
owent merged 1 commit intomainfrom
dev
Mar 19, 2026
Merged

补充单元测试#89
owent merged 1 commit intomainfrom
dev

Conversation

@owent
Copy link
Copy Markdown
Owner

@owent owent commented Mar 19, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 19, 2026 08:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 为 atframe_utils 补充了多处单元测试覆盖面,并在 CI 覆盖率任务中对 lcov 输出做了过滤处理,以便得到更聚焦的覆盖率报告。

Changes:

  • time_utilityini_loader::ini_valuefile_system 等模块补充/扩展测试用例。
  • 新增 shell_fontplatform_compatmurmur_hashlog_formatter 的测试文件,提升模块级回归保障。
  • CI 覆盖率流程中新增 lcov --remove 过滤规则,生成精简后的 coverage.info

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/case/time_test.cpp 新增 time_utility 若干接口的基础测试用例。
test/case/shell_font_test.cpp 新增 cli::shell_font/shell_stream 相关测试。
test/case/platform_compat_test.cpp 新增 platform::get_errno/get_strerrno 测试。
test/case/murmur_hash_test.cpp 新增 MurmurHash2/3 多种变体与分布性测试。
test/case/log_formatter_test.cpp 新增 log_formatter 格式化符号与边界输入测试。
test/case/ini_loader_test.cpp ini_value 增补基础/路径/类型转换/时长解析测试。
test/case/file_system_test.cpp 增补路径拆分、绝对路径判断、重命名、非存在文件等测试。
ci/do_ci.sh 覆盖率任务生成 coverage-full.info 并过滤 sample/test/tools/third_party 后输出 coverage.info

Comment on lines +228 to +234
CASE_TEST(ini_loader, ini_value_as_float_types) {
atfw::util::config::ini_value val;
val.add("3.14");

CASE_EXPECT_LE(std::abs(3.14f - val.as_float()), 0.01f);
CASE_EXPECT_LE(std::abs(3.14 - val.as_double()), 0.01);
}
Comment on lines +196 to +201
CASE_EXPECT_FALSE(atfw::util::file_system::is_exist("/nonexistent/path/to/file.txt"));
}

CASE_TEST(file_system, file_size_nonexistent) {
size_t sz = 0;
CASE_EXPECT_FALSE(atfw::util::file_system::file_size("/nonexistent/path/to/file.txt", sz));
@owent owent merged commit ec8c31a into main Mar 19, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants