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

Function test_rdev_failure

tests/commonlib/region-test.c:177–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177static void test_rdev_failure(void **state)
178{
179 will_return(mock_mmap, NULL);
180 will_return(mock_unmap, -1);
181 will_return(mock_readat, -1);
182 will_return(mock_writeat, -1);
183 will_return(mock_eraseat, -1);
184
185 rdev_mock_defaults();
186
187 assert_null(rdev_mmap(&mock_rdev, 0, mock_size));
188 assert_int_equal(rdev_munmap(&mock_rdev, mmap_result), -1);
189 assert_int_equal(rdev_readat(&mock_rdev, mock_buffer, 0, mock_size), -1);
190 assert_int_equal(rdev_writeat(&mock_rdev, mock_buffer, 0, mock_size), -1);
191 assert_int_equal(rdev_eraseat(&mock_rdev, 0, mock_size), -1);
192}
193
194static void test_rdev_wrap(void **state)
195{

Callers

nothing calls this directly

Calls 6

rdev_mock_defaultsFunction · 0.85
rdev_mmapFunction · 0.85
rdev_munmapFunction · 0.85
rdev_readatFunction · 0.85
rdev_writeatFunction · 0.85
rdev_eraseatFunction · 0.85

Tested by

no test coverage detected