3 comments:
/* Since strdup() requires malloc() it may only be invoked during ramstage
* phase. Expect dead_code/assert invocation otherwise.
*/
This is actually the excerpt from uut - src/lib/string.c. […]
nit: not actually removed?
Patch Set #2, Line 34: assert_int_equal(0, memcmp(str, duplicate, strlen(str)));
In that case, add a comment in this function that you're using assert_int_equal and memcmp instead o […]
Fair enough about assert_string_equal(). For strlen() you could use __builtin_strlen() (since it's a constant you could also just use (sizeof(str) - 1) in this case, but I think providing an example for using __builtin for this might be helpful). Guess we'll have to be a bit careful when testing libc stuff in general (thankfully, there's not too much of it in coreboot anyway).
Maybe mention that __builtin_xxx can be used for many of the most simple mem*()/str*() functions if you want a non-coreboot one.
To view, visit change 40538. To unsubscribe, or for help writing mail filters, visit settings.