Skip to content

test: characterize obs-data.c before port - #788

Merged
zackees merged 1 commit into
obs-rust:masterfrom
nathan-v:test/obs-data
Oct 15, 2026
Merged

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

Conversation

@nathan-v

Copy link
Copy Markdown
Contributor

Refs #784
Refs #444

What and why

Pins the current C behavior of libobs/obs-data.c before the port. This is the Phase 6 first core seam on #444. The test is cmocka, registered from tests.d, and it links OBS::libobs. There is no Rust in this PR. obs-data.h is unchanged, and obs_data_newref stays inline in the header.

The 8 tests passed locally with ENABLE_RUST_LIBOBS OFF and ON. obs-data.c is still compiled in both builds.

A few behaviors are marked characterized, not endorsed. json_loads is called without JSON_DECODE_ANY, so an array root becomes an empty object and a scalar root is rejected. A default-only or autoselect-only item is readable through the user getter, and JSON still omits an item with no user value unless with-defaults is requested. set_autoselect of a different type changes the item type. obs_data_item_remove drops the object's reference and leaves the caller's.

Please add the claimed label on #784; I cannot.

RED → GREEN

  • RED commit: none. This PR is the characterization, and the test passes against the current C file.
  • GREEN: test_obs_data, 8/8, ENABLE_RUST_LIBOBS OFF and ON on this Mac. The port PR carries the RED and GREEN commits.

Checklist

  • Base is master (or the description starts with a Stacked: note)
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): built with the ci-full label, or with scripting ON and cross-checked with clang and MSVC
  • Intentional differences from C listed in the parity test header and rust/README.md (ports)

No warning or flag changes in this PR. No Rust differences yet.

@nathan-v
nathan-v requested a review from zackees as a code owner October 15, 2026 00:35
cmocka test pinning the current C behavior of libobs/obs-data.c
ahead of the obs-data port. Phase 6, first core seam on obs-rust#444.
No Rust. The public header stays as it is, and obs_data_newref
stays inline.

Pins JSON parse and dump, missing keys, user/default/autoselect
precedence, apply/erase/clear, arrays and item iteration, vec2
and frame-rate helpers, and the safe file save/load path.

Odd cases are marked characterized, not endorsed. An array root
becomes an empty object, and a scalar root is rejected. A
default-only or autoselect-only item is readable through the
user getter. set_autoselect of a different type changes the
item type.

Refs obs-rust#784
Refs obs-rust#444

Local-Gate: v1 tree=f6453a233d5598d6f264ec2549e844b4e24f4696 secs=512 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1792025343,"gate":"rust/all/fmt","host":"linux-x86_64","key":"0468294dcc8688902914796a4a57e83c80c74e436e8d308dac7b0c4fde9ef6db","lane":"lint","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":52,"stamp":"0e6471e45b922beef26fe8141f338e89","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"0468294dcc8688902914796a4a57e83c80c74e436e8d308dac7b0c4fde9ef6db","lane":"lint","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":52,"stamp":"591c48ec1abd5203af1de92dab5b64d7","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"dffd0a853e89892f51ffe4d93ee9a2fd438f550032d62c6850f84b46a3da72e2","lane":"rust-test","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":123,"stamp":"e5a012bbdade16a321d5d8d6047cb156","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"1ac96f669b6590ace668e9edb8afee059802acf1ab3285563852b1096e39815c","lane":"cross","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":117,"stamp":"fc2619b15b2b265cf51d07e6235f480d","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"1ac96f669b6590ace668e9edb8afee059802acf1ab3285563852b1096e39815c","lane":"cross","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":117,"stamp":"2d06855feebb58c4b4441a8dbe5c0707","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"1ac96f669b6590ace668e9edb8afee059802acf1ab3285563852b1096e39815c","lane":"cross","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":117,"stamp":"ba4acb3eba3bdedc5f21200c0309375d","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"1ac96f669b6590ace668e9edb8afee059802acf1ab3285563852b1096e39815c","lane":"cross","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":117,"stamp":"2af46b1ef2c0238f0ad10718d669cef0","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"1ac96f669b6590ace668e9edb8afee059802acf1ab3285563852b1096e39815c","lane":"cross","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":117,"stamp":"40a65ca0da7e528a5ed1fca914369df0","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"1ac96f669b6590ace668e9edb8afee059802acf1ab3285563852b1096e39815c","lane":"cross","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":117,"stamp":"c646f268ce216a87071df7ddb7fdb1f5","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
Ci-Attestation: {"at":1792025343,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"dc773f3190d85f18abfa319f54807bd3a3e64712def8e34abe938e9f378a5ad4","lane":"tier2-linux","parents":["18e24cc432fd40eb74c1a102e941aa040a5708bf"],"secs":221,"stamp":"70c69492eac09e60e9ca153f02c24278","tree":"f6453a233d5598d6f264ec2549e844b4e24f4696","v":1,"via":"run"}
@zackees

zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member

Rebased onto master and ran the stamped local gate. This is the characterization step (passes on master by design, both lanes); the RED → GREEN comes with the port PR on #784.

  • Rebased on master, local gate passed; pushed as f87dc1f.

@zackees
zackees enabled auto-merge October 15, 2026 00:49
@zackees
zackees added this pull request to the merge queue Oct 15, 2026
Merged via the queue into obs-rust:master with commit a638cd8 Oct 15, 2026
22 checks passed
@nathan-v nathan-v mentioned this pull request Oct 15, 2026
4 of 6 tasks
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