]>
git.ipfire.org Git - people/ms/u-boot.git/blob - test/dm/mailbox.c
2 * Copyright (c) 2016, NVIDIA CORPORATION.
4 * SPDX-License-Identifier: GPL-2.0
13 static int dm_test_mailbox(struct unit_test_state
*uts
)
18 ut_assertok(uclass_get_device_by_name(UCLASS_MISC
, "mbox-test", &dev
));
19 ut_assertok(sandbox_mbox_test_get(dev
));
21 ut_asserteq(-ETIMEDOUT
, sandbox_mbox_test_recv(dev
, &msg
));
22 ut_assertok(sandbox_mbox_test_send(dev
, 0xaaff9955UL
));
23 ut_assertok(sandbox_mbox_test_recv(dev
, &msg
));
24 ut_asserteq(msg
, 0xaaff9955UL
^ SANDBOX_MBOX_PING_XOR
);
25 ut_asserteq(-ETIMEDOUT
, sandbox_mbox_test_recv(dev
, &msg
));
27 ut_assertok(sandbox_mbox_test_free(dev
));
31 DM_TEST(dm_test_mailbox
, DM_TESTF_SCAN_FDT
);