Skip to content

test: add lsof testing and builtin coverage for lsof tool - #127

Open
yuKing123-king wants to merge 1 commit into
DKapture:mainfrom
yuKing123-king:test/lsof
Open

test: add lsof testing and builtin coverage for lsof tool#127
yuKing123-king wants to merge 1 commit into
DKapture:mainfrom
yuKing123-king:test/lsof

Conversation

@yuKing123-king

Copy link
Copy Markdown
Contributor

本次修改集中在 test 目录,修改内容如下

1.添加了 lsof 的 BUILTIN 单测。测试内容围绕工具实际功能补充了较完整的回归验证,覆盖了以下几类行为:

  • 测试能否正常输出
  • 测试-p path能否正常过滤
  • 测试-d dev -i inode能否正常过滤
  • 测试 -p 传空字符串时应报错
  • 测试 -d 传非数字时应报错
  • 测试 -d 传混合字符串时应报错
  • 测试 -i 传非数字时应报错
  • 测试 -i 传混合字符串时应报错
  • 测试仅传 -d 时应报错
  • 测试仅传 -i 时应报错
  • 测试 -p 和 -d/-i 混用时应报错

2.在test/Makefile 中补齐测试目标的链接依赖;

3.在test/mock.cpp 中修正 skeleton 对象在全局容器中的分配、指针回填和销毁逻辑,避免因扩容和错索引导致的崩溃;

Signed-off-by: Wang Yu <wangyu6@uniontech.com>
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.

1 participant