The string comparison of an integer based value is correct.
Add an explicit cast to make this intent clear and to silence the warnings.
assert_int_equal(destination.array[0].value.array[0].used, source.value.array[0].used);
assert_int_equal(destination.array[0].value.array[1].used, source.value.array[1].used);
- assert_string_equal(destination.array[0].name.string, source.name.string);
- assert_string_equal(destination.array[0].value.array[0].string, source.value.array[0].string);
- assert_string_equal(destination.array[0].value.array[1].string, source.value.array[1].string);
+ assert_string_equal((const char * const) destination.array[0].name.string, (const char * const) source.name.string);
+ assert_string_equal((const char * const) destination.array[0].value.array[0].string, (const char * const) source.value.array[0].string);
+ assert_string_equal((const char * const) destination.array[0].value.array[1].string, (const char * const) source.value.array[1].string);
for (f_array_length_t j = 0; j < destination.array[0].name.used; ++j) {
assert_int_equal(destination.array[0].name.string[j], source.name.string[j]);
status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].name.string, test_name.string);
+ assert_string_equal((const char * const) source.array[source.used].name.string, (const char * const) test_name.string);
assert_int_equal(source.array[source.used].name.used, test_name.used);
status = f_utf_string_dynamics_append_all(test_value, &source.array[source.used].value);
assert_int_equal(status, F_none);
assert_int_equal(source.array[source.used].value.array[0].used, test_value.array[0].used);
assert_int_equal(source.array[source.used].value.array[1].used, test_value.array[1].used);
- assert_string_equal(source.array[source.used].value.array[0].string, test_value.array[0].string);
- assert_string_equal(source.array[source.used].value.array[1].string, test_value.array[1].string);
+ assert_string_equal((const char * const) source.array[source.used].value.array[0].string, (const char * const) test_value.array[0].string);
+ assert_string_equal((const char * const) source.array[source.used].value.array[1].string, (const char * const) test_value.array[1].string);
} // for
}
assert_int_equal(destination.array[i].value.array[0].used, source.array[i].value.array[0].used);
assert_int_equal(destination.array[i].value.array[1].used, source.array[i].value.array[1].used);
- assert_string_equal(destination.array[i].name.string, source.array[i].name.string);
- assert_string_equal(destination.array[i].value.array[0].string, source.array[i].value.array[0].string);
- assert_string_equal(destination.array[i].value.array[1].string, source.array[i].value.array[1].string);
+ assert_string_equal((const char * const) destination.array[i].name.string, (const char * const) source.array[i].name.string);
+ assert_string_equal((const char * const) destination.array[i].value.array[0].string, (const char * const) source.array[i].value.array[0].string);
+ assert_string_equal((const char * const) destination.array[i].value.array[1].string, (const char * const) source.array[i].value.array[1].string);
} // for
}
status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].name.string, test_names[source.used].string);
- assert_int_equal(source.array[source.used].name.used, test_names[source.used].used);
+ assert_string_equal((const char * const) source.array[source.used].name.string, (const char * const) test_names[source.used].string);
+ assert_int_equal((const char * const) source.array[source.used].name.used, (const char * const) test_names[source.used].used);
status = f_utf_string_dynamics_append_all(test_values[source.used], &source.array[source.used].value);
assert_int_equal(source.array[source.used].value.array[0].used, test_values[source.used].array[0].used);
assert_int_equal(source.array[source.used].value.array[1].used, test_values[source.used].array[1].used);
- assert_string_equal(source.array[source.used].value.array[0].string, test_values[source.used].array[0].string);
- assert_string_equal(source.array[source.used].value.array[1].string, test_values[source.used].array[1].string);
+ assert_string_equal((const char * const) source.array[source.used].value.array[0].string, (const char * const) test_values[source.used].array[0].string);
+ assert_string_equal((const char * const) source.array[source.used].value.array[1].string, (const char * const) test_values[source.used].array[1].string);
} // for
}
assert_int_equal(destination.array[0].array[i].value.array[0].used, test_values[i].array[0].used);
assert_int_equal(destination.array[0].array[i].value.array[1].used, test_values[i].array[1].used);
- assert_string_equal(destination.array[0].array[i].name.string, test_names[i].string);
- assert_string_equal(destination.array[0].array[i].value.array[0].string, test_values[i].array[0].string);
- assert_string_equal(destination.array[0].array[i].value.array[1].string, test_values[i].array[1].string);
+ assert_string_equal((const char * const) destination.array[0].array[i].name.string, (const char * const) test_names[i].string);
+ assert_string_equal((const char * const) destination.array[0].array[i].value.array[0].string, (const char * const) test_values[i].array[0].string);
+ assert_string_equal((const char * const) destination.array[0].array[i].value.array[1].string, (const char * const) test_values[i].array[1].string);
} // for
}
assert_int_equal(status, F_none);
assert_int_equal(source.array[source.used].array[i].name.used, test_names[i].used);
- assert_string_equal(source.array[source.used].array[i].name.string, test_names[i].string);
+ assert_string_equal((const char * const) source.array[source.used].array[i].name.string, (const char * const) test_names[i].string);
status = f_utf_string_dynamics_append_all(test_values[i], &source.array[source.used].array[i].value);
assert_int_equal(source.array[source.used].array[i].value.array[0].used, test_values[i].array[0].used);
assert_int_equal(source.array[source.used].array[i].value.array[1].used, test_values[i].array[1].used);
- assert_string_equal(source.array[source.used].array[i].value.array[0].string, test_values[i].array[0].string);
- assert_string_equal(source.array[source.used].array[i].value.array[1].string, test_values[i].array[1].string);
+ assert_string_equal((const char * const) source.array[source.used].array[i].value.array[0].string, (const char * const) test_values[i].array[0].string);
+ assert_string_equal((const char * const) source.array[source.used].array[i].value.array[1].string, (const char * const) test_values[i].array[1].string);
} // for
source.array[source.used].used = length_inner;
assert_int_equal(destination.array[j].array[i].value.array[0].used, test_values[i].array[0].used);
assert_int_equal(destination.array[j].array[i].value.array[1].used, test_values[i].array[1].used);
- assert_string_equal(destination.array[j].array[i].name.string, test_names[i].string);
- assert_string_equal(destination.array[j].array[i].value.array[0].string, test_values[i].array[0].string);
- assert_string_equal(destination.array[j].array[i].value.array[1].string, test_values[i].array[1].string);
+ assert_string_equal((const char * const) destination.array[j].array[i].name.string, (const char * const) test_names[i].string);
+ assert_string_equal((const char * const) destination.array[j].array[i].value.array[0].string, (const char * const) test_values[i].array[0].string);
+ assert_string_equal((const char * const) destination.array[j].array[i].value.array[1].string, (const char * const) test_values[i].array[1].string);
} // for
} // for
}
f_status_t status = f_utf_string_dynamic_append(test_name, &source.name);
assert_int_equal(status, F_none);
- assert_string_equal(source.name.string, test_name.string);
+ assert_string_equal((const char * const) source.name.string, (const char * const) test_name.string);
assert_int_equal(source.name.used, test_name.used);
status = f_utf_string_dynamic_append(test_value, &source.value);
assert_int_equal(status, F_none);
- assert_string_equal(source.value.string, test_value.string);
+ assert_string_equal((const char * const) source.value.string, (const char * const) test_value.string);
assert_int_equal(source.value.used, test_value.used);
}
assert_int_equal(destination.used, 1);
assert_int_equal(destination.array[0].name.used, source.name.used);
assert_int_equal(destination.array[0].value.used, source.value.used);
- assert_string_equal(destination.array[0].name.string, source.name.string);
- assert_string_equal(destination.array[0].value.string, source.value.string);
+ assert_string_equal((const char * const) destination.array[0].name.string, (const char * const) source.name.string);
+ assert_string_equal((const char * const) destination.array[0].value.string, (const char * const) source.value.string);
}
free((void *) source.name.string);
status = f_utf_string_dynamic_append(test_name, &source.array[source.used].name);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].name.string, test_name.string);
+ assert_string_equal((const char * const) source.array[source.used].name.string, (const char * const) test_name.string);
assert_int_equal(source.array[source.used].name.used, test_name.used);
status = f_utf_string_dynamic_append(test_value, &source.array[source.used].value);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].value.string, test_value.string);
+ assert_string_equal((const char * const) source.array[source.used].value.string, (const char * const) test_value.string);
assert_int_equal(source.array[source.used].value.used, test_value.used);
} // for
}
assert_int_equal(destination.array[i].name.used, source.array[i].name.used);
assert_int_equal(destination.array[i].value.used, source.array[i].value.used);
- assert_string_equal(destination.array[i].name.string, source.array[i].name.string);
- assert_string_equal(destination.array[i].value.string, source.array[i].value.string);
+ assert_string_equal((const char * const) destination.array[i].name.string, (const char * const) source.array[i].name.string);
+ assert_string_equal((const char * const) destination.array[i].value.string, (const char * const) source.array[i].value.string);
} // for
}
status = f_utf_string_dynamic_append(test_names[source.used], &source.array[source.used].name);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].name.string, test_names[source.used].string);
- assert_int_equal(source.array[source.used].name.used, test_names[source.used].used);
+ assert_string_equal((const char * const) source.array[source.used].name.string, (const char * const) test_names[source.used].string);
+ assert_int_equal((const char * const) source.array[source.used].name.used, (const char * const) test_names[source.used].used);
status = f_utf_string_dynamic_append(test_values[source.used], &source.array[source.used].value);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].value.string, test_values[source.used].string);
- assert_int_equal(source.array[source.used].value.used, test_values[source.used].used);
+ assert_string_equal((const char * const) source.array[source.used].value.string, (const char * const) test_values[source.used].string);
+ assert_int_equal((const char * const) source.array[source.used].value.used, (const char * const) test_values[source.used].used);
} // for
}
assert_int_equal(destination.array[0].array[i].name.used, test_names[i].used);
assert_int_equal(destination.array[0].array[i].value.used, test_values[i].used);
- assert_string_equal(destination.array[0].array[i].name.string, test_names[i].string);
- assert_string_equal(destination.array[0].array[i].value.string, test_values[i].string);
+ assert_string_equal((const char * const) destination.array[0].array[i].name.string, (const char * const) test_names[i].string);
+ assert_string_equal((const char * const) destination.array[0].array[i].value.string, (const char * const) test_values[i].string);
} // for
}
status = f_utf_string_dynamic_append(test_names[i], &source.array[source.used].array[i].name);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].array[i].name.string, test_names[i].string);
+ assert_string_equal((const char * const) source.array[source.used].array[i].name.string, (const char * const) test_names[i].string);
assert_int_equal(source.array[source.used].array[i].name.used, test_names[i].used);
status = f_utf_string_dynamic_append(test_values[i], &source.array[source.used].array[i].value);
assert_int_equal(status, F_none);
- assert_string_equal(source.array[source.used].array[i].value.string, test_values[i].string);
+ assert_string_equal((const char * const) source.array[source.used].array[i].value.string, (const char * const) test_values[i].string);
assert_int_equal(source.array[source.used].array[i].value.used, test_values[i].used);
} // for
assert_int_equal(destination.array[j].array[i].name.used, test_names[i].used);
assert_int_equal(destination.array[j].array[i].value.used, test_values[i].used);
- assert_string_equal(destination.array[j].array[i].name.string, test_names[i].string);
- assert_string_equal(destination.array[j].array[i].value.string, test_values[i].string);
+ assert_string_equal((const char * const) destination.array[j].array[i].name.string, (const char * const) test_names[i].string);
+ assert_string_equal((const char * const) destination.array[j].array[i].value.string, (const char * const) test_values[i].string);
} // for
} // for
}
assert_int_equal(destination.array[0].b.used, source.b.used);
assert_int_equal(destination.array[0].c.used, source.c.used);
- assert_string_equal(destination.array[0].a.string, source.a.string);
- assert_string_equal(destination.array[0].b.string, source.b.string);
- assert_string_equal(destination.array[0].c.string, source.c.string);
+ assert_string_equal((const char * const) destination.array[0].a.string, (const char * const) source.a.string);
+ assert_string_equal((const char * const) destination.array[0].b.string, (const char * const) source.b.string);
+ assert_string_equal((const char * const) destination.array[0].c.string, (const char * const) source.c.string);
}
free((void *) destination.array[0].a.string);
assert_int_equal(destination.array[i].b.used, source.array[i].b.used);
assert_int_equal(destination.array[i].c.used, source.array[i].c.used);
- assert_string_equal(destination.array[i].a.string, source.array[i].a.string);
- assert_string_equal(destination.array[i].b.string, source.array[i].b.string);
- assert_string_equal(destination.array[i].c.string, source.array[i].c.string);
+ assert_string_equal((const char * const) destination.array[i].a.string, (const char * const) source.array[i].a.string);
+ assert_string_equal((const char * const) destination.array[i].b.string, (const char * const) source.array[i].b.string);
+ assert_string_equal((const char * const) destination.array[i].c.string, (const char * const) source.array[i].c.string);
} // for
}
assert_int_equal(destination.array[0].array[i].b.used, sources_array[i].b.used);
assert_int_equal(destination.array[0].array[i].c.used, sources_array[i].c.used);
- assert_string_equal(destination.array[0].array[i].a.string, sources_array[i].a.string);
- assert_string_equal(destination.array[0].array[i].b.string, sources_array[i].b.string);
- assert_string_equal(destination.array[0].array[i].c.string, sources_array[i].c.string);
+ assert_string_equal((const char * const) destination.array[0].array[i].a.string, (const char * const) sources_array[i].a.string);
+ assert_string_equal((const char * const) destination.array[0].array[i].b.string, (const char * const) sources_array[i].b.string);
+ assert_string_equal((const char * const) destination.array[0].array[i].c.string, (const char * const) sources_array[i].c.string);
} // for
}
assert_int_equal(destination.array[j].array[i].b.used, sources_set_array[j].array[i].b.used);
assert_int_equal(destination.array[j].array[i].c.used, sources_set_array[j].array[i].c.used);
- assert_string_equal(destination.array[j].array[i].a.string, sources_set_array[j].array[i].a.string);
- assert_string_equal(destination.array[j].array[i].b.string, sources_set_array[j].array[i].b.string);
- assert_string_equal(destination.array[j].array[i].c.string, sources_set_array[j].array[i].c.string);
+ assert_string_equal((const char * const) destination.array[j].array[i].a.string, (const char * const) sources_set_array[j].array[i].a.string);
+ assert_string_equal((const char * const) destination.array[j].array[i].b.string, (const char * const) sources_set_array[j].array[i].b.string);
+ assert_string_equal((const char * const) destination.array[j].array[i].c.string, (const char * const) sources_set_array[j].array[i].c.string);
} // for
} // for
}