Skip to content

test: Characterize obs-properties.c before port - #830

Merged
zackees merged 2 commits into
masterfrom
test/obs-properties
Oct 15, 2026
Merged

zackees merged 2 commits into
masterfrom
test/obs-properties

Conversation

@zackees

@zackees zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member

Refs #828 (step 1 of the claim: characterization, no Rust).

New Tier 2 test test/cmocka/test_obs_properties.c (registered via tests.d/test_obs_properties.cmake; no existing test edited). It pins the current C behavior of libobs/obs-properties.c:

  • creation, params (old param destroyed on replace), flags, NULL handles;
  • every obs_properties_add_* type with its getters and setters, and the defaults each getter returns for the wrong type;
  • insertion-order iteration, lookup and removal reaching into groups, names unique across the whole tree from any level;
  • groups: parent links, refused self/recursive/clashing groups, removing a group frees its names;
  • list items (add/insert/remove/clear/disable, wrong-format adds), frame-rate options and ranges, buttons with and without priv;
  • obs_property_modified (topmost parent) and obs_properties_apply_settings (group content before the group, called back in reverse, with the props it was called on).

Characterized, not endorsed: the list bool getter reads the union's double; a directory path drops its filter; a non-button's URL is "" but a button without one is NULL; a non-group's group type is OBS_COMBO_INVALID.

Left out so the test stays sanitizer-clean, worth their own issues: a FILE_SAVE path's filter is never freed, and obs_property_button_set_url leaks the previous URL.

Local: rust/tools/linux-validate/run.sh --repeat 3 --tests test_obs_properties: 245/245 OFF and ON, 3 repeats each; ./lint ok.

C only, no Rust: test_obs_properties pins creation, every property
type's getters and setters, wrong-type defaults, lookup and removal
through groups, tree-wide unique names, group recursion and clash
checks, list and frame-rate items, buttons, and the modified/
apply_settings callback order. Odd cases are marked characterized, not
endorsed.

Refs #828
@zackees
zackees added this pull request to the merge queue Oct 15, 2026
Merged via the queue into master with commit 1e7ce13 Oct 15, 2026
23 checks passed
@zackees
zackees deleted the test/obs-properties branch October 26, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant