From 722f49b54faec6251723ba9eb8a520520e5754db Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Wed, 18 Nov 2026 20:51:35 -0800 Subject: [PATCH 1/4] test: characterize legacy core type-catalog enumeration (Refs #5170) Record missing-extraction RED: the six catalog readers still live in obs.c.h; build_ci_audit/5170/contract.py fails because obs-type-catalog-enum.c.h does not exist. New test registers only test-owned types and preserves all existing C tests. --- test/cmocka/build/test-graph.json | 23 ++ test/cmocka/test_type_catalog_enum.c | 253 ++++++++++++++++++ .../tests.d/test_type_catalog_enum.cmake | 1 + 3 files changed, 277 insertions(+) create mode 100644 test/cmocka/test_type_catalog_enum.c create mode 100644 test/cmocka/tests.d/test_type_catalog_enum.cmake diff --git a/test/cmocka/build/test-graph.json b/test/cmocka/build/test-graph.json index 2a1e392c5e..867b4ba5c3 100644 --- a/test/cmocka/build/test-graph.json +++ b/test/cmocka/build/test-graph.json @@ -18497,6 +18497,15 @@ "libobs/data" ] }, + "test_type_catalog_enum": { + "sources": [ + "test/cmocka/test_type_catalog_enum.c" + ], + "libraries": [ + "OBS::libobs", + "OBS::native-test-cmocka" + ] + }, "test_ui_task_handler": { "sources": [ "test/cmocka/test_ui_task_handler.c" @@ -27595,6 +27604,20 @@ "working_directory": "${runtime}", "timeout_seconds": 120 }, + "test_type_catalog_enum": { + "target": "test_type_catalog_enum", + "command": [ + "${target}" + ], + "optional_prefixes": [ + [ + "xvfb-run", + "-a", + "-s", + "-screen 0 1280x1024x24 -noreset" + ] + ] + }, "test_ui_task_handler": { "target": "test_ui_task_handler", "command": [ diff --git a/test/cmocka/test_type_catalog_enum.c b/test/cmocka/test_type_catalog_enum.c new file mode 100644 index 0000000000..e8d80ab896 --- /dev/null +++ b/test/cmocka/test_type_catalog_enum.c @@ -0,0 +1,253 @@ +/* Characterize the six legacy index-to-ID catalogs before extraction (Refs #5170). + * A live core and a writable output on success are required. IDs are borrowed; + * failed lookups return before touching the output, which may then be NULL. + * Only test-owned registrations are asserted: CMake and Cargo-native reference + * libraries may register different built-in/module types (#5182). */ +#include +#include +#include +#include +#include +#include +#include + +struct catalog { + bool (*enumerate)(size_t, const char **); + const char *sentinel; + const char *ids[2]; +}; + +static const struct catalog catalogs[] = { + {obs_enum_input_types, "input untouched", {"catalog_input_z", "catalog_input_a"}}, + {obs_enum_filter_types, "filter untouched", {"catalog_filter_z", "catalog_filter_a"}}, + {obs_enum_transition_types, "transition untouched", {"catalog_transition_z", "catalog_transition_a"}}, + {obs_enum_output_types, "output untouched", {"catalog_output_z", "catalog_output_a"}}, + {obs_enum_encoder_types, "encoder untouched", {"catalog_encoder_z", "catalog_encoder_a"}}, + {obs_enum_service_types, "service untouched", {"catalog_service_z", "catalog_service_a"}}, +}; + +static void expect_end(const struct catalog *catalog, size_t index) +{ + const char *id = catalog->sentinel; + assert_false(catalog->enumerate(index, &id)); + assert_ptr_equal(id, catalog->sentinel); + assert_false(catalog->enumerate(index, NULL)); +} + +struct startup_probe { + log_handler_t previous; + void *previous_param; + bool ran; +}; + +#if defined(__GNUC__) || defined(__clang__) +static void probe_empty(int level, const char *format, va_list args, void *param) __attribute__((format(printf, 2, 0))); +#endif +static void probe_empty(int level, const char *format, va_list args, void *param) +{ + struct startup_probe *probe = param; + const char *id; + /* Startup logging exposes the initialized core before built-in types. + * The existing source enumeration characterization uses this same seam. */ + if (!probe->ran && obs_initialized() && !obs_enum_source_types(0, &id)) { + probe->ran = true; + for (size_t i = 0; i < 6; i++) { + expect_end(&catalogs[i], 0); + expect_end(&catalogs[i], SIZE_MAX); + } + } + if (probe->previous) + probe->previous(level, format, args, probe->previous_param); +} + +static void empty_catalogs(void **state) +{ + (void)state; + struct startup_probe probe = {0}; + base_get_log_handler(&probe.previous, &probe.previous_param); + base_set_log_handler(probe_empty, &probe); + bool started = obs_startup("en-US", NULL, NULL); + base_set_log_handler(probe.previous, probe.previous_param); + if (started) + obs_shutdown(); + assert_true(started); + assert_true(probe.ran); +} + +static const char *get_name(void *data) +{ + (void)data; + return "Type catalog fixture"; +} + +static void unused_destroy(void *data) +{ + (void)data; + assert_true(false); +} + +static void *output_create(obs_data_t *settings, obs_output_t *output) +{ + (void)settings; + (void)output; + assert_true(false); + return NULL; +} + +static bool output_start(void *data) +{ + (void)data; + assert_true(false); + return false; +} + +static void output_stop(void *data, uint64_t timestamp) +{ + (void)data; + (void)timestamp; + assert_true(false); +} + +static void *encoder_create(obs_data_t *settings, obs_encoder_t *encoder) +{ + (void)settings; + (void)encoder; + assert_true(false); + return NULL; +} + +static bool encoder_encode(void *data, struct encoder_frame *frame, struct encoder_packet *packet, bool *received) +{ + (void)data; + (void)frame; + (void)packet; + (void)received; + assert_true(false); + return false; +} + +static void *service_create(obs_data_t *settings, obs_service_t *service) +{ + (void)settings; + (void)service; + assert_true(false); + return NULL; +} + +static const char *service_protocol(void *data) +{ + (void)data; + assert_true(false); + return NULL; +} + +static void register_type(size_t catalog, const char *id) +{ + if (catalog < 3) { + const enum obs_source_type types[] = {OBS_SOURCE_TYPE_INPUT, OBS_SOURCE_TYPE_FILTER, + OBS_SOURCE_TYPE_TRANSITION}; + struct obs_source_info info = {0}; + info.id = id; + info.type = types[catalog]; + info.get_name = get_name; + obs_register_source(&info); + } else if (catalog == 3) { + struct obs_output_info info = {0}; + info.id = id; + info.get_name = get_name; + info.create = output_create; + info.destroy = unused_destroy; + info.start = output_start; + info.stop = output_stop; + obs_register_output(&info); + } else if (catalog == 4) { + struct obs_encoder_info info = {0}; + info.id = id; + info.type = OBS_ENCODER_VIDEO; + info.codec = "catalog-codec"; + info.get_name = get_name; + info.create = encoder_create; + info.destroy = unused_destroy; + info.encode = encoder_encode; + obs_register_encoder(&info); + } else { + struct obs_service_info info = {0}; + info.id = id; + info.get_name = get_name; + info.create = service_create; + info.destroy = unused_destroy; + info.get_protocol = service_protocol; + obs_register_service(&info); + } +} + +static size_t count_types(const struct catalog *catalog) +{ + size_t count = 0; + const char *id; + while (catalog->enumerate(count, &id)) { + assert_true(count < 1024); + count++; + } + return count; +} + +static int setup(void **state) +{ + (void)state; + return obs_startup("en-US", NULL, NULL) ? 0 : -1; +} + +static int teardown(void **state) +{ + (void)state; + /* No instances or owned type_data. Real shutdown frees the registries + * and versioned source IDs; the caller's IDs have static lifetime. */ + obs_shutdown(); + return 0; +} + +static void populated_catalogs(void **state) +{ + (void)state; + size_t base[6], added[6] = {0}; + const char *borrowed[6][2]; + for (size_t c = 0; c < 6; c++) + base[c] = count_types(&catalogs[c]); + + /* Interleave catalogs and reverse lexical ID order. Each independent + * registry appends exactly its own registrations without sorting. */ + for (size_t entry = 0; entry < 2; entry++) { + for (size_t c = 0; c < 6; c++) { + register_type(c, catalogs[c].ids[entry]); + added[c]++; + for (size_t other = 0; other < 6; other++) + assert_int_equal(count_types(&catalogs[other]), base[other] + added[other]); + const char *id = catalogs[c].sentinel; + assert_true(catalogs[c].enumerate(base[c] + entry, &id)); + assert_string_equal(id, catalogs[c].ids[entry]); + borrowed[c][entry] = id; + } + } + for (size_t c = 0; c < 6; c++) { + for (size_t entry = 0; entry < 2; entry++) { + const char *id = catalogs[c].sentinel; + assert_true(catalogs[c].enumerate(base[c] + entry, &id)); + assert_ptr_equal(id, borrowed[c][entry]); + assert_string_equal(id, catalogs[c].ids[entry]); + } + expect_end(&catalogs[c], base[c] + 2); + expect_end(&catalogs[c], base[c] + 3); + expect_end(&catalogs[c], SIZE_MAX); + assert_string_equal(borrowed[c][0], catalogs[c].ids[0]); + } +} + +int main(void) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test(empty_catalogs), + cmocka_unit_test_setup_teardown(populated_catalogs, setup, teardown), + }; + return cmocka_run_group_tests(tests, NULL, NULL); +} diff --git a/test/cmocka/tests.d/test_type_catalog_enum.cmake b/test/cmocka/tests.d/test_type_catalog_enum.cmake new file mode 100644 index 0000000000..d85a840326 --- /dev/null +++ b/test/cmocka/tests.d/test_type_catalog_enum.cmake @@ -0,0 +1 @@ +# Registered in the canonical native test graph (test/cmocka/build/test-graph.json). From 71ca138eee0c3c672af4cc55c4c382d83a780f70 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Wed, 18 Nov 2026 20:59:32 -0800 Subject: [PATCH 2/4] test: provide required transition registration callback (Refs #5170) The original C rejects a transition without audio_render. With the required unused callback, nine focused targets pass three repeats against both original-C-reference and hybrid libobs; 1769 exported symbols agree. --- test/cmocka/test_type_catalog_enum.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/cmocka/test_type_catalog_enum.c b/test/cmocka/test_type_catalog_enum.c index e8d80ab896..5e0c814451 100644 --- a/test/cmocka/test_type_catalog_enum.c +++ b/test/cmocka/test_type_catalog_enum.c @@ -86,6 +86,19 @@ static void unused_destroy(void *data) assert_true(false); } +static bool source_audio_render(void *data, uint64_t *timestamp, struct obs_source_audio_mix *mix, uint32_t mixers, + size_t channels, size_t sample_rate) +{ + (void)data; + (void)timestamp; + (void)mix; + (void)mixers; + (void)channels; + (void)sample_rate; + assert_true(false); + return false; +} + static void *output_create(obs_data_t *settings, obs_output_t *output) { (void)settings; @@ -150,6 +163,7 @@ static void register_type(size_t catalog, const char *id) info.id = id; info.type = types[catalog]; info.get_name = get_name; + info.audio_render = source_audio_render; obs_register_source(&info); } else if (catalog == 3) { struct obs_output_info info = {0}; From 9b7bb92a109c9145ddc0bd46fc1a56366e171dbd Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Wed, 18 Nov 2026 20:59:34 -0800 Subject: [PATCH 3/4] libobs: extract core type-catalog enumeration verbatim (Refs #5170) Move only the six index-to-ID catalog readers into the existing sorted core unity group. Existing source-set and module membership covers the extracted implementation. The extraction/inventory contract is now GREEN. --- libobs/build/libobs.core+.h.c | 1 + libobs/obs-type-catalog-enum.c.h | 49 ++++++++++++++++++++++++++++++++ libobs/obs.c.h | 48 ------------------------------- 3 files changed, 50 insertions(+), 48 deletions(-) create mode 100644 libobs/obs-type-catalog-enum.c.h diff --git a/libobs/build/libobs.core+.h.c b/libobs/build/libobs.core+.h.c index 2c62980aec..5e1d03217d 100644 --- a/libobs/build/libobs.core+.h.c +++ b/libobs/build/libobs.core+.h.c @@ -50,6 +50,7 @@ #include "libobs/obs-set-locale.c.h" #include "libobs/obs-set-output-source-fields.c.h" #include "libobs/obs-shutdown-detach.c.h" +#include "libobs/obs-type-catalog-enum.c.h" #include "libobs/obs-ui-task-handler-fields.c.h" #include "libobs/obs-video-info-query.c.h" #include "libobs/obs-video-level-queries.c.h" diff --git a/libobs/obs-type-catalog-enum.c.h b/libobs/obs-type-catalog-enum.c.h new file mode 100644 index 0000000000..addf6ed2ab --- /dev/null +++ b/libobs/obs-type-catalog-enum.c.h @@ -0,0 +1,49 @@ +#include "libobs/build/libobs.pch.h" + +bool obs_enum_input_types(size_t idx, const char **id) +{ + if (idx >= obs->input_types.num) + return false; + *id = obs->input_types.array[idx].id; + return true; +} + +bool obs_enum_filter_types(size_t idx, const char **id) +{ + if (idx >= obs->filter_types.num) + return false; + *id = obs->filter_types.array[idx].id; + return true; +} + +bool obs_enum_transition_types(size_t idx, const char **id) +{ + if (idx >= obs->transition_types.num) + return false; + *id = obs->transition_types.array[idx].id; + return true; +} + +bool obs_enum_output_types(size_t idx, const char **id) +{ + if (idx >= obs->output_types.num) + return false; + *id = obs->output_types.array[idx].id; + return true; +} + +bool obs_enum_encoder_types(size_t idx, const char **id) +{ + if (idx >= obs->encoder_types.num) + return false; + *id = obs->encoder_types.array[idx].id; + return true; +} + +bool obs_enum_service_types(size_t idx, const char **id) +{ + if (idx >= obs->service_types.num) + return false; + *id = obs->service_types.array[idx].id; + return true; +} diff --git a/libobs/obs.c.h b/libobs/obs.c.h index 1f663ddac4..6558500788 100644 --- a/libobs/obs.c.h +++ b/libobs/obs.c.h @@ -1745,14 +1745,6 @@ bool obs_get_audio_info2(struct obs_audio_info2 *oai2) } } -bool obs_enum_input_types(size_t idx, const char **id) -{ - if (idx >= obs->input_types.num) - return false; - *id = obs->input_types.array[idx].id; - return true; -} - const char *obs_get_latest_input_type_id(const char *unversioned_id) { struct obs_source_info *latest = NULL; @@ -1777,46 +1769,6 @@ const char *obs_get_latest_input_type_id(const char *unversioned_id) return latest->id; } -bool obs_enum_filter_types(size_t idx, const char **id) -{ - if (idx >= obs->filter_types.num) - return false; - *id = obs->filter_types.array[idx].id; - return true; -} - -bool obs_enum_transition_types(size_t idx, const char **id) -{ - if (idx >= obs->transition_types.num) - return false; - *id = obs->transition_types.array[idx].id; - return true; -} - -bool obs_enum_output_types(size_t idx, const char **id) -{ - if (idx >= obs->output_types.num) - return false; - *id = obs->output_types.array[idx].id; - return true; -} - -bool obs_enum_encoder_types(size_t idx, const char **id) -{ - if (idx >= obs->encoder_types.num) - return false; - *id = obs->encoder_types.array[idx].id; - return true; -} - -bool obs_enum_service_types(size_t idx, const char **id) -{ - if (idx >= obs->service_types.num) - return false; - *id = obs->service_types.array[idx].id; - return true; -} - void obs_enter_graphics(void) { if (obs->video.graphics) From a572cc2a49a036459d4ebf97b63dae4cd3e1e355 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Wed, 18 Nov 2026 21:01:10 -0800 Subject: [PATCH 4/4] test: pin catalog ID ownership across registration and enumeration (Refs #5170) Ci-Attestation: {"at":1795067244,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":181,"stamp":"c3ab5f6e0f90447bf18b54816636ba76","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067244,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":181,"stamp":"1384b61b95aa73e26f332a14da2286af","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067244,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":181,"stamp":"37868e093c846fb5734ff086dc152e12","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067244,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":181,"stamp":"db61fd5383bc5605b8e68578f721f468","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067060,"gate":"general/all/client-lint","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"923bdc347caaacd2221d6b5fc1b163c2","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067244,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":181,"stamp":"ba2107fb49c7548f2223d6be7e2a36bc","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"eaf67cd74d87bed03df87f124e8c5b6c","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"267aae2e6d77f5150b06107c8a4a276b","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"f157496b021f45f694f0fc2e8743c2fc","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"b30b30d0c447dbbdf4d914b1dd262644","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"40f7d04bcb7d3cb961af730c51922937","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"dc5c3d1cde463f99be5e9ec6b31f988b","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"5e96818f956d3834ad10d9380f7f6df8","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"2084ba3529b6ab5a76fce4df5aa8ecca","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"e71ccb8bad574594c68d258fe3289e8c","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"4499e45768fb3f030de005a1167950e1","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067060,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"79a665db453ed776ad89ce5f9f0916ed","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795067061,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"1af45ac14bec91eb989805fb6aacac42d8e01803f324466a27ee650400dd4ec6","lane":"client-lint","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":815,"stamp":"b0b2552caf283b53d2838c3937e7b212","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Ci-Attestation: {"at":1795068061,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"d8df5b44e9b83173042a0e0cf17d8d2a57025fb5fd64e5423bd2fe3d710c9148","lane":"client-test-x86_64-unknown-linux-gnu","parents":["9b7bb92a109c9145ddc0bd46fc1a56366e171dbd"],"secs":816,"stamp":"19c1be5cbc1b9e22ed58cdc105a10adc","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794","v":1,"via":"run"} Client-Checks: {"checks":{"base":"91b0cdf8785961f0ba0e825858d0a6a3a18780c6","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/obs-type-catalog-enum.c.h","libobs/obs.c.h","test/cmocka/build/test-graph.json","test/cmocka/test_type_catalog_enum.c","test/cmocka/tests.d/test_type_catalog_enum.cmake"],"head":"bae6db805def2efca1ae951548b5e3394ca84cd5","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"4400e84b26e75b0543f00d0b5fcf930bcd11630a299ea2314efc166c702004d0","tree":"ab237533ea9a99ac0bb397bd5835da6ae0864794"}} --- test/cmocka/test_type_catalog_enum.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/cmocka/test_type_catalog_enum.c b/test/cmocka/test_type_catalog_enum.c index 5e0c814451..175a6bfd62 100644 --- a/test/cmocka/test_type_catalog_enum.c +++ b/test/cmocka/test_type_catalog_enum.c @@ -206,6 +206,18 @@ static size_t count_types(const struct catalog *catalog) return count; } +static void expect_source_pointer(const char *expected, const char *borrowed) +{ + const char *id; + for (size_t index = 0; obs_enum_source_types(index, &id); index++) { + if (strcmp(id, expected) == 0) { + assert_ptr_equal(id, borrowed); + return; + } + } + assert_true(false); +} + static int setup(void **state) { (void)state; @@ -249,6 +261,12 @@ static void populated_catalogs(void **state) assert_true(catalogs[c].enumerate(base[c] + entry, &id)); assert_ptr_equal(id, borrowed[c][entry]); assert_string_equal(id, catalogs[c].ids[entry]); + /* Sources own a versioned ID copy shared by both source + * catalogs; the other registries borrow the caller's ID. */ + if (c < 3) + expect_source_pointer(catalogs[c].ids[entry], id); + else + assert_ptr_equal(id, catalogs[c].ids[entry]); } expect_end(&catalogs[c], base[c] + 2); expect_end(&catalogs[c], base[c] + 3);