ut_assert_console_end();
/* Make sure mmc6 is 12+ MiB in size */
- ut_assertok(run_commandf("mmc read 0x%lx 0x%lx 1", ra,
+ ut_assertok(run_commandf("mmc read %lx %lx 1", ra,
(ulong)0xbffe00 / 0x200));
/* Test one MBR partition */
init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__);
ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 1));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa));
+ ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
ut_assertok(memcmp(mbr_wbuf, rbuf, 512));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk));
+ ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf);
ut_assertok(run_commandf("mbr write mmc 6"));
ut_assertok(run_commandf("mbr verify mmc 6"));
ut_assert_nextline("MBR: verify success!");
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assert_console_end();
/*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
*/
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
for (unsigned i = 0; i < mbr_cmp_size; i++) {
ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p1[i],
- "1P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n",
+ "1P MBR+0x%04X: expected %#02X, actual: %#02X\n",
mbr_cmp_start + i, mbr_parts_ref_p1[i], rbuf[mbr_cmp_start + i]);
}
/* Test two MBR partitions */
init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__);
ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 2));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa));
+ ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
ut_assertok(memcmp(mbr_wbuf, rbuf, 512));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk));
+ ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf);
ut_assertok(run_commandf("mbr write mmc 6"));
ut_assertok(run_commandf("mbr verify mmc 6"));
ut_assert_nextline("MBR: verify success!");
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assert_console_end();
/*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
*/
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
for (unsigned i = 0; i < mbr_cmp_size; i++) {
ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p2[i],
- "2P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n",
+ "2P MBR+0x%04X: expected %#02X, actual: %#02X\n",
mbr_cmp_start + i, mbr_parts_ref_p2[i], rbuf[mbr_cmp_start + i]);
}
/* Test three MBR partitions */
init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__);
ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 3));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa));
+ ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
ut_assertok(memcmp(mbr_wbuf, rbuf, 512));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk));
+ ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf);
ut_assertok(run_commandf("mbr write mmc 6"));
ut_assertok(run_commandf("mbr verify mmc 6"));
ut_assert_nextline("MBR: verify success!");
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assert_console_end();
/*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
*/
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
for (unsigned i = 0; i < mbr_cmp_size; i++) {
ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p3[i],
- "3P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n",
+ "3P MBR+0x%04X: expected %#02X, actual: %#02X\n",
mbr_cmp_start + i, mbr_parts_ref_p3[i], rbuf[mbr_cmp_start + i]);
}
/* Test four MBR partitions */
init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__);
ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 4));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa));
+ ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
ut_assertok(memcmp(mbr_wbuf, rbuf, 512));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk));
+ ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf);
ut_assertok(run_commandf("mbr write mmc 6"));
ut_assertok(run_commandf("mbr verify mmc 6"));
ut_assert_nextline("MBR: verify success!");
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assert_console_end();
/*
000001f0 26 01 0e 87 06 01 00 58 00 00 00 08 00 00 55 aa |&......X......U.|
*/
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
for (unsigned i = 0; i < mbr_cmp_size; i++) {
ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p4[i],
- "4P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n",
+ "4P MBR+0x%04X: expected %#02X, actual: %#02X\n",
mbr_cmp_start + i, mbr_parts_ref_p4[i], rbuf[mbr_cmp_start + i]);
}
/* Test five MBR partitions */
init_write_buffers(mbr_wbuf, sizeof(mbr_wbuf), ebr_wbuf, sizeof(ebr_wbuf), __LINE__);
ut_assertok(build_mbr_parts(mbr_parts_buf, sizeof(mbr_parts_buf), 5));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0 1", mbr_wa));
+ ut_assertok(run_commandf("write mmc 6:0 %lx 0 1", mbr_wa));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
ut_assertok(memcmp(mbr_wbuf, rbuf, 512));
- ut_assertok(run_commandf("write mmc 6:0 0x%lx 0x%lx 1", ebr_wa, ebr_blk));
+ ut_assertok(run_commandf("write mmc 6:0 %lx %lx 1", ebr_wa, ebr_blk));
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
ut_assertok(memcmp(ebr_wbuf, rbuf, 512));
ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf);
ut_assertf(0 == run_commandf("mbr write mmc 6"), "Invalid partitions string: %s\n", mbr_parts_buf);
000001f0 26 01 05 a7 26 01 00 58 00 00 00 10 00 00 55 aa |&...&..X......U.|
*/
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0 1", ra));
+ ut_assertok(run_commandf("read mmc 6:0 %lx 0 1", ra));
for (unsigned i = 0; i < mbr_cmp_size; i++) {
ut_assertf(rbuf[mbr_cmp_start + i] == mbr_parts_ref_p5[i],
- "5P MBR+0x%04X: expected 0x%02X, actual: 0x%02X\n",
+ "5P MBR+0x%04X: expected %#02X, actual: %#02X\n",
mbr_cmp_start + i, mbr_parts_ref_p5[i], rbuf[mbr_cmp_start + i]);
}
/*
00b001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
*/
memset(rbuf, 0, sizeof(rbuf));
- ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk));
+ ut_assertok(run_commandf("read mmc 6:0 %lx %lx 1", ra, ebr_blk));
for (unsigned i = 0; i < ebr_cmp_size; i++) {
ut_assertf(rbuf[ebr_cmp_start + i] == ebr_parts_ref_p5[i],
- "5P EBR+0x%04X: expected 0x%02X, actual: 0x%02X\n",
+ "5P EBR+0x%04X: expected %#02X, actual: %#02X\n",
ebr_cmp_start + i, ebr_parts_ref_p5[i], rbuf[ebr_cmp_start + i]);
}