Home
last modified time | relevance | path

Searched refs:mock (Results 1 – 17 of 17) sorted by relevance

/linux-6.1.9/drivers/gpu/drm/tests/
Ddrm_damage_helper_test.c28 struct drm_damage_mock *mock; in drm_damage_helper_init() local
30 mock = kunit_kzalloc(test, sizeof(*mock), GFP_KERNEL); in drm_damage_helper_init()
31 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, mock); in drm_damage_helper_init()
33 mock->fb.width = 2048; in drm_damage_helper_init()
34 mock->fb.height = 2048; in drm_damage_helper_init()
36 mock->state.crtc = ZERO_SIZE_PTR; in drm_damage_helper_init()
37 mock->state.fb = &mock->fb; in drm_damage_helper_init()
38 mock->state.visible = true; in drm_damage_helper_init()
40 mock->old_state.plane = &mock->plane; in drm_damage_helper_init()
41 mock->state.plane = &mock->plane; in drm_damage_helper_init()
[all …]
Ddrm_framebuffer_test.c335 struct drm_device *mock; in drm_framebuffer_test_init() local
337 mock = kunit_kzalloc(test, sizeof(*mock), GFP_KERNEL); in drm_framebuffer_test_init()
338 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, mock); in drm_framebuffer_test_init()
340 mock->mode_config.min_width = MIN_WIDTH; in drm_framebuffer_test_init()
341 mock->mode_config.max_width = MAX_WIDTH; in drm_framebuffer_test_init()
342 mock->mode_config.min_height = MIN_HEIGHT; in drm_framebuffer_test_init()
343 mock->mode_config.max_height = MAX_HEIGHT; in drm_framebuffer_test_init()
344 mock->mode_config.funcs = &mock_config_funcs; in drm_framebuffer_test_init()
346 test->priv = mock; in drm_framebuffer_test_init()
353 struct drm_device *mock = test->priv; in drm_test_framebuffer_create() local
[all …]
/linux-6.1.9/drivers/platform/chrome/
Dcros_ec_proto_test.c196 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_normal() local
203 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
204 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
206 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_normal()
216 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
217 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
219 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_normal()
227 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal()
228 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal()
230 data = (struct ec_response_get_cmd_versions *)mock->o_data; in cros_ec_proto_test_query_all_normal()
[all …]
Dcros_kunit_util.c26 struct ec_xfer_mock *mock; in cros_kunit_ec_xfer_mock() local
28 mock = list_first_entry_or_null(&cros_kunit_ec_xfer_mock_in, struct ec_xfer_mock, list); in cros_kunit_ec_xfer_mock()
29 if (!mock) { in cros_kunit_ec_xfer_mock()
34 list_del(&mock->list); in cros_kunit_ec_xfer_mock()
36 memcpy(&mock->msg, msg, sizeof(*msg)); in cros_kunit_ec_xfer_mock()
38 mock->i_data = kunit_kzalloc(mock->test, msg->outsize, GFP_KERNEL); in cros_kunit_ec_xfer_mock()
39 if (mock->i_data) in cros_kunit_ec_xfer_mock()
40 memcpy(mock->i_data, msg->data, msg->outsize); in cros_kunit_ec_xfer_mock()
43 msg->result = mock->result; in cros_kunit_ec_xfer_mock()
45 memcpy(msg->data, mock->o_data, min(msg->insize, mock->o_data_len)); in cros_kunit_ec_xfer_mock()
[all …]
/linux-6.1.9/drivers/gpu/drm/i915/gem/selftests/
Dmock_dmabuf.c12 struct mock_dmabuf *mock = to_mock(attachment->dmabuf); in mock_map_dma_buf() local
21 err = sg_alloc_table(st, mock->npages, GFP_KERNEL); in mock_map_dma_buf()
26 for (i = 0; i < mock->npages; i++) { in mock_map_dma_buf()
27 sg_set_page(sg, mock->pages[i], PAGE_SIZE, 0); in mock_map_dma_buf()
55 struct mock_dmabuf *mock = to_mock(dma_buf); in mock_dmabuf_release() local
58 for (i = 0; i < mock->npages; i++) in mock_dmabuf_release()
59 put_page(mock->pages[i]); in mock_dmabuf_release()
61 kfree(mock); in mock_dmabuf_release()
66 struct mock_dmabuf *mock = to_mock(dma_buf); in mock_dmabuf_vmap() local
69 vaddr = vm_map_ram(mock->pages, mock->npages, 0); in mock_dmabuf_vmap()
[all …]
/linux-6.1.9/drivers/gpu/drm/i915/gt/
Dmock_engine.c97 mock.link); in first_request()
102 list_del_init(&request->mock.link); in advance()
127 if (request->mock.delay) { in hw_delay_complete()
129 jiffies + request->mock.delay); in hw_delay_complete()
219 INIT_LIST_HEAD(&request->mock.link); in mock_request_alloc()
220 request->mock.delay = 0; in mock_request_alloc()
245 list_add_tail(&request->mock.link, &engine->hw_queue); in mock_submit_request()
246 if (list_is_first(&request->mock.link, &engine->hw_queue)) { in mock_submit_request()
247 if (request->mock.delay) in mock_submit_request()
249 jiffies + request->mock.delay); in mock_submit_request()
[all …]
Dselftest_execlists.c2784 rq->mock.link.next = &(*prev)->mock.link; in create_gang()
3020 struct i915_request *n = list_next_entry(rq, mock.link); in live_preempt_gang()
/linux-6.1.9/tools/testing/kunit/
Dkunit_tool_test.py10 from unittest import mock
213 print_mock = mock.patch('kunit_printer.Printer.print').start()
354 mock.patch.object(signal, 'signal').start()
355 self.addCleanup(mock.patch.stopall)
417 mock.patch.object(tree._ops, 'start', side_effect=fake_start).start()
437 mock_build_config = mock.patch.object(tree, 'build_config').start()
458 mock_build_config = mock.patch.object(tree, 'build_config').start()
478 mock_build_config = mock.patch.object(tree, 'build_config').start()
535 self.print_mock = mock.patch('kunit_printer.Printer.print').start()
536 self.addCleanup(mock.patch.stopall)
[all …]
/linux-6.1.9/drivers/gpu/drm/i915/selftests/
Di915_selftest.c71 int (*mock)(void); member
76 #define selftest(n, f) [mock_##n] = { .name = #n, { .mock = f } },
163 err = st->mock(); in __run_selftests()
185 if (!i915_selftest.mock) in i915_mock_selftests()
188 err = run_selftests(mock, NULL); in i915_mock_selftests()
190 i915_selftest.mock = err; in i915_mock_selftests()
194 if (i915_selftest.mock < 0) { in i915_mock_selftests()
195 i915_selftest.mock = -ENOTTY; in i915_mock_selftests()
433 module_param_named_unsafe(mock_selftests, i915_selftest.mock, int, 0400);
Dmock_request.c40 request->mock.delay = delay; in mock_request()
51 was_queued = !list_empty(&request->mock.link); in mock_cancel_request()
52 list_del_init(&request->mock.link); in mock_cancel_request()
/linux-6.1.9/tools/testing/cxl/test/
Dmock.c14 static LIST_HEAD(mock);
18 list_add_rcu(&ops->list, &mock); in register_cxl_mock_ops()
34 return list_first_or_null_rcu(&mock, struct cxl_mock_ops, list); in get_cxl_mock_ops()
DKbuild9 cxl_mock-y := mock.o
/linux-6.1.9/drivers/net/dsa/
DKconfig20 tristate "DSA mock-up Ethernet switch chip support"
23 This enables support for a fake mock-up switch chip which
/linux-6.1.9/drivers/gpu/drm/i915/
Di915_selftest.h37 int mock; member
Di915_request.h354 } mock;)
/linux-6.1.9/Documentation/dev-tools/kunit/
Dindex.rst33 It is inspired by JUnit, Python’s unittest.mock, and GoogleTest/GoogleMock
/linux-6.1.9/Documentation/networking/
Dnexthop-group-resilient.rst278 The netdevsim driver implements a mock offload of resilient groups, and