usb.c (a57a8174067006a4bc0a2d2a918ec9f6149b68ba) usb.c (7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86)
1/*
2 * Copyright (C) 2015 Google, Inc
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <console.h>

--- 36 unchanged lines hidden (view full) ---

45 state_set_skip_delays(true);
46 ut_assertok(usb_init());
47 ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 0, &dev));
48 ut_assertok(get_device("usb", "0", &dev_desc));
49
50 /* Read a few blocks and look for the string we expect */
51 ut_asserteq(512, dev_desc->blksz);
52 memset(cmp, '\0', sizeof(cmp));
1/*
2 * Copyright (C) 2015 Google, Inc
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <console.h>

--- 36 unchanged lines hidden (view full) ---

45 state_set_skip_delays(true);
46 ut_assertok(usb_init());
47 ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 0, &dev));
48 ut_assertok(get_device("usb", "0", &dev_desc));
49
50 /* Read a few blocks and look for the string we expect */
51 ut_asserteq(512, dev_desc->blksz);
52 memset(cmp, '\0', sizeof(cmp));
53 ut_asserteq(2, dev_desc->block_read(dev_desc->dev, 0, 2, cmp));
53 ut_asserteq(2, dev_desc->block_read(dev_desc, 0, 2, cmp));
54 ut_assertok(strcmp(cmp, "this is a test"));
55
56 return 0;
57}
58DM_TEST(dm_test_usb_flash, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
59
60/* test that we can handle multiple storage devices */
61static int dm_test_usb_multi(struct unit_test_state *uts)

--- 239 unchanged lines hidden ---
54 ut_assertok(strcmp(cmp, "this is a test"));
55
56 return 0;
57}
58DM_TEST(dm_test_usb_flash, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
59
60/* test that we can handle multiple storage devices */
61static int dm_test_usb_multi(struct unit_test_state *uts)

--- 239 unchanged lines hidden ---