Repository navigation
test: characterize callback/calldata.c before port (Refs #1439) - #1447
Merged
Merged
Conversation
Pin the stack layout and the get/set behavior of libobs/callback/calldata.c.h before the obs-callback port. Odd cases are marked characterized, not endorsed. Refs obs-rust#1439
zackees
approved these changes
Oct 19, 2026
zackees
left a comment
Member
There was a problem hiding this comment.
Coordinator review: LGTM. A test-only characterization of calldata.c.h before the port, registered in tests.d/. It pins the wire layout byte by byte (name length, name, data length, data, terminating 0), the 128-byte first allocation, the NULL/empty guards that leave outputs untouched, unaligned round-trips, and a bnum_allocs balance on every case. Marking odd behaviour as "characterized, not endorsed" is a good way to keep it pinned without blessing it. 11/11 against the C libobs.
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1439 (meta #1437). Characterization PR before the port, like #1442 for decl.
test/cmocka/test_calldata.cpins whatcalldata_get_data,calldata_set_data, andcalldata_get_stringdo today.callback/had no cmocka test for this file. The port may not edit this test.What and why
The public
struct calldataand the inline helpers incalldata.hstay as they are. This test records the stack they sit on: name length, name, data length, data, and a terminating 0. The first allocation is 128 bytes when the used size is smaller. A later parameter stays readable when an earlier one grows or shrinks.A few results are odd. They are pinned on purpose, with a comment that says characterized, not endorsed:
cd_ensure_capacitygrows when the needed size is equal to the capacity. A fixed buffer with one spare byte still refuses a one-byte grow, and logsTried to go above fixed calldata stack size!.calldata_clearzeroes the firstsize_tonly.calldata_get_stringreturns true and a null pointer. An empty string returns a pointer to"".long longanddoubleare both 8 bytes, socalldata_get_floatsucceeds on an int.RED → GREEN
calldata.c.hmatch the libobs that binary was built from.rust/obs-callback) follows, RED then GREEN. Tier 1 mirrors this test. Tier 3 compares against the C oracle.Checklist
master