Skip to content

Fix: 修复缓冲区容量API并补充测试用例#42

Merged
530china merged 1 commit into
masterfrom
develop
Feb 2, 2026
Merged

Fix: 修复缓冲区容量API并补充测试用例#42
530china merged 1 commit into
masterfrom
develop

Conversation

@530china

@530china 530china commented Feb 2, 2026

Copy link
Copy Markdown
Owner

What: as follows:

  1. 修复 get_bits_btn_buffer_capacity() 返回实际可用容量(SIZE-1)而非数组大小;
  2. 添加 BITS_BTN_MAX_BUTTONS 宏定义(基于 button_mask_type_t 大小);
  3. 增强参数校验:添加 btns_cnt 超限检查(-5)、单按钮 param NULL 检查(-6)、组合按钮 param NULL 检查(-7);
  4. 优化 bits_btn_write_buffer_overwrite_c11 函数逻辑(调整 current_read 读取时机);
  5. 修正 bits_btn_clear_buffer_c11 中的 memory_order_relaxed 为 memory_order_release;
  6. bits_button_set_buffer_ops 声明添加 #ifdef BITS_BTN_USE_USER_BUFFER 条件编译;
  7. 补充7个测试用例:参数校验4个(按钮数超限、param NULL)、缓冲区覆写3个(数据正确性、多轮覆写、计数准确性);
  8. 更新文档:bits_button_init 添加错误码说明、get_bits_btn_buffer_capacity 说明容量语义;

What: as follows:
1. 修复 get_bits_btn_buffer_capacity() 返回实际可用容量(SIZE-1)而非数组大小;
2. 添加 BITS_BTN_MAX_BUTTONS 宏定义(基于 button_mask_type_t 大小);
3. 增强参数校验:添加 btns_cnt 超限检查(-5)、单按钮 param NULL 检查(-6)、组合按钮 param NULL 检查(-7);
4. 优化 bits_btn_write_buffer_overwrite_c11 函数逻辑(调整 current_read 读取时机);
5. 修正 bits_btn_clear_buffer_c11 中的 memory_order_relaxed 为 memory_order_release;
6. bits_button_set_buffer_ops 声明添加 #ifdef BITS_BTN_USE_USER_BUFFER 条件编译;
7. 补充7个测试用例:参数校验4个(按钮数超限、param NULL)、缓冲区覆写3个(数据正确性、多轮覆写、计数准确性);
8. 更新文档:bits_button_init 添加错误码说明、get_bits_btn_buffer_capacity 说明容量语义;
@530china 530china merged commit 99c0486 into master Feb 2, 2026
10 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.

1 participant