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

Function test_imd_lockdown

tests/lib/imd-test.c:352–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352static void test_imd_lockdown(void **state)
353{
354 struct imd imd = {0};
355 struct imd_root *r_lg, *r_sm;
356
357 assert_int_equal(-1, imd_lockdown(&imd));
358
359 imd.lg.r = malloc(sizeof(struct imd_root));
360 if (imd.lg.r == NULL)
361 fail_msg("Cannot allocate enough memory - fail test");
362
363 r_lg = (struct imd_root *)(imd.lg.r);
364
365 assert_int_equal(0, imd_lockdown(&imd));
366 assert_true(r_lg->flags & IMD_FLAG_LOCKED);
367
368 imd.sm.r = malloc(sizeof(struct imd_root));
369 if (imd.sm.r == NULL)
370 fail_msg("Cannot allocate enough memory - fail test");
371 r_sm = (struct imd_root *)(imd.sm.r);
372
373 assert_int_equal(0, imd_lockdown(&imd));
374 assert_true(r_sm->flags & IMD_FLAG_LOCKED);
375
376 free(imd.lg.r);
377 free(imd.sm.r);
378}
379
380static void test_imd_region_used(void **state)
381{

Callers

nothing calls this directly

Calls 3

imd_lockdownFunction · 0.85
mallocFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected