Skip to content

test: characterize obs-missing-files.c before port (Refs #1459) - #1460

Merged
zackees merged 1 commit into
obs-rust:masterfrom
nathan-v:test/missing-files
Oct 19, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
nathan-v:test/missing-files

Conversation

@nathan-v

@nathan-v nathan-v commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1459. This is the characterization before the port. No Rust in this change. The port may not edit this test.

test/cmocka/test_missing_files.c pins what libobs/obs-missing-files.c.h does today. It is registered in test/cmocka/tests.d/test_missing_files.cmake. The source-name case calls obs_startup, so on Linux the test is wrapped with xvfb-run, the same way test_audio_io is. test/cmocka/test_missing_files_list.c stays as it is. That one is the frontend leak regression for --disable-missing-files-check.

Test Pinned behavior
empty_list_test create, count 0, destroy. One allocation for the list.
path_copy_test the path is a copy. A script file stores no source name.
null_and_empty_path_test a null path stays null. An empty path is its own heap copy.
direct_destroy_test characterized, not endorsed: obs_missing_file_destroy frees the file while its ref is still 1.
release_null_test obs_missing_file_release(NULL) returns.
add_does_not_ref_test characterized, not endorsed: add_file stores the pointer and does not take a reference. Destroying the list frees the file.
insertion_order_test files stay in add order. get_file does not allocate.
null_entry_test characterized, not endorsed: a null entry is stored. Destroy releases it, and release(NULL) returns.
append_keeps_files_test append takes a reference. Destroying the source list leaves the destination's files alive.
append_empty_test appending an empty list leaves the destination as it was.
script_and_unknown_issue_test characterized, not endorsed: a script file and an unknown type store the callback and do not call it. Neither stores a source name.
null_source_issue_test characterized, not endorsed: a SOURCE file with a null source stores a null name, and issue_callback returns without calling.
source_snapshot_test the source name is a copy taken at create. Renaming the source later leaves that copy. issue_callback goes through obs_source_replace_missing_file: the callback gets the source's private data, the new path pointer, and the file's data pointer. A null new path is passed through.

Every case checks bnum_allocs().

Not called, because the C crashes or does not return: a null list, a null file, get_file past the end, appending a list to itself (the loop grows the array it walks), a SOURCE file with a null callback and a live source, and adding the same file twice without an extra reference.

How this was run

  • macOS arm64, RelWithDebInfo, C libobs (build_rust_OFF). Homebrew cmocka 2.0.2 aborts on Team ID when the test is launched in place. Copied the binary and libcmocka into $TMPDIR, signed both ad-hoc, and the run passed 13/13, including source_snapshot_test.
  • Linux aarch64, image obs-rust-linux-validate (Ubuntu 26.04, Docker Desktop). This is the arm64 image. CI's Tier 2 job is x86_64. ldd loaded /build/tree/libobs/libobs.so.30 for OFF and /build/tree/libobs-with-rust/libobs.so.30 for ON. Each library exports the 12 missing-file symbols. Under xvfb-run, test_missing_files passed 13/13 in both modes, including source_snapshot_test (obs_startup logged "Unable to open X display" and still came up). test_missing_files_list passed 4/4 in both modes. The file is still C in both libraries. A full OFF ctest of that tree stopped on four other tests: test_group_empty_bounds, test_scene_dup_group_children, test_ws_batch_order, test_ws_current_scene_removed. An earlier build was killed by the zccache stall window and signal 137 while compiling unrelated Qt objects.

Checklist

  • Base is master
  • I claimed the issue (rust: Port obs-missing-files.c to obs-missing-files #1459)
  • Characterization only. The port is the next PR
  • User-visible change: not applicable (no user-visible change)
  • Local gate stamped. PR CI runs the full suite
  • No warning or flag changes
  • No intentional differences. This PR does not port the file

Pin list create and destroy, path copies, add_file versus append
refcounts, script and unknown types, a null source, and the
source-name snapshot plus issue_callback. Every case checks
bnum_allocs.

Refs obs-rust#1459
@zackees
zackees added this pull request to the merge queue Oct 19, 2026
Merged via the queue into obs-rust:master with commit 1024960 Oct 19, 2026
23 checks passed
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.

2 participants