33 * @brief Unit tests for PARAM_GROUP formatting (iteration order, failure propagation)
44 *
55 * format_field is mocked so these tests exercise only GROUP-level logic:
6- * sequential iteration, BUNDLED fallback , empty groups, and sub-field failure.
6+ * sequential iteration, BUNDLED rejection , empty groups, and sub-field failure.
77 */
88
99#include <stdarg.h>
@@ -119,23 +119,19 @@ static void test_group_sequential_two_subfields(void **state) {
119119}
120120
121121/**
122- * BUNDLED iteration is not yet implemented; the group falls back to SEQUENTIAL.
123- * Verify the output order is identical to SEQUENTIAL .
122+ * BUNDLED iteration is unsupported and must be rejected explicitly
123+ * (no silent fallback to sequential rendering) .
124124 */
125- static void test_group_bundled_falls_back_to_sequential (void * * state ) {
125+ static void test_group_bundled_rejected (void * * state ) {
126126 (void ) state ;
127127 MAKE_FIELD (sub2 , "Value" , PARAM_TYPE_RAW );
128128 MAKE_NODE (node2 , & sub2 , NULL );
129129 MAKE_FIELD (sub1 , "Token ID" , PARAM_TYPE_RAW );
130130 MAKE_NODE (node1 , & sub1 , & node2 );
131131 s_field outer = make_group_field (GROUP_ITER_BUNDLED , & node1 );
132132
133- expect_string (__wrap_format_field , field -> name , "Token ID" );
134- will_return (__wrap_format_field , true);
135- expect_string (__wrap_format_field , field -> name , "Value" );
136- will_return (__wrap_format_field , true);
137-
138- assert_true (format_param_group (& outer ));
133+ // format_field must never be called when iteration type is BUNDLED.
134+ assert_false (format_param_group (& outer ));
139135}
140136
141137static void test_group_subfield_failure_propagates (void * * state ) {
@@ -162,7 +158,7 @@ int main(void) {
162158 cmocka_unit_test (test_group_empty ),
163159 cmocka_unit_test (test_group_sequential_one_subfield ),
164160 cmocka_unit_test (test_group_sequential_two_subfields ),
165- cmocka_unit_test (test_group_bundled_falls_back_to_sequential ),
161+ cmocka_unit_test (test_group_bundled_rejected ),
166162 cmocka_unit_test (test_group_subfield_failure_propagates ),
167163 };
168164 return cmocka_run_group_tests (tests , NULL , NULL );
0 commit comments