The unit tests for fl_fss_payload_header_map() are lacking significant combinations and permutations.
This, however, is being considered good enough for a first pass.
More complex and broader cases will hopefully be handled in some likely relatively distant future.
The null_quantity flag does not make any sense as the variable "total" can be 0 and that should not logically be considered NULL.
Make sure strings are NULL terminated for the cases where the code adds an extra space and then unassigned the used length of that space.
Handle cases where range.start > range.stop, aka NULL range.
Various other fixes.
case f_abstruse_triple_e:
if (abstruse->is.a_triple.a.size) {
- return f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_triple.a.string, &abstruse->is.a_triple.a.used, &abstruse->is.a_triple.a.size);
+ const f_status_t status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_triple.a.string, &abstruse->is.a_triple.a.used, &abstruse->is.a_triple.a.size);
+ if (F_status_is_error(status)) return status;
}
if (abstruse->is.a_triple.b.size) {
- return f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_triple.b.string, &abstruse->is.a_triple.b.used, &abstruse->is.a_triple.b.size);
+ const f_status_t status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_triple.b.string, &abstruse->is.a_triple.b.used, &abstruse->is.a_triple.b.size);
+ if (F_status_is_error(status)) return status;
}
if (abstruse->is.a_triple.c.size) {
- return f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_triple.c.string, &abstruse->is.a_triple.c.used, &abstruse->is.a_triple.c.size);
+ const f_status_t status = f_memory_array_resize(0, sizeof(f_char_t), (void **) &abstruse->is.a_triple.c.string, &abstruse->is.a_triple.c.used, &abstruse->is.a_triple.c.size);
+ if (F_status_is_error(status)) return status;
}
break;
* - null_map_value: Types of map and maps has empty strings (such as "") added for NULL values (used is 0) for the map value.
* - null_map_value_name: An enumeration value representing both null_map_name and null_map_value keys being set.
* - null_maps: Types of map and maps have empty strings added (such as "") added for when null_map_key and null_map_value are not set and both map key and map value have NULL values (used is 0).
- * - null_quantity: Types of quantity and quantitys have empty strings added (such as "") for when start > stop, aka NULL quantitys.
* - null_quantitys: Types of quantitys have empty strings added (such as "") added for when the array is empty.
* - null_range: Types of range and ranges have empty strings added (such as "") for when start > stop, aka NULL ranges.
* - null_ranges: Types of ranges have empty strings added (such as "") added for when the array is empty.
f_fss_payload_header_map_flag_null_map_value_e = 0x100000,
f_fss_payload_header_map_flag_null_map_value_name_e = 0x180000,
f_fss_payload_header_map_flag_null_maps_e = 0x200000,
- f_fss_payload_header_map_flag_null_quantity_e = 0x400000,
- f_fss_payload_header_map_flag_null_quantitys_e = 0x800000,
- f_fss_payload_header_map_flag_null_range_e = 0x1000000,
- f_fss_payload_header_map_flag_null_ranges_e = 0x2000000,
- f_fss_payload_header_map_flag_null_string_e = 0x4000000,
- f_fss_payload_header_map_flag_null_strings_e = 0x8000000,
- f_fss_payload_header_map_flag_null_triple_e = 0x10000000,
- f_fss_payload_header_map_flag_null_triples_e = 0x20000000,
- f_fss_payload_header_map_flag_quote_double_e = 0x40000000,
- f_fss_payload_header_map_flag_quote_grave_e = 0x80000000,
- f_fss_payload_header_map_flag_quote_single_e = 0x10000000,
- f_fss_payload_header_map_flag_last_e = 0x20000000,
+ f_fss_payload_header_map_flag_null_quantitys_e = 0x400000,
+ f_fss_payload_header_map_flag_null_range_e = 0x800000,
+ f_fss_payload_header_map_flag_null_ranges_e = 0x1000000,
+ f_fss_payload_header_map_flag_null_string_e = 0x2000000,
+ f_fss_payload_header_map_flag_null_strings_e = 0x4000000,
+ f_fss_payload_header_map_flag_null_triple_e = 0x8000000,
+ f_fss_payload_header_map_flag_null_triples_e = 0x10000000,
+ f_fss_payload_header_map_flag_quote_double_e = 0x20000000,
+ f_fss_payload_header_map_flag_quote_grave_e = 0x40000000,
+ f_fss_payload_header_map_flag_quote_single_e = 0x80000000,
+ f_fss_payload_header_map_flag_last_e = 0x100000000,
}; // enum
#endif // _di_f_fss_payload_header_map_flag_e_
break;
case f_abstruse_quantity_e:
- if (!headers.array[internal.i].value.is.a_quantity.total || (data->flag & f_fss_payload_header_map_flag_null_quantity_e)) {
- if (private_fl_payload_header_map_quantity(data, state, &internal, headers.array[internal.i].value.is.a_quantity, destinations) == F_false) {
- ++destinations->used;
- }
- }
- else if (data->flag & f_fss_payload_header_map_flag_null_e) {
+ if (private_fl_payload_header_map_quantity(data, state, &internal, headers.array[internal.i].value.is.a_quantity, destinations) == F_false) {
++destinations->used;
}
// Remove the always added trailing extended next.
destinations->array[destinations->used].value.used -= f_fss_extended_next_s.used;
+ destinations->array[destinations->used].value.string[destinations->array[destinations->used].value.used] = 0;
}
}
else {
// Remove the always added trailing space.
if (destinations->array[destinations->used].value.used) {
destinations->array[destinations->used].value.used -= f_fss_extended_next_s.used;
+ destinations->array[destinations->used].value.string[destinations->array[destinations->used].value.used] = 0;
}
}
// Remove the always added trailing space.
if (destinations->array[destinations->used].value.used) {
destinations->array[destinations->used].value.used -= f_fss_extended_next_s.used;
+ destinations->array[destinations->used].value.string[destinations->array[destinations->used].value.used] = 0;
}
}
// Remove the always added trailing space.
if (destinations->array[destinations->used].value.used) {
destinations->array[destinations->used].value.used -= f_fss_extended_next_s.used;
+ destinations->array[destinations->used].value.string[destinations->array[destinations->used].value.used] = 0;
}
}
else {
// Remove the always added trailing space.
if (destinations->array[destinations->used].value.used) {
destinations->array[destinations->used].value.used -= f_fss_extended_next_s.used;
+ destinations->array[destinations->used].value.string[destinations->array[destinations->used].value.used] = 0;
}
}
#if !defined(_di_fl_fss_payload_header_map_)
uint8_t private_fl_payload_header_map_quantity(fl_fss_payload_header_state_t * const data, f_state_t * const state, fl_fss_payload_header_internal_t * const internal, const f_quantity_t quantity, f_string_maps_t * const destinations) {
- if (quantity.total) {
- data->cache->used = 0;
-
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantity.start) == F_true) return F_true;
-
- if (data->flag & f_fss_payload_header_map_flag_join_quantity_e) {
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantity.total) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
- }
- else {
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
+ data->cache->used = 0;
- state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
- if (F_status_is_error(state->status)) return F_true;
+ state->status = f_memory_array_increase_by(FL_payload_digit_size_2_d, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size);
+ if (F_status_is_error(state->status)) return F_true;
- data->cache->used = 0;
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantity.start) == F_true) return F_true;
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantity.total) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
- }
+ if (data->flag & f_fss_payload_header_map_flag_join_quantity_e) {
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantity.total) == F_true) return F_true;
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
}
else {
- if (data->flag & f_fss_payload_header_map_flag_null_quantity_e) {
- if (data->flag & f_fss_payload_header_map_flag_join_quantity_e) {
- data->cache->used = 0;
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, data->cache, f_fss_space_s) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
- }
- else {
- if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, &destinations->array[destinations->used].value, f_fss_extended_next_s) == F_true) return F_true;
- }
- }
+ state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
+ if (F_status_is_error(state->status)) return F_true;
+
+ data->cache->used = 0;
+
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantity.total) == F_true) return F_true;
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
}
state->status = F_okay;
if (F_status_set_fine(state->status) == F_interrupt) return F_true;
}
- if (quantitys.array[internal->l].total) {
- internal->k += FL_payload_digit_size_2_d + f_fss_extended_next_s.used + internal->quote_null.used * 2;
- }
- else if (data->flag & f_fss_payload_header_map_flag_null_quantity_e) {
- internal->k += f_fss_extended_next_s.used + internal->quote_null.used * 2;
- }
+ internal->k += FL_payload_digit_size_2_d + f_fss_extended_next_s.used + internal->quote_null.used * 2 + f_fss_placeholder_s.used * 2;
} // for
- // Add additional characters for the standard placeholders.
- if (internal->k) {
- internal->k += f_fss_placeholder_s.used * 2;
- }
+ data->cache->used = 0;
state->status = f_memory_array_increase_by(internal->k, sizeof(f_char_t), (void **) &destinations->array[destinations->used].value.string, &destinations->array[destinations->used].value.used, &destinations->array[destinations->used].value.size);
if (F_status_is_error(state->status)) return F_true;
if (data->flag & f_fss_payload_header_map_flag_join_quantitys_e) {
- data->cache->used = 0;
-
state->status = f_memory_array_increase_by(internal->k, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size);
if (F_status_is_error(state->status)) return F_true;
if (F_status_set_fine(state->status) == F_interrupt) return F_true;
}
- if (quantitys.array[internal->l].total) {
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].start) == F_true) return F_true;
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].total) == F_true) return F_true;
-
- continue;
- }
-
- if (data->flag & f_fss_payload_header_map_flag_null_quantity_e) {
- if (data->cache->used) {
- state->status = f_string_dynamic_append_assure(f_fss_space_s, data->cache);
- if (F_status_is_error(state->status)) return F_true;
- }
-
- if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, data->cache, f_fss_space_s) == F_true) return F_true;
- }
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].start) == F_true) return F_true;
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].total) == F_true) return F_true;
} // for
if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
}
else {
- data->cache->used = 0;
-
if (data->flag & f_fss_payload_header_map_flag_join_quantity_e) {
state->status = f_memory_array_increase_by(FL_payload_digit_size_2_d, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size);
if (F_status_is_error(state->status)) return F_true;
if (F_status_set_fine(state->status) == F_interrupt) return F_true;
}
- if (quantitys.array[internal->l].total) {
- data->cache->used = 0;
-
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].start) == F_true) return F_true;
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].total) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
-
- continue;
- }
-
- if (data->flag & f_fss_payload_header_map_flag_null_quantity_e) {
- data->cache->used = 0;
+ data->cache->used = 0;
- if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, data->cache, f_fss_space_s) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
- }
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].start) == F_true) return F_true;
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].total) == F_true) return F_true;
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
} // for
}
else {
if (F_status_set_fine(state->status) == F_interrupt) return F_true;
}
- if (quantitys.array[internal->l].total) {
- data->cache->used = 0;
-
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].start) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
-
- data->cache->used = 0;
-
- state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
- if (F_status_is_error(state->status)) return F_true;
+ data->cache->used = 0;
- if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].total) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].start) == F_true) return F_true;
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
- state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
- if (F_status_is_error(state->status)) return F_true;
+ data->cache->used = 0;
- continue;
- }
+ state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
+ if (F_status_is_error(state->status)) return F_true;
- if (data->flag & f_fss_payload_header_map_flag_null_quantity_e) {
- state->status = f_string_dynamic_append(internal->quote_null, &destinations->array[destinations->used].value);
- if (F_status_is_error(state->status)) return F_true;
- }
+ if (private_fl_payload_header_map_number_unsigned(data, state, internal, quantitys.array[internal->l].total) == F_true) return F_true;
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
if (F_status_is_error(state->status)) return F_true;
// Remove the always added trailing space (except when all quantitys are NULL and f_fss_payload_header_map_flag_null_quantity_e is not set).
if (destinations->array[destinations->used].value.used) {
destinations->array[destinations->used].value.used -= f_fss_extended_next_s.used;
+ destinations->array[destinations->used].value.string[destinations->array[destinations->used].value.used] = 0;
}
}
}
#if !defined(_di_fl_fss_payload_header_map_)
uint8_t private_fl_payload_header_map_range(fl_fss_payload_header_state_t * const data, f_state_t * const state, fl_fss_payload_header_internal_t * const internal, const f_range_t range, f_string_maps_t * const destinations) {
+ data->cache->used = 0;
+
if (range.start > range.stop) {
if (data->flag & f_fss_payload_header_map_flag_null_range_e) {
if (data->flag & f_fss_payload_header_map_flag_join_range_e) {
- data->cache->used = 0;
if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, data->cache, f_fss_space_s) == F_true) return F_true;
if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
}
}
else {
- data->cache->used = 0;
+ state->status = f_memory_array_increase_by(FL_payload_digit_size_2_d, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size);
+ if (F_status_is_error(state->status)) return F_true;
if (private_fl_payload_header_map_number_unsigned(data, state, internal, range.start) == F_true) return F_true;
if (private_fl_payload_header_map_number_unsigned(data, state, internal, ranges.array[internal->l].stop) == F_true) return F_true;
} // for
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
+ if (data->cache->used) {
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
+ }
+ else if (!(data->flag & f_fss_payload_header_map_flag_null_range_e)) {
+
+ // Let caller know to not increment when not allowing NULL ranges.
+ return F_true;
+ }
}
else {
data->cache->used = 0;
state->status = f_memory_array_increase_by(FL_payload_digit_size_2_d, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size);
if (F_status_is_error(state->status)) return F_true;
+ uint8_t no_data = F_true;
+
for (internal->l = 0; internal->l < ranges.used; ++internal->l) {
if (state->interrupt) {
if (ranges.array[internal->l].start > ranges.array[internal->l].stop) {
if (data->flag & f_fss_payload_header_map_flag_null_range_e) {
data->cache->used = 0;
+ no_data = F_false;
if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, data->cache, f_fss_space_s) == F_true) return F_true;
if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
}
data->cache->used = 0;
+ no_data = F_false;
if (private_fl_payload_header_map_number_unsigned(data, state, internal, ranges.array[internal->l].start) == F_true) return F_true;
if (private_fl_payload_header_map_number_unsigned(data, state, internal, ranges.array[internal->l].stop) == F_true) return F_true;
if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
} // for
+
+ // Let caller know to not increment when not allowing NULL ranges.
+ if (no_data) return F_true;
}
else {
state->status = f_memory_array_increase_by(FL_payload_digit_size_1_d, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size);
if (F_status_is_error(state->status)) return F_true;
+ uint8_t no_data = F_true;
+
for (internal->l = 0; internal->l < ranges.used; ++internal->l) {
if (state->interrupt) {
if (ranges.array[internal->l].start > ranges.array[internal->l].stop) {
if (data->flag & f_fss_payload_header_map_flag_null_range_e) {
+ no_data = F_false;
+
state->status = f_string_dynamic_append(internal->quote_null, &destinations->array[destinations->used].value);
if (F_status_is_error(state->status)) return F_true;
- }
- state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
- if (F_status_is_error(state->status)) return F_true;
+ state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
+ if (F_status_is_error(state->status)) return F_true;
+ }
continue;
}
+ no_data = F_false;
data->cache->used = 0;
if (private_fl_payload_header_map_number_unsigned(data, state, internal, ranges.array[internal->l].start) == F_true) return F_true;
if (F_status_is_error(state->status)) return F_true;
} // for
+ // Let caller know to not increment when not allowing NULL ranges.
+ if (no_data) return F_true;
+
// Remove the always added trailing space (except when all ranges are NULL and f_fss_payload_header_map_flag_null_range_e is not set).
if (destinations->array[destinations->used].value.used) {
destinations->array[destinations->used].value.used -= f_fss_extended_next_s.used;
+ destinations->array[destinations->used].value.string[destinations->array[destinations->used].value.used] = 0;
}
}
}
}
- else {
- if (data->flag & f_fss_payload_header_map_flag_null_ranges_e) {
- if (data->flag & f_fss_payload_header_map_flag_join_ranges_range_e) {
- data->cache->used = 0;
+ else if (data->flag & f_fss_payload_header_map_flag_null_ranges_e) {
+ if (data->flag & f_fss_payload_header_map_flag_join_ranges_range_e) {
+ data->cache->used = 0;
- if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, data->cache, f_fss_space_s) == F_true) return F_true;
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
- }
- else {
- if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, &destinations->array[destinations->used].value, f_fss_extended_next_s) == F_true) return F_true;
- }
+ if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, data->cache, f_fss_space_s) == F_true) return F_true;
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
+ }
+ else {
+ if (private_fl_payload_helper_header_map_destination_write_empty_two(data, state, internal, &destinations->array[destinations->used].value, f_fss_extended_next_s) == F_true) return F_true;
}
}
+ else {
+
+ // Let caller know to not increment when not allowing NULL ranges.
+ return F_true;
+ }
state->status = F_okay;
f_string_dynamic_t * const destination = (data->flag & f_fss_payload_header_map_flag_join_triple_e) ? data->cache : &destinations->array[destinations->used].value;
const f_string_static_t separator = (data->flag & f_fss_payload_header_map_flag_join_triple_e) ? f_string_space_s : f_fss_extended_next_s;
- const f_string_static_t a = triple.a.used ? triple.a : internal->quote_null;
- const f_string_static_t b = triple.b.used ? triple.b : internal->quote_null;
- const f_string_static_t c = triple.c.used ? triple.c : internal->quote_null;
data->cache->used = 0;
- state->status = f_memory_array_increase_by(a.used + b.used + c.used + separator.used * 2, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size);
- if (F_status_is_error(state->status)) return F_true;
+ {
+ f_number_unsigned_t length = separator.used * 2 + f_fss_placeholder_s.used * 6;
- if (triple.a.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
- if (data->flag & f_fss_payload_header_map_flag_join_triple_e) {
- state->status = f_string_dynamic_append(a, destination);
+ if (triple.a.used) {
+ length += triple.a.used;
+ }
+ else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
+ length += internal->quote_null.used;
}
- else {
- internal->range.start = 0;
- internal->range.stop = a.used - 1;
- private_fl_fss_basic_write(F_false, a, internal->quote, &internal->range, destination, state, (void * const) internal);
+ if (triple.b.used) {
+ length += triple.b.used;
+ }
+ else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
+ length += internal->quote_null.used;
}
- if (F_status_is_error(state->status)) return F_true;
+ if (triple.c.used) {
+ length += triple.c.used;
+ }
+ else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
+ length += internal->quote_null.used;
+ }
- if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
- state->status = f_string_dynamic_append(separator, destination);
+ if (data->flag & f_fss_payload_header_map_flag_join_triple_e) {
+ state->status = f_memory_array_increase_by(length, sizeof(f_char_t), (void **) &destinations->array[destinations->used].value.string, &destinations->array[destinations->used].value.used, &destinations->array[destinations->used].value.size);
if (F_status_is_error(state->status)) return F_true;
}
}
- if (triple.b.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
- if (data->flag & f_fss_payload_header_map_flag_join_triple_e) {
- state->status = f_string_dynamic_append(b, destination);
+ if (triple.a.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
+ if (triple.a.used) {
+ if (data->flag & f_fss_payload_header_map_flag_join_triple_e) {
+ state->status = f_string_dynamic_append(triple.a, destination);
+ }
+ else {
+ internal->range.start = 0;
+ internal->range.stop = triple.a.used - 1;
+
+ private_fl_fss_basic_write(F_false, triple.a, internal->quote, &internal->range, destination, state, (void * const) internal);
+ }
+
+ if (F_status_is_error(state->status)) return F_true;
}
else {
- internal->range.start = 0;
- internal->range.stop = b.used - 1;
+ state->status = f_string_dynamic_append(internal->quote_null, destination);
+ if (F_status_is_error(state->status)) return F_true;
+ }
+ }
- private_fl_fss_basic_write(F_false, b, internal->quote, &internal->range, destination, state, (void * const) internal);
+ if (triple.b.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
+ if (triple.a.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
+ state->status = f_string_dynamic_append_assure(separator, destination);
+ if (F_status_is_error(state->status)) return F_true;
}
- if (F_status_is_error(state->status)) return F_true;
+ if (triple.b.used) {
+ if (data->flag & f_fss_payload_header_map_flag_join_triple_e) {
+ state->status = f_string_dynamic_append(triple.b, destination);
+ }
+ else {
+ internal->range.start = 0;
+ internal->range.stop = triple.b.used - 1;
+
+ private_fl_fss_basic_write(F_false, triple.b, internal->quote, &internal->range, destination, state, (void * const) internal);
+ }
- if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
- state->status = f_string_dynamic_append(separator, destination);
+ if (F_status_is_error(state->status)) return F_true;
+ }
+ else {
+ state->status = f_string_dynamic_append(internal->quote_null, destination);
if (F_status_is_error(state->status)) return F_true;
}
}
if (triple.c.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
- if (data->flag & f_fss_payload_header_map_flag_join_triple_e) {
- state->status = f_string_dynamic_append(c, destination);
+ if (triple.a.used || triple.b.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
+ state->status = f_string_dynamic_append_assure(separator, destination);
+ if (F_status_is_error(state->status)) return F_true;
}
- else {
- internal->range.start = 0;
- internal->range.stop = c.used - 1;
- private_fl_fss_basic_write(F_false, c, internal->quote, &internal->range, destination, state, (void * const) internal);
- }
+ if (triple.c.used) {
+ if (data->flag & f_fss_payload_header_map_flag_join_triple_e) {
+ state->status = f_string_dynamic_append(triple.c, destination);
+ }
+ else {
+ internal->range.start = 0;
+ internal->range.stop = triple.c.used - 1;
- if (F_status_is_error(state->status)) return F_true;
+ private_fl_fss_basic_write(F_false, triple.c, internal->quote, &internal->range, destination, state, (void * const) internal);
+ }
+
+ if (F_status_is_error(state->status)) return F_true;
+ }
+ else {
+ state->status = f_string_dynamic_append(internal->quote_null, destination);
+ if (F_status_is_error(state->status)) return F_true;
+ }
}
if (data->flag & f_fss_payload_header_map_flag_join_triple_e) {
internal->k += (triples.array[internal->l].b.used) ? triples.array[internal->l].b.used : internal->quote_null.used;
internal->k += (triples.array[internal->l].c.used) ? triples.array[internal->l].c.used : internal->quote_null.used;
internal->k += (data->flag & f_fss_payload_header_map_flag_join_triple_e) ? f_fss_space_s.used * 2 : f_fss_extended_next_s.used * 2;
+ internal->k += f_fss_placeholder_s.used * 6;
} // for
- // Add additional characters for the standard placeholders.
- if (internal->k) {
- internal->k += f_fss_placeholder_s.used * 4;
- }
-
state->status = f_memory_array_increase_by(internal->k, sizeof(f_char_t), (void **) &destinations->array[destinations->used].value.string, &destinations->array[destinations->used].value.used, &destinations->array[destinations->used].value.size);
if (F_status_is_error(state->status)) return F_true;
- if (data->flag & f_fss_payload_header_map_flag_join_triples_triple_e) {
- data->cache->used = 0;
+ data->cache->used = 0;
+ if (data->flag & f_fss_payload_header_map_flag_join_triples_triple_e) {
state->status = f_memory_array_increase_by(internal->k, sizeof(f_char_t), (void **) &data->cache->string, &data->cache->used, &data->cache->size);
if (F_status_is_error(state->status)) return F_true;
if (F_status_set_fine(state->status) == F_interrupt) return F_true;
}
- if (!(data->flag & f_fss_payload_header_map_flag_join_triples_e)) {
- if (data->cache->used) {
- state->status = f_string_dynamic_append_assure(f_fss_extended_next_s, &destinations->array[destinations->used].value);
- if (F_status_is_error(state->status)) return F_true;
- }
-
- data->cache->used = 0;
- }
- else {
- if (data->cache->used) {
- state->status = f_string_dynamic_append_assure(f_fss_space_s, data->cache);
- if (F_status_is_error(state->status)) return F_true;
- }
+ if (data->cache->used) {
+ state->status = f_string_dynamic_append_assure(f_fss_space_s, data->cache);
+ if (F_status_is_error(state->status)) return F_true;
}
if (triples.array[internal->l].a.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
- if (triples.array[internal->l].a.used) {
- state->status = f_string_dynamic_append(triples.array[internal->l].a, data->cache);
- if (F_status_is_error(state->status)) return F_true;
- }
- else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
- state->status = f_string_dynamic_append(internal->quote_null, data->cache);
- if (F_status_is_error(state->status)) return F_true;
- }
-
- if (triples.array[internal->l].b.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
- state->status = f_string_dynamic_append_assure(f_fss_space_s, data->cache);
- if (F_status_is_error(state->status)) return F_true;
- }
+ state->status = f_string_dynamic_append((triples.array[internal->l].a.used) ? triples.array[internal->l].a : internal->quote_null, data->cache);
+ if (F_status_is_error(state->status)) return F_true;
}
if (triples.array[internal->l].b.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
- if (triples.array[internal->l].b.used) {
- state->status = f_string_dynamic_append(triples.array[internal->l].b, data->cache);
- if (F_status_is_error(state->status)) return F_true;
- }
- else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
- state->status = f_string_dynamic_append(internal->quote_null, data->cache);
- if (F_status_is_error(state->status)) return F_true;
- }
-
- if (triples.array[internal->l].c.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
+ if (triples.array[internal->l].a.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
state->status = f_string_dynamic_append_assure(f_fss_space_s, data->cache);
if (F_status_is_error(state->status)) return F_true;
}
+
+ state->status = f_string_dynamic_append((triples.array[internal->l].b.used) ? triples.array[internal->l].b : internal->quote_null, data->cache);
+ if (F_status_is_error(state->status)) return F_true;
}
if (triples.array[internal->l].c.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
- if (triples.array[internal->l].c.used) {
- state->status = f_string_dynamic_append(triples.array[internal->l].c, data->cache);
- if (F_status_is_error(state->status)) return F_true;
- }
- else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
- state->status = f_string_dynamic_append(internal->quote_null, data->cache);
+ if (triples.array[internal->l].a.used || triples.array[internal->l].b.used || (data->flag & f_fss_payload_header_map_flag_null_triple_e)) {
+ state->status = f_string_dynamic_append_assure(f_fss_space_s, data->cache);
if (F_status_is_error(state->status)) return F_true;
}
+
+ state->status = f_string_dynamic_append((triples.array[internal->l].c.used) ? triples.array[internal->l].c : internal->quote_null, data->cache);
+ if (F_status_is_error(state->status)) return F_true;
}
if (!(data->flag & f_fss_payload_header_map_flag_join_triples_e)) {
}
} // for
- if (data->flag & f_fss_payload_header_map_flag_join_triples_e) {
- if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
- }
+ if (private_fl_payload_helper_header_map_destination_write_buffer(data, state, internal, data->cache, destinations) == F_true) return F_true;
}
else {
- data->cache->used = 0;
-
for (internal->l = 0; internal->l < triples.used; ++internal->l) {
if (state->interrupt) {
internal->range.start = 0;
internal->range.stop = triples.array[internal->l].a.used - 1;
- private_fl_fss_basic_write(F_false, triples.array[internal->l].a, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal);
+ private_fl_fss_basic_write(F_false, triples.array[internal->l].a, internal->quote, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal);
if (F_status_is_error(state->status)) return F_true;
}
- else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
+ else {
state->status = f_string_dynamic_append(internal->quote_null, &destinations->array[destinations->used].value);
if (F_status_is_error(state->status)) return F_true;
}
internal->range.start = 0;
internal->range.stop = triples.array[internal->l].b.used - 1;
- private_fl_fss_basic_write(F_false, triples.array[internal->l].b, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal);
+ private_fl_fss_basic_write(F_false, triples.array[internal->l].b, internal->quote, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal);
if (F_status_is_error(state->status)) return F_true;
}
else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
internal->range.start = 0;
internal->range.stop = triples.array[internal->l].c.used - 1;
- private_fl_fss_basic_write(F_false, triples.array[internal->l].c, 0, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal);
+ private_fl_fss_basic_write(F_false, triples.array[internal->l].c, internal->quote, &internal->range, &destinations->array[destinations->used].value, state, (void * const) internal);
if (F_status_is_error(state->status)) return F_true;
}
else if (data->flag & f_fss_payload_header_map_flag_null_triple_e) {
// Remove the always added trailing space (except when all triples are NULL and f_fss_payload_header_map_flag_null_triple_e is not set).
if (destinations->array[destinations->used].value.used) {
destinations->array[destinations->used].value.used -= f_fss_extended_next_s.used;
+ destinations->array[destinations->used].value.string[destinations->array[destinations->used].value.used] = 0;
}
+
+ state->status = f_string_dynamic_strip_null(&destinations->array[destinations->used].value);
+ if (F_status_is_error(state->status)) return F_true;
}
}
else {
build_sources_program test-fss-payload_header_map-abstruse_map_multi-join.c test-fss-payload_header_map-abstruse_map_multi-split.c
build_sources_program test-fss-payload_header_map-abstruse_map_multis-join.c test-fss-payload_header_map-abstruse_map_multis-split.c
build_sources_program test-fss-payload_header_map-abstruse_maps-join.c test-fss-payload_header_map-abstruse_maps-split.c
+build_sources_program test-fss-payload_header_map-abstruse_quantity-join.c test-fss-payload_header_map-abstruse_quantity-split.c
+build_sources_program test-fss-payload_header_map-abstruse_quantitys-join.c test-fss-payload_header_map-abstruse_quantitys-split.c
+build_sources_program test-fss-payload_header_map-abstruse_range-join.c test-fss-payload_header_map-abstruse_range-split.c
+build_sources_program test-fss-payload_header_map-abstruse_ranges-join.c test-fss-payload_header_map-abstruse_ranges-split.c
build_sources_program test-fss-payload_header_map-abstruse_signed-join.c test-fss-payload_header_map-abstruse_unsigned-join.c
build_sources_program test-fss-payload_header_map-abstruse_signeds-join.c test-fss-payload_header_map-abstruse_unsigneds-join.c
build_sources_program test-fss-payload_header_map-abstruse_signeds-split.c test-fss-payload_header_map-abstruse_unsigneds-split.c
build_sources_program test-fss-payload_header_map-abstruse_string-join.c
build_sources_program test-fss-payload_header_map-abstruse_strings-join.c test-fss-payload_header_map-abstruse_strings-split.c
+build_sources_program test-fss-payload_header_map-abstruse_triple-join.c test-fss-payload_header_map-abstruse_triple-split.c
+build_sources_program test-fss-payload_header_map-abstruse_triples-join.c test-fss-payload_header_map-abstruse_triples-split.c
build_sources_program test-fss.c data-fss.c help-fss.c help-fss-payload.c
--- /dev/null
+a
+1
+"0 1"
--- /dev/null
+b
+1
+"55555 77777777"
--- /dev/null
+c
+1
+"123456789 9876543210"
--- /dev/null
+a
+1
+"0 1"
--- /dev/null
+b
+1
+"55555 77777777"
--- /dev/null
+c
+1
+"123456789 9876543210"
--- /dev/null
+a
+1
+"0 1"
--- /dev/null
+b
+1
+"55555 77777777"
--- /dev/null
+c
+1
+"123456789 9876543210"
--- /dev/null
+a
+1
+"0 1"
--- /dev/null
+b
+1
+"55555 77777777"
--- /dev/null
+c
+1
+"123456789 9876543210"
--- /dev/null
+a-0
+1
+"0 hello world"
--- /dev/null
+a-1
+1
+"some thing 3全#$⸙"
--- /dev/null
+a-2
+1
+""\" ''"
--- /dev/null
+b-0
+1
+"全 ⸙"
--- /dev/null
+b-1
+1
+"␂␂␂ ␀ ␀ ␀ ␀ ␀ ␀"
--- /dev/null
+b-2
+1
+"' '"
--- /dev/null
+c-0
+1
+"� "a b \" c"
--- /dev/null
+a-0
+1
+"0 hello world"
--- /dev/null
+a-1
+1
+"some thing 3全#$⸙"
--- /dev/null
+a-2
+1
+""\" ''"
--- /dev/null
+b-0
+1
+"全 ⸙"
--- /dev/null
+b-1
+1
+"␂␂␂ ␀ ␀ ␀ ␀ ␀ ␀"
--- /dev/null
+b-2
+1
+"' '"
--- /dev/null
+c-0
+1
+"� "a b \" c"
--- /dev/null
+b
+1
+55555 77777777
--- /dev/null
+c
+1
+123456789 9876543210
--- /dev/null
+b
+1
+55555 77777777
--- /dev/null
+c
+1
+123456789 9876543210
--- /dev/null
+b
+1
+55555 77777777
--- /dev/null
+c
+1
+123456789 9876543210
--- /dev/null
+b
+1
+55555 77777777
--- /dev/null
+c
+1
+123456789 9876543210
--- /dev/null
+a-0
+1
+0 hello world
--- /dev/null
+a-1
+1
+"some thing" 3全#$⸙
--- /dev/null
+a-2
+1
+"""" "''"
--- /dev/null
+b-0
+1
+全 ⸙
--- /dev/null
+b-1
+1
+␂␂␂ "␀ ␀ ␀ ␀ ␀ ␀"
--- /dev/null
+b-2
+1
+"'" "'"
--- /dev/null
+c-0
+1
+� ""a b \" c"
--- /dev/null
+a-0
+1
+0 hello world
--- /dev/null
+a-1
+1
+"some thing" 3全#$⸙
--- /dev/null
+a-2
+1
+"""" "''"
--- /dev/null
+b-0
+1
+全 ⸙
--- /dev/null
+b-1
+1
+␂␂␂ "␀ ␀ ␀ ␀ ␀ ␀"
--- /dev/null
+b-2
+1
+"'" "'"
--- /dev/null
+c-0
+1
+� ""a b \" c"
--- /dev/null
+a
+2
+0
+1
+b
+2
+55555
+77777777
+c
+2
+0123456789
+9876543210
--- /dev/null
+a
+2
+0
+1
+b
+2
+55555
+77777777
+c
+2
+0123456789
+9876543210
--- /dev/null
+a
+2
+0
+1
+b
+2
+55555
+77777777
+c
+2
+0123456789
+9876543210
+d
+2
+5
+3
--- /dev/null
+a
+2
+0
+1
+b
+2
+55555
+77777777
+c
+2
+0123456789
+9876543210
+d
+2
+5
+3
--- /dev/null
+a-0
+3
+0
+hello
+world
+a-1
+2
+some thing
+3全#$⸙
+a-2
+2
+""
+''
+b-0
+2
+全
+⸙
+b-1
+2
+␂␂␂
+␀ ␀ ␀ ␀ ␀ ␀
+b-2
+2
+'
+'
+c-0
+2
+�
+"a b " c
--- /dev/null
+a-0
+3
+0
+hello
+world
+a-1
+2
+some thing
+3全#$⸙
+a-2
+2
+""
+''
+b-0
+2
+全
+⸙
+b-1
+2
+␂␂␂
+␀ ␀ ␀ ␀ ␀ ␀
+b-2
+2
+'
+'
+c-0
+2
+�
+"a b " c
} // for
fl_fss_payload_header_map(headers, &destinations, &state);
+
+ if (state.status != F_okay || destinations.used != expects.used) {
+ printf("[ ERROR ] --- Failure mapping: headers/payload-%s-%d.txt.\n", context_headers, at);
+ }
+
assert_int_equal(state.status, F_okay);
assert_int_equal(destinations.used, expects.used);
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_quantity__works_join(void **void_state) {
+
+ help_payload__test("abstruse_quantity", "join-abstruse_quantity", f_fss_payload_header_map_flag_join_quantity_e, test__fl_fss_payload_header_map__abstruse_quantity__join_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_quantity__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].key.used = 0;
+ headers->array[0].value.is.a_quantity.start = 0;
+ headers->array[0].value.is.a_quantity.total = 0;
+ headers->array[0].value.type = f_abstruse_quantity_e;
+
+ f_quantity_t * const quantity = &headers->array[0].value.is.a_quantity;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used) {
+ f_number_signed_t number = atoll(contents.array[0].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[0].string[0], '0');
+ }
+
+ quantity->start = number;
+
+ if (contents.used > 1) {
+ number = atoll(contents.array[1].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[1].string[0], '0');
+ }
+
+ quantity->total = number;
+ }
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_quantity_join_h
+#define _TEST__FL_fss_payload_header_map__abstruse_quantity_join_h
+
+/**
+ * Test that the function works for abstruse_quantity type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_quantity__works_join(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_quantity__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_quantity_join_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_quantity__works_split(void **void_state) {
+
+ help_payload__test("abstruse_quantity", "split-abstruse_quantity", 0, test__fl_fss_payload_header_map__abstruse_quantity__split_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_quantity__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].key.used = 0;
+ headers->array[0].value.is.a_quantity.start = 0;
+ headers->array[0].value.is.a_quantity.total = 0;
+ headers->array[0].value.type = f_abstruse_quantity_e;
+
+ f_quantity_t * const quantity = &headers->array[0].value.is.a_quantity;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used) {
+ f_number_signed_t number = atoll(contents.array[0].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[0].string[0], '0');
+ }
+
+ quantity->start = number;
+
+ if (contents.used > 1) {
+ number = atoll(contents.array[1].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[1].string[0], '0');
+ }
+
+ quantity->total = number;
+ }
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_quantity_split_h
+#define _TEST__FL_fss_payload_header_map__abstruse_quantity_split_h
+
+/**
+ * Test that the function works for abstruse_quantity type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_quantity__works_split(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_quantity__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_quantity_split_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_quantitys__works_join(void **void_state) {
+
+ help_payload__test("abstruse_quantitys", "join-abstruse_quantitys", f_fss_payload_header_map_flag_join_quantitys_e, test__fl_fss_payload_header_map__abstruse_quantitys__join_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_quantitys__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].key.used = 0;
+ headers->array[0].value.is.a_quantitys.used = 0;
+ headers->array[0].value.type = f_abstruse_quantitys_e;
+
+ f_quantitys_t * const quantitys = &headers->array[0].value.is.a_quantitys;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ state->status = f_memory_array_increase_by(contents.used, sizeof(f_quantity_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
+ assert_int_equal(state->status, F_okay);
+
+ f_number_signed_t number = 0;
+
+ for (f_number_unsigned_t i = 0; i < contents.used; i += 2, ++quantitys->used) {
+
+ number = atoll(contents.array[i].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[i].string[0], '0');
+ }
+
+ quantitys->array[quantitys->used].start = number;
+ quantitys->array[quantitys->used].total = 0;
+
+ if (i + 1 < contents.used) {
+ number = atoll(contents.array[i + 1].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[i + 1].string[0], '0');
+ }
+
+ quantitys->array[quantitys->used].total = number;
+ }
+ } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_quantitys_join_h
+#define _TEST__FL_fss_payload_header_map__abstruse_quantitys_join_h
+
+/**
+ * Test that the function works for abstruse_quantitys type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_quantitys__works_join(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_quantitys__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_quantitys_join_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_quantitys__works_split(void **void_state) {
+
+ help_payload__test("abstruse_quantitys", "split-abstruse_quantitys", 0, test__fl_fss_payload_header_map__abstruse_quantitys__split_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_quantitys__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].key.used = 0;
+ headers->array[0].value.is.a_quantitys.used = 0;
+ headers->array[0].value.type = f_abstruse_quantitys_e;
+
+ f_quantitys_t * const quantitys = &headers->array[0].value.is.a_quantitys;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ state->status = f_memory_array_increase_by(contents.used, sizeof(f_quantity_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
+ assert_int_equal(state->status, F_okay);
+
+ f_number_signed_t number = 0;
+
+ for (f_number_unsigned_t i = 0; i < contents.used; i += 2, ++quantitys->used) {
+
+ number = atoll(contents.array[i].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[i].string[0], '0');
+ }
+
+ quantitys->array[quantitys->used].start = number;
+ quantitys->array[quantitys->used].total = 0;
+
+ if (i + 1 < contents.used) {
+ number = atoll(contents.array[i + 1].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[i + 1].string[0], '0');
+ }
+
+ quantitys->array[quantitys->used].total = number;
+ }
+ } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_quantitys_split_h
+#define _TEST__FL_fss_payload_header_map__abstruse_quantitys_split_h
+
+/**
+ * Test that the function works for abstruse_quantitys type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_quantitys__works_split(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_quantitys__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_quantitys_split_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_range__works_join(void **void_state) {
+
+ help_payload__test("abstruse_range", "join-abstruse_range", f_fss_payload_header_map_flag_join_range_e, test__fl_fss_payload_header_map__abstruse_range__join_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_range__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].key.used = 0;
+ headers->array[0].value.is.a_range.start = 0;
+ headers->array[0].value.is.a_range.stop = 0;
+ headers->array[0].value.type = f_abstruse_range_e;
+
+ f_range_t * const quantity = &headers->array[0].value.is.a_range;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used > 1) {
+ f_number_signed_t number = atoll(contents.array[0].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[0].string[0], '0');
+ }
+
+ quantity->start = number;
+
+ number = atoll(contents.array[1].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[1].string[0], '0');
+ }
+
+ quantity->stop = number;
+ }
+ else {
+ quantity->start = 1;
+ quantity->stop = 0;
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_range_join_h
+#define _TEST__FL_fss_payload_header_map__abstruse_range_join_h
+
+/**
+ * Test that the function works for abstruse_range type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_range__works_join(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_range__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_range_join_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_range__works_split(void **void_state) {
+
+ help_payload__test("abstruse_range", "split-abstruse_range", 0, test__fl_fss_payload_header_map__abstruse_range__split_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_range__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].key.used = 0;
+ headers->array[0].value.is.a_range.start = 0;
+ headers->array[0].value.is.a_range.stop = 0;
+ headers->array[0].value.type = f_abstruse_range_e;
+
+ f_range_t * const quantity = &headers->array[0].value.is.a_range;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used > 1) {
+ f_number_signed_t number = atoll(contents.array[0].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[0].string[0], '0');
+ }
+
+ quantity->start = number;
+
+ number = atoll(contents.array[1].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[1].string[0], '0');
+ }
+
+ quantity->stop = number;
+ }
+ else {
+ quantity->start = 1;
+ quantity->stop = 0;
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_range_split_h
+#define _TEST__FL_fss_payload_header_map__abstruse_range_split_h
+
+/**
+ * Test that the function works for abstruse_range type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_range__works_split(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_range__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_range_split_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_ranges__works_join(void **void_state) {
+
+ help_payload__test("abstruse_ranges", "join-abstruse_ranges", f_fss_payload_header_map_flag_join_ranges_e, test__fl_fss_payload_header_map__abstruse_ranges__join_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_ranges__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].key.used = 0;
+ headers->array[0].value.is.a_ranges.used = 0;
+ headers->array[0].value.type = f_abstruse_ranges_e;
+
+ f_ranges_t * const quantitys = &headers->array[0].value.is.a_ranges;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ state->status = f_memory_array_increase_by(contents.used, sizeof(f_range_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
+ assert_int_equal(state->status, F_okay);
+
+ f_number_signed_t number = 0;
+
+ for (f_number_unsigned_t i = 0; i < contents.used; i += 2, ++quantitys->used) {
+
+ if (i + 1 < contents.used) {
+ number = atoll(contents.array[i].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[i].string[0], '0');
+ }
+
+ quantitys->array[quantitys->used].start = number;
+ quantitys->array[quantitys->used].stop = 0;
+
+ number = atoll(contents.array[i + 1].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[i + 1].string[0], '0');
+ }
+
+ quantitys->array[quantitys->used].stop = number;
+ }
+ else {
+ quantitys->array[quantitys->used].start = 1;
+ quantitys->array[quantitys->used].stop = 0;
+ }
+ } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_ranges_join_h
+#define _TEST__FL_fss_payload_header_map__abstruse_ranges_join_h
+
+/**
+ * Test that the function works for abstruse_ranges type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_ranges__works_join(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_ranges__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_ranges_join_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_ranges__works_split(void **void_state) {
+
+ help_payload__test("abstruse_ranges", "split-abstruse_ranges", 0, test__fl_fss_payload_header_map__abstruse_ranges__split_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_ranges__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].key.used = 0;
+ headers->array[0].value.is.a_ranges.used = 0;
+ headers->array[0].value.type = f_abstruse_ranges_e;
+
+ f_ranges_t * const quantitys = &headers->array[0].value.is.a_ranges;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ state->status = f_memory_array_increase_by(contents.used, sizeof(f_range_t), (void **) &quantitys->array, &quantitys->used, &quantitys->size);
+ assert_int_equal(state->status, F_okay);
+
+ f_number_signed_t number = 0;
+
+ for (f_number_unsigned_t i = 0; i < contents.used; i += 2, ++quantitys->used) {
+
+ if (i + 1 < contents.used) {
+ number = atoll(contents.array[i].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[i].string[0], '0');
+ }
+
+ quantitys->array[quantitys->used].start = number;
+ quantitys->array[quantitys->used].stop = 0;
+
+ number = atoll(contents.array[i + 1].string);
+
+ if (!number) {
+ assert_int_equal(contents.array[i + 1].string[0], '0');
+ }
+
+ quantitys->array[quantitys->used].stop = number;
+ }
+ else {
+ quantitys->array[quantitys->used].start = 1;
+ quantitys->array[quantitys->used].stop = 0;
+ }
+ } // for
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_ranges_split_h
+#define _TEST__FL_fss_payload_header_map__abstruse_ranges_split_h
+
+/**
+ * Test that the function works for abstruse_ranges type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_ranges__works_split(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_ranges__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_ranges_split_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_triple__works_join(void **void_state) {
+
+ help_payload__test("abstruse_triple", "join-abstruse_triple", f_fss_payload_header_map_flag_join_triple_e, test__fl_fss_payload_header_map__abstruse_triple__join_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_triple__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].value.type = f_abstruse_triple_e;
+ headers->array[0].value.is.a_triple.a.used = 0;
+ headers->array[0].value.is.a_triple.b.used = 0;
+ headers->array[0].value.is.a_triple.c.used = 0;
+ headers->array[0].key.used = 0;
+
+ f_string_triple_t * const triple = &headers->array[0].value.is.a_triple;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used) {
+ state->status = f_string_dynamic_append(contents.array[0], &triple->a);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used > 1) {
+ state->status = f_string_dynamic_append(contents.array[1], &triple->b);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used > 2) {
+ state->status = f_string_dynamic_append(contents.array[2], &triple->c);
+ assert_int_equal(state->status, F_okay);
+ }
+ }
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_triple_join_h
+#define _TEST__FL_fss_payload_header_map__abstruse_triple_join_h
+
+/**
+ * Test that the function works for abstruse_triple type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_triple__works_join(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_triple__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_triple_join_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_triple__works_split(void **void_state) {
+
+ help_payload__test("abstruse_triple", "split-abstruse_triple", 0, test__fl_fss_payload_header_map__abstruse_triple__split_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_triple__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].value.type = f_abstruse_triple_e;
+ headers->array[0].value.is.a_triple.a.used = 0;
+ headers->array[0].value.is.a_triple.b.used = 0;
+ headers->array[0].value.is.a_triple.c.used = 0;
+ headers->array[0].key.used = 0;
+
+ f_string_triple_t * const triple = &headers->array[0].value.is.a_triple;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used) {
+ state->status = f_string_dynamic_append(contents.array[0], &triple->a);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used > 1) {
+ state->status = f_string_dynamic_append(contents.array[1], &triple->b);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used > 2) {
+ state->status = f_string_dynamic_append(contents.array[2], &triple->c);
+ assert_int_equal(state->status, F_okay);
+ }
+ }
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_triple_split_h
+#define _TEST__FL_fss_payload_header_map__abstruse_triple_split_h
+
+/**
+ * Test that the function works for abstruse_triple type.
+ *
+ * @see fl_fss_payload_header_map()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_triple__works_split(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_triple__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_triple_split_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_triples__works_join(void **void_state) {
+
+ help_payload__test("abstruse_triples", "join-abstruse_triples", f_fss_payload_header_map_flag_join_triples_e, test__fl_fss_payload_header_map__abstruse_triples__join_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_triples__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].value.type = f_abstruse_triples_e;
+ headers->array[0].value.is.a_triples.used = 0;
+ headers->array[0].key.used = 0;
+
+ f_string_triples_t * const triples = &headers->array[0].value.is.a_triples;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used) {
+ state->status = f_memory_array_increase_by(contents.used, sizeof(f_string_triple_t), (void **) &triples->array, &triples->used, &triples->size);
+ assert_int_equal(state->status, F_okay);
+
+ for (f_number_unsigned_t i = 0; i < contents.used; i += 3, ++triples->used) {
+
+ triples->array[triples->used].a.used = 0;
+ triples->array[triples->used].b.used = 0;
+ triples->array[triples->used].c.used = 0;
+
+ state->status = f_string_dynamic_append(contents.array[i], &triples->array[triples->used].a);
+ assert_int_equal(state->status, F_okay);
+
+ if (i + 1 < contents.used) {
+ state->status = f_string_dynamic_append(contents.array[i + 1], &triples->array[triples->used].b);
+ assert_int_equal(state->status, F_okay);
+
+ if (i + 2 < contents.used) {
+ state->status = f_string_dynamic_append(contents.array[i + 2], &triples->array[triples->used].c);
+ assert_int_equal(state->status, F_okay);
+ }
+ }
+ } // for
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_triples_join_h
+#define _TEST__FL_fss_payload_header_map__abstruse_triples_join_h
+
+/**
+ * Test that the function works for abstruse_triples type.
+ *
+ * @see fl_fss_payload_header_maps()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_triples__works_join(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_triples__join_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_triples_join_h
--- /dev/null
+#include "test-fss.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__fl_fss_payload_header_map__abstruse_triples__works_split(void **void_state) {
+
+ help_payload__test("abstruse_triples", "split-abstruse_triples", 0, test__fl_fss_payload_header_map__abstruse_triples__split_load_contents, 0);
+}
+
+void test__fl_fss_payload_header_map__abstruse_triples__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra) {
+
+ headers->array[0].value.type = f_abstruse_triples_e;
+ headers->array[0].value.is.a_triples.used = 0;
+ headers->array[0].key.used = 0;
+
+ f_string_triples_t * const triples = &headers->array[0].value.is.a_triples;
+
+ state->status = f_string_dynamic_append(object, &headers->array[headers->used].key);
+ assert_int_equal(state->status, F_okay);
+
+ if (contents.used) {
+ state->status = f_memory_array_increase_by(contents.used, sizeof(f_string_triple_t), (void **) &triples->array, &triples->used, &triples->size);
+ assert_int_equal(state->status, F_okay);
+
+ for (f_number_unsigned_t i = 0; i < contents.used; i += 3, ++triples->used) {
+
+ triples->array[triples->used].a.used = 0;
+ triples->array[triples->used].b.used = 0;
+ triples->array[triples->used].c.used = 0;
+
+ state->status = f_string_dynamic_append(contents.array[i], &triples->array[triples->used].a);
+ assert_int_equal(state->status, F_okay);
+
+ if (i + 1 < contents.used) {
+ state->status = f_string_dynamic_append(contents.array[i + 1], &triples->array[triples->used].b);
+ assert_int_equal(state->status, F_okay);
+
+ if (i + 2 < contents.used) {
+ state->status = f_string_dynamic_append(contents.array[i + 2], &triples->array[triples->used].c);
+ assert_int_equal(state->status, F_okay);
+ }
+ }
+ } // for
+ }
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 2
+ *
+ * Project: FSS
+ * API Version: 0.6
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the fl_fss project.
+ */
+#ifndef _TEST__FL_fss_payload_header_map__abstruse_triples_split_h
+#define _TEST__FL_fss_payload_header_map__abstruse_triples_split_h
+
+/**
+ * Test that the function works for abstruse_triples type.
+ *
+ * @see fl_fss_payload_header_maps()
+ */
+extern void test__fl_fss_payload_header_map__abstruse_triples__works_split(void **state);
+
+/**
+ * Callback to load the contents for the test.
+ *
+ * @param object
+ * The object parameter.
+ * @param contents
+ * The contents parameter.
+ * @param headers
+ * The headers parameter.
+* @param state
+ * The state parameter.
+ * @param extra
+ * (optional) The extra parameter.
+ * Set to NULL to not use.
+ */
+extern void test__fl_fss_payload_header_map__abstruse_triples__split_load_contents(const f_string_static_t object, const f_string_dynamics_t contents, f_abstruse_maps_t * const headers, f_state_t * const state, void * extra);
+
+#endif // _TEST__FL_fss_payload_header_map__abstruse_triples_split_h
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_map_multis__works_split),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_maps__works_join),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_maps__works_split),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_quantity__works_join),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_quantity__works_split),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_quantitys__works_join),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_quantitys__works_split),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_range__works_join),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_range__works_split),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_ranges__works_join),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_ranges__works_split),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_signed__works_join),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_signeds__works_join),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_signeds__works_split),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_string__works_join),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_strings__works_join),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_strings__works_split),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_triple__works_join),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_triple__works_split),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_triples__works_join),
+ cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_triples__works_split),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_uint8s__works_join),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_uint8s__works_split),
cmocka_unit_test(test__fl_fss_payload_header_map__abstruse_uint16s__works_join),
#include "test-fss-payload_header_map-abstruse_map_multis-split.h"
#include "test-fss-payload_header_map-abstruse_maps-join.h"
#include "test-fss-payload_header_map-abstruse_maps-split.h"
+#include "test-fss-payload_header_map-abstruse_quantity-join.h"
+#include "test-fss-payload_header_map-abstruse_quantity-split.h"
+#include "test-fss-payload_header_map-abstruse_quantitys-join.h"
+#include "test-fss-payload_header_map-abstruse_quantitys-split.h"
+#include "test-fss-payload_header_map-abstruse_range-join.h"
+#include "test-fss-payload_header_map-abstruse_range-split.h"
+#include "test-fss-payload_header_map-abstruse_ranges-join.h"
+#include "test-fss-payload_header_map-abstruse_ranges-split.h"
#include "test-fss-payload_header_map-abstruse_signed-join.h"
#include "test-fss-payload_header_map-abstruse_signeds-join.h"
#include "test-fss-payload_header_map-abstruse_signeds-split.h"
#include "test-fss-payload_header_map-abstruse_string-join.h"
#include "test-fss-payload_header_map-abstruse_strings-join.h"
#include "test-fss-payload_header_map-abstruse_strings-split.h"
+#include "test-fss-payload_header_map-abstruse_triple-join.h"
+#include "test-fss-payload_header_map-abstruse_triple-split.h"
+#include "test-fss-payload_header_map-abstruse_triples-join.h"
+#include "test-fss-payload_header_map-abstruse_triples-split.h"
#include "test-fss-payload_header_map-abstruse_uint8s-join.h"
#include "test-fss-payload_header_map-abstruse_uint8s-split.h"
#include "test-fss-payload_header_map-abstruse_uint16s-join.h"