MCPcopy Create free account
hub / github.com/coreboot/coreboot / fmap_test

Function fmap_test

util/cbfstool/test.c:289–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289int fmap_test(void)
290{
291 int rc = EXIT_SUCCESS;
292 struct fmap *my_fmap;
293
294 /*
295 * This test has two parts: Creation of an fmap with one or more
296 * area(s), and other stuff. Since a valid fmap is required to run
297 * many tests, we abort if fmap creation fails in any way.
298 *
299 * Also, fmap_csum_test() makes some assumptions based on the areas
300 * appended. See fmap_append_area_test() for details.
301 */
302 if ((my_fmap = fmap_create_test()) == NULL) {
303 rc = EXIT_FAILURE;
304 goto fmap_test_exit;
305 }
306
307 if (fmap_find_test(my_fmap)) {
308 rc = EXIT_FAILURE;
309 goto fmap_test_exit;
310 }
311
312 if (fmap_append_area_test(&my_fmap)) {
313 rc = EXIT_FAILURE;
314 goto fmap_test_exit;
315 }
316
317 rc |= fmap_find_area_test(my_fmap);
318 rc |= fmap_size_test();
319 rc |= fmap_flags_to_string_test();
320 rc |= fmap_print_test(my_fmap);
321
322fmap_test_exit:
323 fmap_destroy(my_fmap);
324 if (rc)
325 printf("FAILED\n");
326 return rc;
327}
328
329int main(void)
330{

Callers 1

mainFunction · 0.85

Calls 9

fmap_create_testFunction · 0.85
fmap_find_testFunction · 0.85
fmap_append_area_testFunction · 0.85
fmap_find_area_testFunction · 0.85
fmap_size_testFunction · 0.85
fmap_print_testFunction · 0.85
fmap_destroyFunction · 0.85
printfFunction · 0.85

Tested by

no test coverage detected