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].key.string, source.key.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].key.string, (const char * const) source.key.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_number_unsigned_t j = 0; j < destination.array[0].key.used; ++j) {
assert_int_equal(destination.array[0].key.string[j], source.key.string[j]);
status = f_utf_string_dynamic_append(test_key, &source.array[source.used].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].key.string, test_key.string);
+ assert_string_equal((const char * const) source.array[source.used].key.string, (const char * const) test_key.string);
assert_int_equal(source.array[source.used].key.used, test_key.used);
status = f_utf_string_dynamics_append_all(test_value, &source.array[source.used].value);
assert_int_equal(status, F_okay);
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].key.string, source.array[i].key.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].key.string, (const char * const) source.array[i].key.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].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].key.string, test_names[source.used].string);
+ assert_string_equal((const char * const) source.array[source.used].key.string, (const char * const) test_names[source.used].string);
assert_int_equal(source.array[source.used].key.used, 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].key.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].key.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_okay);
assert_int_equal(source.array[source.used].array[i].key.used, test_names[i].used);
- assert_string_equal(source.array[source.used].array[i].key.string, test_names[i].string);
+ assert_string_equal((const char * const) source.array[source.used].array[i].key.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].key.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].key.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_key, &source.key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.key.string, test_key.string);
+ assert_string_equal((const char * const) source.key.string, (const char * const) test_key.string);
assert_int_equal(source.key.used, test_key.used);
status = f_utf_string_dynamic_append(test_value, &source.value);
assert_int_equal(status, F_okay);
- 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].key.used, source.key.used);
assert_int_equal(destination.array[0].value.used, source.value.used);
- assert_string_equal(destination.array[0].key.string, source.key.string);
- assert_string_equal(destination.array[0].value.string, source.value.string);
+ assert_string_equal((const char * const) destination.array[0].key.string, (const char * const) source.key.string);
+ assert_string_equal((const char * const) destination.array[0].value.string, (const char * const) source.value.string);
}
free((void *) source.key.string);
status = f_utf_string_dynamic_append(test_key, &source.array[source.used].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].key.string, test_key.string);
+ assert_string_equal((const char * const) source.array[source.used].key.string, (const char * const) test_key.string);
assert_int_equal(source.array[source.used].key.used, test_key.used);
status = f_utf_string_dynamic_append(test_value, &source.array[source.used].value);
assert_int_equal(status, F_okay);
- 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].key.used, source.array[i].key.used);
assert_int_equal(destination.array[i].value.used, source.array[i].value.used);
- assert_string_equal(destination.array[i].key.string, source.array[i].key.string);
- assert_string_equal(destination.array[i].value.string, source.array[i].value.string);
+ assert_string_equal((const char * const) destination.array[i].key.string, (const char * const) source.array[i].key.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].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].key.string, test_names[source.used].string);
+ assert_string_equal((const char * const) source.array[source.used].key.string, (const char * const) test_names[source.used].string);
assert_int_equal(source.array[source.used].key.used, 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_okay);
- assert_string_equal(source.array[source.used].value.string, test_values[source.used].string);
+ assert_string_equal((const char * const) source.array[source.used].value.string, (const char * const) test_values[source.used].string);
assert_int_equal(source.array[source.used].value.used, test_values[source.used].used);
} // for
}
assert_int_equal(destination.array[0].array[i].key.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].key.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].key.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].key);
assert_int_equal(status, F_okay);
- assert_string_equal(source.array[source.used].array[i].key.string, test_names[i].string);
+ assert_string_equal((const char * const) source.array[source.used].array[i].key.string, (const char * const) test_names[i].string);
assert_int_equal(source.array[source.used].array[i].key.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_okay);
- 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].key.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].key.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].key.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
}