/openbmc/linux/drivers/gpu/drm/tests/ |
H A D | drm_damage_helper_test.c | 28 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 …]
|
H A D | drm_plane_helper_test.c | 52 struct drm_plane_state *mock; in drm_plane_helper_init() local 62 mock = kunit_kzalloc(test, sizeof(*mock), GFP_KERNEL); in drm_plane_helper_init() 63 KUNIT_ASSERT_NOT_NULL(test, mock); in drm_plane_helper_init() 64 mock->plane = plane; in drm_plane_helper_init() 65 mock->crtc = ZERO_SIZE_PTR; in drm_plane_helper_init() 66 mock->fb = fb; in drm_plane_helper_init() 67 mock->rotation = params->rotation; in drm_plane_helper_init() 68 mock->src_x = params->src.x; in drm_plane_helper_init() 69 mock->src_y = params->src.y; in drm_plane_helper_init() 70 mock->src_w = params->src.w; in drm_plane_helper_init() [all …]
|
/openbmc/linux/drivers/platform/chrome/ |
H A D | cros_ec_proto_test.c | 197 struct ec_xfer_mock *mock; in cros_ec_proto_test_query_all_normal() local 204 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal() 205 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal() 207 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_normal() 217 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal() 218 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal() 220 data = (struct ec_response_get_protocol_info *)mock->o_data; in cros_ec_proto_test_query_all_normal() 228 mock = cros_kunit_ec_xfer_mock_add(test, sizeof(*data)); in cros_ec_proto_test_query_all_normal() 229 KUNIT_ASSERT_PTR_NE(test, mock, NULL); in cros_ec_proto_test_query_all_normal() 231 data = (struct ec_response_get_cmd_versions *)mock->o_data; in cros_ec_proto_test_query_all_normal() [all …]
|
H A D | cros_kunit_util.c | 26 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 …]
|
/openbmc/sdeventplus/test/ |
H A D | event.cpp | 24 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::__anonad1f7ae00111::EventTest 30 EXPECT_CALL(mock, sd_event_ref(expected_event)) in TEST_F() 32 Event event(expected_event, &mock); in TEST_F() 33 EXPECT_EQ(&mock, event.getSdEvent()); in TEST_F() 36 EXPECT_CALL(mock, sd_event_unref(expected_event)).WillOnce(Return(nullptr)); in TEST_F() 41 Event event(expected_event, std::false_type(), &mock); in TEST_F() 42 EXPECT_EQ(&mock, event.getSdEvent()); in TEST_F() 45 EXPECT_CALL(mock, sd_event_unref(expected_event)).WillOnce(Return(nullptr)); in TEST_F() 50 Event event(expected_event, std::false_type(), &mock); in TEST_F() 51 EXPECT_EQ(&mock, event.getSdEvent()); in TEST_F() [all …]
|
H A D | clock.cpp | 27 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::__anon710f0c2a0111::ClockTest 33 Event event(expected_event, std::false_type(), &mock); in TEST_F() 35 EXPECT_CALL(mock, sd_event_ref(expected_event)) in TEST_F() 38 EXPECT_CALL(mock, sd_event_now(expected_event, CLOCK_REALTIME, testing::_)) in TEST_F() 43 EXPECT_CALL(mock, sd_event_unref(expected_event)) in TEST_F() 50 Event event(expected_event, std::false_type(), &mock); in TEST_F() 53 EXPECT_CALL(mock, sd_event_now(expected_event, CLOCK_MONOTONIC, testing::_)) in TEST_F() 57 EXPECT_CALL(mock, sd_event_unref(expected_event)).WillOnce(Return(nullptr)); in TEST_F()
|
/openbmc/gpioplus/test/internal/ |
H A D | fd.cpp | 40 testing::StrictMock<test::SysMock> mock; member in gpioplus::internal::__anon69dc142a0111::FdTest 46 Fd fd(expected_fd, std::false_type(), &mock); in TEST_F() 48 EXPECT_EQ(&mock, fd.getSys()); in TEST_F() 50 EXPECT_CALL(mock, close(expected_fd)).WillOnce(Return(0)); in TEST_F() 55 Fd fd(-1, std::false_type(), &mock); in TEST_F() 61 EXPECT_CALL(mock, dup(expected_fd)).WillOnce(Return(expected_fd2)); in TEST_F() 62 Fd fd(expected_fd, &mock); in TEST_F() 64 EXPECT_EQ(&mock, fd.getSys()); in TEST_F() 66 EXPECT_CALL(mock, close(expected_fd2)).WillOnce(Return(0)); in TEST_F() 71 EXPECT_CALL(mock, dup(expected_fd)) in TEST_F() [all …]
|
/openbmc/google-ipmi-sys/test/ |
H A D | handler_unittest.cpp | 143 MockDbusHandler(sdbusplus::SdBusMock& mock, in MockDbusHandler() argument 145 Handler(config), mock_(&mock) in MockDbusHandler() 192 void ExpectGetManagedObjects(StrictMock<sdbusplus::SdBusMock>& mock, in ExpectGetManagedObjects() argument 201 EXPECT_CALL(mock, sd_bus_message_new_method_call( in ExpectGetManagedObjects() 209 EXPECT_CALL(mock, sd_bus_call(_, // sd_bus *bus, in ExpectGetManagedObjects() 218 EXPECT_CALL(mock, sd_bus_message_enter_container(msg, SD_BUS_TYPE_ARRAY, in ExpectGetManagedObjects() 222 EXPECT_CALL(mock, sd_bus_message_at_end(msg, 0)).WillOnce(Return(0)); in ExpectGetManagedObjects() 224 EXPECT_CALL(mock, sd_bus_message_enter_container( in ExpectGetManagedObjects() 228 EXPECT_CALL(mock, sd_bus_message_read_basic(msg, SD_BUS_TYPE_OBJECT_PATH, in ExpectGetManagedObjects() 232 EXPECT_CALL(mock, sd_bus_message_enter_container(msg, SD_BUS_TYPE_ARRAY, in ExpectGetManagedObjects() [all …]
|
/openbmc/linux/drivers/gpu/drm/i915/gem/selftests/ |
H A D | mock_dmabuf.c | 12 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 …]
|
/openbmc/sdeventplus/test/source/ |
H A D | event.cpp | 35 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::source::__anon972e2b400111::EventTest 44 EXPECT_CALL(this->mock, sd_event_unref(event)) in make_event() 48 return UniqueEvent(new Event(event, std::false_type(), &mock), deleter); in make_event() 53 EXPECT_CALL(mock, sd_event_source_unref(expected_source)) in expect_destruct() 55 EXPECT_CALL(mock, sd_event_unref(expected_event)) in expect_destruct() 62 EXPECT_CALL(mock, sd_event_ref(expected_event)) in TEST_F() 68 EXPECT_CALL(mock, sd_event_source_set_destroy_callback(expected_source, in TEST_F() 71 EXPECT_CALL(mock, in TEST_F() 74 EXPECT_CALL(mock, sd_event_source_get_userdata(expected_source)) in TEST_F() 78 EXPECT_CALL(mock, sd_event_add_defer(expected_event, testing::_, testing::_, in TEST_F() [all …]
|
H A D | io.cpp | 35 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::source::__anon8d6417760111::IOTest 44 EXPECT_CALL(this->mock, sd_event_unref(event)) in make_event() 48 return UniqueEvent(new Event(event, std::false_type(), &mock), deleter); in make_event() 53 EXPECT_CALL(mock, sd_event_source_unref(expected_source)) in expect_destruct() 55 EXPECT_CALL(mock, sd_event_unref(expected_event)) in expect_destruct() 65 EXPECT_CALL(mock, sd_event_ref(expected_event)) in TEST_F() 68 EXPECT_CALL(mock, sd_event_add_io(expected_event, testing::_, fd, events, in TEST_F() 76 EXPECT_CALL(mock, sd_event_source_set_destroy_callback(expected_source, in TEST_F() 79 EXPECT_CALL(mock, in TEST_F() 82 EXPECT_CALL(mock, sd_event_source_get_userdata(expected_source)) in TEST_F() [all …]
|
H A D | base.cpp | 67 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::source::__anon6c3f73390111::BaseTest 80 EXPECT_CALL(this->mock, sd_event_unref(event)) in make_event() 84 return UniqueEvent(new Event(event, std::false_type(), &mock), deleter); in make_event() 92 EXPECT_CALL(mock, sd_event_ref(event.get())) in make_base() 99 mock, sd_event_source_set_destroy_callback(source, testing::_)) in make_base() 101 EXPECT_CALL(mock, sd_event_source_set_userdata(source, testing::_)) in make_base() 105 EXPECT_CALL(mock, sd_event_source_get_userdata(source)) in make_base() 117 EXPECT_CALL(mock, sd_event_source_set_prepare(base.get(), testing::_)) in set_prepare_placeholder() 135 EXPECT_CALL(mock, sd_event_source_unref(source)) in expect_base_destruct() 137 EXPECT_CALL(mock, sd_event_unref(event.get())) in expect_base_destruct() [all …]
|
H A D | signal.cpp | 36 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::source::__anon7bac141c0111::SignalTest 45 EXPECT_CALL(this->mock, sd_event_unref(event)) in make_event() 49 return UniqueEvent(new Event(event, std::false_type(), &mock), deleter); in make_event() 54 EXPECT_CALL(mock, sd_event_source_unref(expected_source)) in expect_destruct() 56 EXPECT_CALL(mock, sd_event_unref(expected_event)) in expect_destruct() 65 EXPECT_CALL(mock, sd_event_ref(expected_event)) in TEST_F() 68 EXPECT_CALL(mock, sd_event_add_signal(expected_event, testing::_, sig, in TEST_F() 76 EXPECT_CALL(mock, sd_event_source_set_destroy_callback(expected_source, in TEST_F() 79 EXPECT_CALL(mock, in TEST_F() 82 EXPECT_CALL(mock, sd_event_source_get_userdata(expected_source)) in TEST_F() [all …]
|
H A D | child.cpp | 36 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::source::__anonf0b8bea20111::ChildTest 45 EXPECT_CALL(this->mock, sd_event_unref(event)) in make_event() 49 return UniqueEvent(new Event(event, std::false_type(), &mock), deleter); in make_event() 54 EXPECT_CALL(mock, sd_event_source_unref(expected_source)) in expect_destruct() 56 EXPECT_CALL(mock, sd_event_unref(expected_event)) in expect_destruct() 66 EXPECT_CALL(mock, sd_event_ref(expected_event)) in TEST_F() 69 EXPECT_CALL(mock, sd_event_add_child(expected_event, testing::_, pid, in TEST_F() 77 EXPECT_CALL(mock, sd_event_source_set_destroy_callback(expected_source, in TEST_F() 80 EXPECT_CALL(mock, in TEST_F() 83 EXPECT_CALL(mock, sd_event_source_get_userdata(expected_source)) in TEST_F() [all …]
|
H A D | time.cpp | 36 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::source::__anon62b35d4d0111::TimeTest 45 EXPECT_CALL(this->mock, sd_event_unref(event)) in make_event() 49 return UniqueEvent(new Event(event, std::false_type(), &mock), deleter); in make_event() 54 EXPECT_CALL(mock, sd_event_source_unref(source)) in expect_time_destroy() 56 EXPECT_CALL(mock, sd_event_unref(event)).WillOnce(Return(nullptr)); in expect_time_destroy() 71 EXPECT_CALL(mock, sd_event_ref(expected_event)) in TEST_F() 74 EXPECT_CALL(mock, in TEST_F() 83 EXPECT_CALL(mock, sd_event_source_set_destroy_callback(expected_source, in TEST_F() 86 EXPECT_CALL(mock, in TEST_F() 89 EXPECT_CALL(mock, sd_event_source_get_userdata(expected_source)) in TEST_F() [all …]
|
/openbmc/phosphor-inventory-manager/test/ |
H A D | interface_ops_test.cpp | 116 MockInterface mock; in TEST() local 120 EXPECT_CALL(mock, constructWithoutProperties("foo")).Times(1); in TEST() 121 EXPECT_CALL(mock, constructWithProperties(_, _, _)).Times(0); in TEST() 133 MockInterface mock; in TEST() local 137 EXPECT_CALL(mock, constructWithoutProperties("foo")).Times(1); in TEST() 138 EXPECT_CALL(mock, constructWithProperties(_, _, _)).Times(0); in TEST() 150 MockInterface mock; in TEST() local 154 EXPECT_CALL(mock, constructWithoutProperties(_)).Times(0); in TEST() 155 EXPECT_CALL(mock, constructWithProperties("bar", _, _)).Times(1); in TEST() 167 MockInterface mock; in TEST() local [all …]
|
/openbmc/linux/drivers/gpu/drm/i915/gt/ |
H A D | mock_engine.c | 97 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 …]
|
/openbmc/openbmc/meta-openembedded/meta-oe/recipes-test/cmocka/ |
H A D | cmocka_1.1.7.bb | 1 DESCRIPTION = "cmocka is an elegant unit testing framework for C with support for mock \ 26 install -d ${D}${libdir}/${BPN}/example/mock/chef_wrap 27 install -d ${D}${libdir}/${BPN}/example/mock/uptime 30 …install -m 0755 ${B}/example/mock/chef_wrap/waiter_test_wrap ${D}/${libdir}/${BPN}/example/mock/ch… 31 install -m 0755 ${B}/example/mock/uptime/uptime ${D}/${libdir}/${BPN}/example/mock/uptime 32 install -m 0755 ${B}/example/mock/uptime/test_uptime ${D}/${libdir}/${BPN}/example/mock/uptime 33 …install -m 0644 ${B}/example/mock/uptime/libproc_uptime.so ${D}/${libdir}/${BPN}/example/mock/libp…
|
/openbmc/gpioplus/test/ |
H A D | event.cpp | 47 testing::StrictMock<test::SysMock> mock; member in gpioplus::__anon700490560111::EventTest 52 EXPECT_CALL(mock, open(testing::_, testing::_)) in SetUp() 54 chip = std::make_unique<Chip>(0, &mock); in SetUp() 59 EXPECT_CALL(mock, close(chip_fd)).WillOnce(Return(0)); in TearDown() 75 EXPECT_CALL(mock, gpio_get_lineevent(chip_fd, testing::_)) in TEST_F() 86 EXPECT_CALL(mock, close(event_fd)).WillOnce(Return(0)); in TEST_F() 108 EXPECT_CALL(mock, gpio_get_lineevent(chip_fd, testing::_)) in TEST_F() 130 EXPECT_CALL(mock, gpio_get_lineevent(chip_fd, testing::_)) in SetUp() 138 EXPECT_CALL(mock, close(event_fd)).WillOnce(Return(0)); in TearDown() 154 EXPECT_CALL(mock, read(event_fd, testing::_, sizeof(struct gpioevent_data))) in TEST_F() [all …]
|
H A D | handle.cpp | 61 testing::StrictMock<test::SysMock> mock; member in gpioplus::__anon2c27dd800111::HandleTest 66 EXPECT_CALL(mock, open(testing::_, testing::_)) in SetUp() 68 chip = std::make_unique<Chip>(0, &mock); in SetUp() 73 EXPECT_CALL(mock, close(chip_fd)).WillOnce(Return(0)); in TearDown() 89 EXPECT_CALL(mock, gpio_get_linehandle(chip_fd, testing::_)) in TEST_F() 107 EXPECT_CALL(mock, close(handle_fd)).WillOnce(Return(0)); in TEST_F() 135 EXPECT_CALL(mock, gpio_get_linehandle(chip_fd, testing::_)) in TEST_F() 163 EXPECT_CALL(mock, gpio_get_linehandle(chip_fd, testing::_)) in SetUp() 172 EXPECT_CALL(mock, close(handle_fd)).WillOnce(Return(0)); in TearDown() 185 EXPECT_CALL(mock, gpiohandle_get_line_values(handle_fd, testing::_)) in TEST_F() [all …]
|
H A D | chip.cpp | 49 testing::StrictMock<test::SysMock> mock; member in gpioplus::__anone73f82f80111::ChipMethodTest 57 EXPECT_CALL(mock, open(StrEq(path), O_RDONLY | O_CLOEXEC)) in SetUp() 59 chip = std::make_unique<Chip>(chip_id, &mock); in SetUp() 64 EXPECT_CALL(mock, close(expected_fd)).WillOnce(Return(0)); in TearDown() 72 EXPECT_EQ(&mock, chip->getFd().getSys()); in TEST_F() 85 EXPECT_CALL(mock, gpio_get_chipinfo(expected_fd, testing::_)) in TEST_F() 95 EXPECT_CALL(mock, gpio_get_chipinfo(expected_fd, testing::_)) in TEST_F() 111 EXPECT_CALL(mock, gpio_get_lineinfo(expected_fd, testing::_)) in TEST_F() 130 EXPECT_CALL(mock, gpio_get_lineinfo(expected_fd, testing::_)) in TEST_F()
|
/openbmc/sdeventplus/test/utility/ |
H A D | timer.cpp | 50 testing::StrictMock<test::SdEventMock> mock; member in sdeventplus::utility::__anon9ead1e020111::TimerTest 68 EXPECT_CALL(mock, in expectNow() 76 EXPECT_CALL(mock, in expectSetTime() 83 EXPECT_CALL(mock, sd_event_source_set_enabled( in expectSetEnabled() 90 EXPECT_CALL(mock, in expectGetEnabled() 117 EXPECT_CALL(mock, sd_event_ref(expected_event)) in SetUp() 119 EXPECT_CALL(mock, sd_event_unref(expected_event)) in SetUp() 121 event = std::make_unique<Event>(expected_event, &mock); in SetUp() 122 EXPECT_CALL(mock, sd_event_source_unref(expected_source)) in SetUp() 124 EXPECT_CALL(mock, sd_event_source_set_destroy_callback(expected_source, in SetUp() [all …]
|
/openbmc/openbmc/meta-arm/meta-arm/lib/oeqa/selftest/cases/ |
H A D | runfvp.py | 6 import unittest.mock 92 return unittest.mock.patch("subprocess.Popen") 94 @unittest.mock.patch.dict(os.environ, {"PATH": "/path-42:/usr/sbin:/usr/bin:/sbin:/bin"}) 120 stdin=unittest.mock.ANY, 121 stdout=unittest.mock.ANY, 122 stderr=unittest.mock.ANY, 126 …@unittest.mock.patch.dict(os.environ, {"DISPLAY": ":42", "WAYLAND_DISPLAY": "wayland-42", "PATH": … 148 stdin=unittest.mock.ANY, 149 stdout=unittest.mock.ANY, 150 stderr=unittest.mock.ANY,
|
/openbmc/estoraged/src/test/erase/ |
H A D | pattern_test.cpp | 108 stdplus::fd::FdMock mock; in TEST() local 113 EXPECT_CALL(mock, write(_)) in TEST() 119 EXPECT_CALL(mock, write(_)) in TEST() 125 EXPECT_CALL(mock, write(_)) in TEST() 133 EXPECT_CALL(mock, read(_)) in TEST() 141 EXPECT_CALL(mock, read(_)) in TEST() 149 EXPECT_CALL(mock, read(_)) in TEST() 157 EXPECT_NO_THROW(pass.writePattern(size, mock)); in TEST() 158 EXPECT_NO_THROW(pass.verifyPattern(size, mock)); in TEST() 175 stdplus::fd::FdMock mock; in TEST() local [all …]
|
/openbmc/openbmc/meta-openembedded/meta-multimedia/recipes-multimedia/bluealsa/bluealsa/ |
H A D | 0001-Use-basename-implementation-from-glib-2.0.patch | 10 test/mock/mock.c | 2 +- 35 diff --git a/test/mock/mock.c b/test/mock/mock.c 37 --- a/test/mock/mock.c 38 +++ b/test/mock/mock.c
|