diff options
Diffstat (limited to 'test/dm')
-rw-r--r-- | test/dm/acpi.c | 6 | ||||
-rw-r--r-- | test/dm/axi.c | 5 | ||||
-rw-r--r-- | test/dm/blk.c | 1 | ||||
-rw-r--r-- | test/dm/board.c | 1 | ||||
-rw-r--r-- | test/dm/bootcount.c | 1 | ||||
-rw-r--r-- | test/dm/bus.c | 1 | ||||
-rw-r--r-- | test/dm/clk.c | 1 | ||||
-rw-r--r-- | test/dm/core.c | 1 | ||||
-rw-r--r-- | test/dm/cpu.c | 1 | ||||
-rw-r--r-- | test/dm/devres.c | 1 | ||||
-rw-r--r-- | test/dm/dma.c | 6 | ||||
-rw-r--r-- | test/dm/eth.c | 13 | ||||
-rw-r--r-- | test/dm/gpio.c | 1 | ||||
-rw-r--r-- | test/dm/i2c.c | 18 | ||||
-rw-r--r-- | test/dm/mdio.c | 1 | ||||
-rw-r--r-- | test/dm/misc.c | 10 | ||||
-rw-r--r-- | test/dm/mmc.c | 1 | ||||
-rw-r--r-- | test/dm/ofnode.c | 1 | ||||
-rw-r--r-- | test/dm/osd.c | 134 | ||||
-rw-r--r-- | test/dm/phy.c | 1 | ||||
-rw-r--r-- | test/dm/regmap.c | 1 | ||||
-rw-r--r-- | test/dm/regulator.c | 1 | ||||
-rw-r--r-- | test/dm/remoteproc.c | 6 | ||||
-rw-r--r-- | test/dm/reset.c | 1 | ||||
-rw-r--r-- | test/dm/rng.c | 1 | ||||
-rw-r--r-- | test/dm/rtc.c | 1 | ||||
-rw-r--r-- | test/dm/serial.c | 1 | ||||
-rw-r--r-- | test/dm/sf.c | 4 | ||||
-rw-r--r-- | test/dm/syscon.c | 1 | ||||
-rw-r--r-- | test/dm/tee.c | 1 | ||||
-rw-r--r-- | test/dm/test-driver.c | 1 | ||||
-rw-r--r-- | test/dm/test-fdt.c | 1 | ||||
-rw-r--r-- | test/dm/test-main.c | 3 | ||||
-rw-r--r-- | test/dm/test-uclass.c | 1 | ||||
-rw-r--r-- | test/dm/usb.c | 1 | ||||
-rw-r--r-- | test/dm/video.c | 1 |
36 files changed, 134 insertions, 97 deletions
diff --git a/test/dm/acpi.c b/test/dm/acpi.c index 176d207a55..4c46dd83a6 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -218,20 +218,20 @@ static int dm_test_acpi_setup_base_tables(struct unit_test_state *uts) rsdp = buf + 16; ut_asserteq_ptr(rsdp, ctx.rsdp); - ut_assertok(memcmp(RSDP_SIG, rsdp->signature, sizeof(rsdp->signature))); + ut_asserteq_mem(RSDP_SIG, rsdp->signature, sizeof(rsdp->signature)); ut_asserteq(sizeof(*rsdp), rsdp->length); ut_assertok(table_compute_checksum(rsdp, 20)); ut_assertok(table_compute_checksum(rsdp, sizeof(*rsdp))); rsdt = PTR_ALIGN((void *)rsdp + sizeof(*rsdp), 16); ut_asserteq_ptr(rsdt, ctx.rsdt); - ut_assertok(memcmp("RSDT", rsdt->header.signature, ACPI_NAME_LEN)); + ut_asserteq_mem("RSDT", rsdt->header.signature, ACPI_NAME_LEN); ut_asserteq(sizeof(*rsdt), rsdt->header.length); ut_assertok(table_compute_checksum(rsdt, sizeof(*rsdt))); xsdt = PTR_ALIGN((void *)rsdt + sizeof(*rsdt), 16); ut_asserteq_ptr(xsdt, ctx.xsdt); - ut_assertok(memcmp("XSDT", xsdt->header.signature, ACPI_NAME_LEN)); + ut_asserteq_mem("XSDT", xsdt->header.signature, ACPI_NAME_LEN); ut_asserteq(sizeof(*xsdt), xsdt->header.length); ut_assertok(table_compute_checksum(xsdt, sizeof(*xsdt))); diff --git a/test/dm/axi.c b/test/dm/axi.c index e234ab82e6..e1155a51dd 100644 --- a/test/dm/axi.c +++ b/test/dm/axi.c @@ -7,6 +7,7 @@ #include <common.h> #include <axi.h> #include <dm.h> +#include <log.h> #include <dm/test.h> #include <test/ut.h> #include <asm/axi.h> @@ -65,11 +66,11 @@ static int dm_test_axi_store(struct unit_test_state *uts) /* Test writing */ val = 0x55667788; axi_write(store, 0, &val, AXI_SIZE_32); - ut_asserteq(0, memcmp(data, tdata1, ARRAY_SIZE(tdata1))); + ut_asserteq_mem(data, tdata1, ARRAY_SIZE(tdata1)); val = 0xaabbccdd; axi_write(store, 3, &val, AXI_SIZE_32); - ut_asserteq(0, memcmp(data + 3, tdata2, ARRAY_SIZE(tdata1))); + ut_asserteq_mem(data + 3, tdata2, ARRAY_SIZE(tdata1)); return 0; } diff --git a/test/dm/blk.c b/test/dm/blk.c index 9c71adc69d..94b2855b8e 100644 --- a/test/dm/blk.c +++ b/test/dm/blk.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <part.h> #include <usb.h> #include <asm/state.h> #include <dm/test.h> diff --git a/test/dm/board.c b/test/dm/board.c index 0f267a1926..5472c65fad 100644 --- a/test/dm/board.c +++ b/test/dm/board.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <dm/test.h> #include <board.h> #include <test/ut.h> diff --git a/test/dm/bootcount.c b/test/dm/bootcount.c index 0817b7d3ec..be0c278907 100644 --- a/test/dm/bootcount.c +++ b/test/dm/bootcount.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> #include <bootcount.h> +#include <log.h> #include <asm/test.h> #include <dm/test.h> #include <test/ut.h> diff --git a/test/dm/bus.c b/test/dm/bus.c index 1ad45adb60..73eb3aede3 100644 --- a/test/dm/bus.c +++ b/test/dm/bus.c @@ -5,6 +5,7 @@ #include <common.h> #ifdef CONFIG_SANDBOX +#include <log.h> #include <os.h> #endif #include <dm.h> diff --git a/test/dm/clk.c b/test/dm/clk.c index 003b78934f..48fc3dd714 100644 --- a/test/dm/clk.c +++ b/test/dm/clk.c @@ -6,6 +6,7 @@ #include <common.h> #include <clk.h> #include <dm.h> +#include <log.h> #include <malloc.h> #include <asm/clk.h> #include <dm/test.h> diff --git a/test/dm/core.c b/test/dm/core.c index f74c430843..6a930ae31a 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -9,6 +9,7 @@ #include <errno.h> #include <dm.h> #include <fdtdec.h> +#include <log.h> #include <malloc.h> #include <dm/device-internal.h> #include <dm/root.h> diff --git a/test/dm/cpu.c b/test/dm/cpu.c index def9b64a28..46683d884a 100644 --- a/test/dm/cpu.c +++ b/test/dm/cpu.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <dm/test.h> #include <dm/uclass-internal.h> #include <cpu.h> diff --git a/test/dm/devres.c b/test/dm/devres.c index cbd0972c9b..b5de0cb191 100644 --- a/test/dm/devres.c +++ b/test/dm/devres.c @@ -8,6 +8,7 @@ #include <common.h> #include <errno.h> #include <dm.h> +#include <log.h> #include <malloc.h> #include <dm/device-internal.h> #include <dm/devres.h> diff --git a/test/dm/dma.c b/test/dm/dma.c index 12cba57a56..317ed4fe8c 100644 --- a/test/dm/dma.c +++ b/test/dm/dma.c @@ -30,8 +30,8 @@ static int dm_test_dma_m2m(struct unit_test_state *uts) src_buf[i] = i; ut_assertok(dma_memcpy(dst_buf, src_buf, len)); + ut_asserteq_mem(src_buf, dst_buf, len); - ut_assertok(memcmp(src_buf, dst_buf, len)); return 0; } DM_TEST(dm_test_dma_m2m, DM_TESTF_SCAN_FDT); @@ -72,7 +72,7 @@ static int dm_test_dma(struct unit_test_state *uts) ut_assertok(dma_free(&dma_tx)); ut_assertok(dma_free(&dma_rx)); - ut_assertok(memcmp(src_buf, dst_buf, len)); + ut_asserteq_mem(src_buf, dst_buf, len); return 0; } @@ -117,7 +117,7 @@ static int dm_test_dma_rx(struct unit_test_state *uts) ut_assertok(dma_free(&dma_tx)); ut_assertok(dma_free(&dma_rx)); - ut_assertok(memcmp(src_buf, dst_buf, len)); + ut_asserteq_mem(src_buf, dst_buf, len); return 0; } diff --git a/test/dm/eth.c b/test/dm/eth.c index ad5354b4bf..1fddcaabb0 100644 --- a/test/dm/eth.c +++ b/test/dm/eth.c @@ -10,6 +10,7 @@ #include <dm.h> #include <env.h> #include <fdtdec.h> +#include <log.h> #include <malloc.h> #include <net.h> #include <dm/test.h> @@ -281,17 +282,17 @@ static int sb_check_arp_reply(struct udevice *dev, void *packet, ut_assert(arp_is_waiting()); /* Validate response */ - ut_assert(memcmp(eth->et_src, net_ethaddr, ARP_HLEN) == 0); - ut_assert(memcmp(eth->et_dest, priv->fake_host_hwaddr, ARP_HLEN) == 0); + ut_asserteq_mem(eth->et_src, net_ethaddr, ARP_HLEN); + ut_asserteq_mem(eth->et_dest, priv->fake_host_hwaddr, ARP_HLEN); ut_assert(eth->et_protlen == htons(PROT_ARP)); ut_assert(arp->ar_hrd == htons(ARP_ETHER)); ut_assert(arp->ar_pro == htons(PROT_IP)); ut_assert(arp->ar_hln == ARP_HLEN); ut_assert(arp->ar_pln == ARP_PLEN); - ut_assert(memcmp(&arp->ar_sha, net_ethaddr, ARP_HLEN) == 0); + ut_asserteq_mem(&arp->ar_sha, net_ethaddr, ARP_HLEN); ut_assert(net_read_ip(&arp->ar_spa).s_addr == net_ip.s_addr); - ut_assert(memcmp(&arp->ar_tha, priv->fake_host_hwaddr, ARP_HLEN) == 0); + ut_asserteq_mem(&arp->ar_tha, priv->fake_host_hwaddr, ARP_HLEN); ut_assert(net_read_ip(&arp->ar_tpa).s_addr == string_to_ip("1.1.2.4").s_addr); @@ -372,8 +373,8 @@ static int sb_check_ping_reply(struct udevice *dev, void *packet, ut_assert(arp_is_waiting()); /* Validate response */ - ut_assert(memcmp(eth->et_src, net_ethaddr, ARP_HLEN) == 0); - ut_assert(memcmp(eth->et_dest, priv->fake_host_hwaddr, ARP_HLEN) == 0); + ut_asserteq_mem(eth->et_src, net_ethaddr, ARP_HLEN); + ut_asserteq_mem(eth->et_dest, priv->fake_host_hwaddr, ARP_HLEN); ut_assert(eth->et_protlen == htons(PROT_IP)); ut_assert(net_read_ip(&ip->ip_src).s_addr == net_ip.s_addr); diff --git a/test/dm/gpio.c b/test/dm/gpio.c index 7c18e5c411..b5ee4e4f87 100644 --- a/test/dm/gpio.c +++ b/test/dm/gpio.c @@ -6,6 +6,7 @@ #include <common.h> #include <fdtdec.h> #include <dm.h> +#include <log.h> #include <malloc.h> #include <dm/root.h> #include <dm/test.h> diff --git a/test/dm/i2c.c b/test/dm/i2c.c index cadbb43b9e..2025c4216d 100644 --- a/test/dm/i2c.c +++ b/test/dm/i2c.c @@ -51,10 +51,10 @@ static int dm_test_i2c_read_write(struct unit_test_state *uts) ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus)); ut_assertok(i2c_get_chip(bus, chip, 1, &dev)); ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\0\0\0\0", sizeof(buf))); + ut_asserteq_mem(buf, "\0\0\0\0\0", sizeof(buf)); ut_assertok(dm_i2c_write(dev, 2, (uint8_t *)"AB", 2)); ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\0AB\0", sizeof(buf))); + ut_asserteq_mem(buf, "\0\0AB\0", sizeof(buf)); return 0; } @@ -123,7 +123,7 @@ static int dm_test_i2c_bytewise(struct unit_test_state *uts) ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus)); ut_assertok(i2c_get_chip(bus, chip, 1, &dev)); ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\0\0\0\0", sizeof(buf))); + ut_asserteq_mem(buf, "\0\0\0\0\0", sizeof(buf)); /* Tell the EEPROM to only read/write one register at a time */ ut_assertok(uclass_first_device(UCLASS_I2C_EMUL, &eeprom)); @@ -132,34 +132,34 @@ static int dm_test_i2c_bytewise(struct unit_test_state *uts) /* Now we only get the first byte - the rest will be 0xff */ ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\xff\xff\xff\xff", sizeof(buf))); + ut_asserteq_mem(buf, "\0\xff\xff\xff\xff", sizeof(buf)); /* If we do a separate transaction for each byte, it works */ ut_assertok(i2c_set_chip_flags(dev, DM_I2C_CHIP_RD_ADDRESS)); ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\0\0\0\0", sizeof(buf))); + ut_asserteq_mem(buf, "\0\0\0\0\0", sizeof(buf)); /* This will only write A */ ut_assertok(i2c_set_chip_flags(dev, 0)); ut_assertok(dm_i2c_write(dev, 2, (uint8_t *)"AB", 2)); ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\xff\xff\xff\xff", sizeof(buf))); + ut_asserteq_mem(buf, "\0\xff\xff\xff\xff", sizeof(buf)); /* Check that the B was ignored */ ut_assertok(i2c_set_chip_flags(dev, DM_I2C_CHIP_RD_ADDRESS)); ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\0A\0\0\0", sizeof(buf))); + ut_asserteq_mem(buf, "\0\0A\0\0\0", sizeof(buf)); /* Now write it again with the new flags, it should work */ ut_assertok(i2c_set_chip_flags(dev, DM_I2C_CHIP_WR_ADDRESS)); ut_assertok(dm_i2c_write(dev, 2, (uint8_t *)"AB", 2)); ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\xff\xff\xff\xff", sizeof(buf))); + ut_asserteq_mem(buf, "\0\xff\xff\xff\xff", sizeof(buf)); ut_assertok(i2c_set_chip_flags(dev, DM_I2C_CHIP_WR_ADDRESS | DM_I2C_CHIP_RD_ADDRESS)); ut_assertok(dm_i2c_read(dev, 0, buf, 5)); - ut_assertok(memcmp(buf, "\0\0AB\0\0", sizeof(buf))); + ut_asserteq_mem(buf, "\0\0AB\0\0", sizeof(buf)); /* Restore defaults */ sandbox_i2c_eeprom_set_test_mode(eeprom, SIE_TEST_MODE_NONE); diff --git a/test/dm/mdio.c b/test/dm/mdio.c index dc229aed6d..ba1b54f27e 100644 --- a/test/dm/mdio.c +++ b/test/dm/mdio.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <dm/test.h> #include <misc.h> #include <test/ut.h> diff --git a/test/dm/misc.c b/test/dm/misc.c index 4d4232adf1..26fd6acecb 100644 --- a/test/dm/misc.c +++ b/test/dm/misc.c @@ -25,24 +25,24 @@ static int dm_test_misc(struct unit_test_state *uts) ut_asserteq(5, misc_write(dev, 4, "WRITE", 5)); ut_asserteq(9, misc_read(dev, 0, buf, 9)); - ut_assertok(memcmp(buf, "TESTWRITE", 9)); + ut_asserteq_mem(buf, "TESTWRITE", 9); /* Call tests */ id = 0; ut_assertok(misc_call(dev, 0, &id, 4, buf, 16)); - ut_assertok(memcmp(buf, "Zero", 4)); + ut_asserteq_mem(buf, "Zero", 4); id = 2; ut_assertok(misc_call(dev, 0, &id, 4, buf, 16)); - ut_assertok(memcmp(buf, "Two", 3)); + ut_asserteq_mem(buf, "Two", 3); ut_assertok(misc_call(dev, 1, &id, 4, buf, 16)); - ut_assertok(memcmp(buf, "Forty-two", 9)); + ut_asserteq_mem(buf, "Forty-two", 9); id = 1; ut_assertok(misc_call(dev, 1, &id, 4, buf, 16)); - ut_assertok(memcmp(buf, "Forty-one", 9)); + ut_asserteq_mem(buf, "Forty-one", 9); /* IOCTL tests */ diff --git a/test/dm/mmc.c b/test/dm/mmc.c index 9ab0db1b66..49402b9c90 100644 --- a/test/dm/mmc.c +++ b/test/dm/mmc.c @@ -6,6 +6,7 @@ #include <common.h> #include <dm.h> #include <mmc.h> +#include <part.h> #include <dm/test.h> #include <test/ut.h> diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c index 07d5c7d7a6..1114f34cbf 100644 --- a/test/dm/ofnode.c +++ b/test/dm/ofnode.c @@ -2,6 +2,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <dm/of_extra.h> #include <dm/test.h> #include <test/ut.h> diff --git a/test/dm/osd.c b/test/dm/osd.c index 6910690b3a..5739dfa0b8 100644 --- a/test/dm/osd.c +++ b/test/dm/osd.c @@ -71,27 +71,29 @@ static int dm_test_osd_basics(struct unit_test_state *uts) ut_assertok(sandbox_osd_get_mem(dev, mem, memsize)); split(mem, memsize / 2, text, colors); - ut_assertok(memcmp(text, " " - " " - " " - " " - " " - " " - " " - " " - " " - " ", memsize / 2)); - - ut_assertok(memcmp(colors, "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk", memsize / 2)); + ut_asserteq_mem(text, + " " + " " + " " + " " + " " + " " + " " + " " + " " + " ", memsize / 2); + + ut_asserteq_mem(colors, + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk", memsize / 2); print_mem(mem, 10, 10); @@ -100,27 +102,29 @@ static int dm_test_osd_basics(struct unit_test_state *uts) ut_assertok(sandbox_osd_get_mem(dev, mem, memsize)); split(mem, memsize / 2, text, colors); - ut_assertok(memcmp(text, " " - " Blah " - " " - " " - " " - " " - " " - " " - " " - " ", memsize / 2)); - - ut_assertok(memcmp(colors, "kkkkkkkkkk" - "krrrrkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk" - "kkkkkkkkkk", memsize / 2)); + ut_asserteq_mem(text, + " " + " Blah " + " " + " " + " " + " " + " " + " " + " " + " ", memsize / 2); + + ut_asserteq_mem(colors, + "kkkkkkkkkk" + "krrrrkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk" + "kkkkkkkkkk", memsize / 2); print_mem(mem, 10, 10); @@ -152,17 +156,19 @@ static int dm_test_osd_extended(struct unit_test_state *uts) ut_assertok(sandbox_osd_get_mem(dev, mem, memsize)); split(mem, memsize / 2, text, colors); - ut_assertok(memcmp(text, " " - " " - " " - " " - " ", memsize / 2)); + ut_asserteq_mem(text, + " " + " " + " " + " " + " ", memsize / 2); - ut_assertok(memcmp(colors, "kkkkkkkkkkkkkkkkkkkk" - "kkkkkkkkkkkkkkkkkkkk" - "kkkkkkkkkkkkkkkkkkkk" - "kkkkkkkkkkkkkkkkkkkk" - "kkkkkkkkkkkkkkkkkkkk", memsize / 2)); + ut_asserteq_mem(colors, + "kkkkkkkkkkkkkkkkkkkk" + "kkkkkkkkkkkkkkkkkkkk" + "kkkkkkkkkkkkkkkkkkkk" + "kkkkkkkkkkkkkkkkkkkk" + "kkkkkkkkkkkkkkkkkkkk", memsize / 2); print_mem(mem, 20, 5); @@ -192,17 +198,19 @@ static int dm_test_osd_extended(struct unit_test_state *uts) print_mem(mem, 20, 5); - ut_assertok(memcmp(text, "+---- OSD menu ----+" - "| * Entry 1 |" - "| (*) Entry 2 |" - "| * Entry 3 |" - "+------------------+", memsize / 2)); - - ut_assertok(memcmp(colors, "gggggggggggggggggggg" - "gkbbbbbbbbbbbkkkkkkg" - "gkbbbbbbbbbbbkkkkkkg" - "gkbbbbbbbbbbbkkkkkkg" - "gggggggggggggggggggg", memsize / 2)); + ut_asserteq_mem(text, + "+---- OSD menu ----+" + "| * Entry 1 |" + "| (*) Entry 2 |" + "| * Entry 3 |" + "+------------------+", memsize / 2); + + ut_asserteq_mem(colors, + "gggggggggggggggggggg" + "gkbbbbbbbbbbbkkkkkkg" + "gkbbbbbbbbbbbkkkkkkg" + "gkbbbbbbbbbbbkkkkkkg" + "gggggggggggggggggggg", memsize / 2); return 0; } diff --git a/test/dm/phy.c b/test/dm/phy.c index 92455d94af..99f0119557 100644 --- a/test/dm/phy.c +++ b/test/dm/phy.c @@ -7,6 +7,7 @@ #include <common.h> #include <dm.h> #include <generic-phy.h> +#include <log.h> #include <dm/test.h> #include <test/ut.h> diff --git a/test/dm/regmap.c b/test/dm/regmap.c index b21f66732b..809494d585 100644 --- a/test/dm/regmap.c +++ b/test/dm/regmap.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <mapmem.h> #include <regmap.h> #include <syscon.h> diff --git a/test/dm/regulator.c b/test/dm/regulator.c index b967902493..ca916eeebb 100644 --- a/test/dm/regulator.c +++ b/test/dm/regulator.c @@ -10,6 +10,7 @@ #include <errno.h> #include <dm.h> #include <fdtdec.h> +#include <log.h> #include <malloc.h> #include <dm/device-internal.h> #include <dm/root.h> diff --git a/test/dm/remoteproc.c b/test/dm/remoteproc.c index 40675962d8..9511c7dd6f 100644 --- a/test/dm/remoteproc.c +++ b/test/dm/remoteproc.c @@ -223,7 +223,7 @@ static int dm_test_remoteproc_elf(struct unit_test_state *uts) /* Load firmware in loaded_firmware, and verify it */ ut_assertok(rproc_elf32_load_image(dev, (ulong)valid_elf32, size)); - ut_assertok(memcmp(loaded_firmware, valid_elf32, loaded_firmware_size)); + ut_asserteq_mem(loaded_firmware, valid_elf32, loaded_firmware_size); ut_asserteq(rproc_elf_get_boot_addr(dev, (unsigned long)valid_elf32), 0x08000000); unmap_physmem(loaded_firmware, MAP_NOCACHE); @@ -243,8 +243,8 @@ static int dm_test_remoteproc_elf(struct unit_test_state *uts) &rsc_addr, &rsc_size)); ut_asserteq(rsc_addr, CONFIG_SYS_SDRAM_BASE); ut_asserteq(rsc_size, rsc_table_size); - ut_assertok(memcmp(loaded_firmware, valid_elf32 + shdr->sh_offset, - shdr->sh_size)); + ut_asserteq_mem(loaded_firmware, valid_elf32 + shdr->sh_offset, + shdr->sh_size); unmap_physmem(loaded_firmware, MAP_NOCACHE); /* Invalid ELF Magic */ diff --git a/test/dm/reset.c b/test/dm/reset.c index 8370820428..871d6400a0 100644 --- a/test/dm/reset.c +++ b/test/dm/reset.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <malloc.h> #include <reset.h> #include <dm/test.h> diff --git a/test/dm/rng.c b/test/dm/rng.c index ce20e2d7c2..583ce9eddf 100644 --- a/test/dm/rng.c +++ b/test/dm/rng.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <rng.h> #include <dm/test.h> #include <test/ut.h> diff --git a/test/dm/rtc.c b/test/dm/rtc.c index 7188742764..88f86581cc 100644 --- a/test/dm/rtc.c +++ b/test/dm/rtc.c @@ -7,6 +7,7 @@ #include <common.h> #include <dm.h> #include <i2c.h> +#include <log.h> #include <rtc.h> #include <asm/io.h> #include <asm/test.h> diff --git a/test/dm/serial.c b/test/dm/serial.c index c6be6ab7ab..6237693cb8 100644 --- a/test/dm/serial.c +++ b/test/dm/serial.c @@ -4,6 +4,7 @@ */ #include <common.h> +#include <log.h> #include <serial.h> #include <dm.h> #include <dm/test.h> diff --git a/test/dm/sf.c b/test/dm/sf.c index 7805af740e..55b8d1545f 100644 --- a/test/dm/sf.c +++ b/test/dm/sf.c @@ -35,7 +35,7 @@ static int dm_test_spi_flash(struct unit_test_state *uts) dst = map_sysmem(0x20000 + full_size, full_size); ut_assertok(spi_flash_read_dm(dev, 0, size, dst)); - ut_assertok(memcmp(src, dst, size)); + ut_asserteq_mem(src, dst, size); /* Erase */ ut_assertok(spi_flash_erase_dm(dev, 0, size)); @@ -48,7 +48,7 @@ static int dm_test_spi_flash(struct unit_test_state *uts) src[i] = i; ut_assertok(spi_flash_write_dm(dev, 0, size, src)); ut_assertok(spi_flash_read_dm(dev, 0, size, dst)); - ut_assertok(memcmp(src, dst, size)); + ut_asserteq_mem(src, dst, size); /* Try the write-protect stuff */ ut_assertok(uclass_first_device_err(UCLASS_SPI_EMUL, &emul)); diff --git a/test/dm/syscon.c b/test/dm/syscon.c index f1021f374b..06a1c69ac5 100644 --- a/test/dm/syscon.c +++ b/test/dm/syscon.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <syscon.h> #include <regmap.h> #include <asm/test.h> diff --git a/test/dm/tee.c b/test/dm/tee.c index d40f13d291..632e9960b0 100644 --- a/test/dm/tee.c +++ b/test/dm/tee.c @@ -5,6 +5,7 @@ #include <common.h> #include <dm.h> +#include <log.h> #include <malloc.h> #include <dm/test.h> #include <sandboxtee.h> diff --git a/test/dm/test-driver.c b/test/dm/test-driver.c index abb5b7115a..ba85fa313e 100644 --- a/test/dm/test-driver.c +++ b/test/dm/test-driver.c @@ -9,6 +9,7 @@ #include <common.h> #include <dm.h> #include <errno.h> +#include <log.h> #include <malloc.h> #include <dm/test.h> #include <test/ut.h> diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index 1128c420a3..4fcae03dc5 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -7,6 +7,7 @@ #include <dm.h> #include <errno.h> #include <fdtdec.h> +#include <log.h> #include <malloc.h> #include <asm/io.h> #include <dm/test.h> diff --git a/test/dm/test-main.c b/test/dm/test-main.c index d7dc8d1f91..53e5ca321f 100644 --- a/test/dm/test-main.c +++ b/test/dm/test-main.c @@ -8,6 +8,7 @@ #include <console.h> #include <dm.h> #include <errno.h> +#include <log.h> #include <malloc.h> #include <asm/state.h> #include <dm/test.h> @@ -200,7 +201,7 @@ static int dm_test_main(const char *test_name) return uts->fail_count ? CMD_RET_FAILURE : 0; } -int do_ut_dm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { const char *test_name = NULL; diff --git a/test/dm/test-uclass.c b/test/dm/test-uclass.c index 25271c6ba0..b6d629a285 100644 --- a/test/dm/test-uclass.c +++ b/test/dm/test-uclass.c @@ -7,6 +7,7 @@ */ #include <common.h> +#include <log.h> #include <malloc.h> #include <dm.h> #include <errno.h> diff --git a/test/dm/usb.c b/test/dm/usb.c index e396c2a0ea..a25c2c1482 100644 --- a/test/dm/usb.c +++ b/test/dm/usb.c @@ -6,6 +6,7 @@ #include <common.h> #include <console.h> #include <dm.h> +#include <part.h> #include <usb.h> #include <asm/io.h> #include <asm/state.h> diff --git a/test/dm/video.c b/test/dm/video.c index f72979fac4..0664e3f22b 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -7,6 +7,7 @@ #include <common.h> #include <bzlib.h> #include <dm.h> +#include <log.h> #include <malloc.h> #include <mapmem.h> #include <os.h> |