| 350 | } |
| 351 | |
| 352 | static 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 | |
| 380 | static void test_imd_region_used(void **state) |
| 381 | { |
nothing calls this directly
no test coverage detected