Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Tests for memory commands |
| 4 | * |
| 5 | * Copyright 2020 Google LLC |
| 6 | * Written by Simon Glass <sjg@chromium.org> |
| 7 | */ |
| 8 | |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 9 | #include <console.h> |
| 10 | #include <mapmem.h> |
| 11 | #include <dm/test.h> |
| 12 | #include <test/ut.h> |
| 13 | |
| 14 | #define BUF_SIZE 0x100 |
| 15 | |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 16 | /* Declare a new mem test */ |
| 17 | #define MEM_TEST(_name, _flags) UNIT_TEST(_name, _flags, mem_test) |
| 18 | |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 19 | /* Test 'ms' command with bytes */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 20 | static int mem_test_ms_b(struct unit_test_state *uts) |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 21 | { |
| 22 | u8 *buf; |
| 23 | |
| 24 | buf = map_sysmem(0, BUF_SIZE + 1); |
| 25 | memset(buf, '\0', BUF_SIZE); |
| 26 | buf[0x0] = 0x12; |
| 27 | buf[0x31] = 0x12; |
| 28 | buf[0xff] = 0x12; |
| 29 | buf[0x100] = 0x12; |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 30 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 31 | run_command("ms.b 1 ff 12", 0); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 32 | ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................"); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 33 | ut_assert_nextline("--"); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 34 | ut_assert_nextline("000000f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 ................"); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 35 | ut_assert_nextline("2 matches"); |
| 36 | ut_assert_console_end(); |
| 37 | |
| 38 | ut_asserteq(2, env_get_hex("memmatches", 0)); |
| 39 | ut_asserteq(0xff, env_get_hex("memaddr", 0)); |
| 40 | ut_asserteq(0xfe, env_get_hex("mempos", 0)); |
| 41 | |
| 42 | unmap_sysmem(buf); |
| 43 | |
| 44 | return 0; |
| 45 | } |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 46 | MEM_TEST(mem_test_ms_b, UT_TESTF_CONSOLE_REC); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 47 | |
| 48 | /* Test 'ms' command with 16-bit values */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 49 | static int mem_test_ms_w(struct unit_test_state *uts) |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 50 | { |
| 51 | u16 *buf; |
| 52 | |
| 53 | buf = map_sysmem(0, BUF_SIZE + 2); |
| 54 | memset(buf, '\0', BUF_SIZE); |
| 55 | buf[0x34 / 2] = 0x1234; |
| 56 | buf[BUF_SIZE / 2] = 0x1234; |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 57 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 58 | run_command("ms.w 0 80 1234", 0); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 59 | ut_assert_nextline("00000030: 0000 0000 1234 0000 0000 0000 0000 0000 ....4..........."); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 60 | ut_assert_nextline("1 match"); |
| 61 | ut_assert_console_end(); |
| 62 | |
| 63 | ut_asserteq(1, env_get_hex("memmatches", 0)); |
| 64 | ut_asserteq(0x34, env_get_hex("memaddr", 0)); |
| 65 | ut_asserteq(0x34 / 2, env_get_hex("mempos", 0)); |
| 66 | |
| 67 | unmap_sysmem(buf); |
| 68 | |
| 69 | return 0; |
| 70 | } |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 71 | MEM_TEST(mem_test_ms_w, UT_TESTF_CONSOLE_REC); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 72 | |
| 73 | /* Test 'ms' command with 32-bit values */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 74 | static int mem_test_ms_l(struct unit_test_state *uts) |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 75 | { |
| 76 | u32 *buf; |
| 77 | |
| 78 | buf = map_sysmem(0, BUF_SIZE + 4); |
| 79 | memset(buf, '\0', BUF_SIZE); |
| 80 | buf[0x38 / 4] = 0x12345678; |
| 81 | buf[BUF_SIZE / 4] = 0x12345678; |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 82 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 83 | run_command("ms 0 40 12345678", 0); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 84 | ut_assert_nextline("00000030: 00000000 00000000 12345678 00000000 ........xV4....."); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 85 | ut_assert_nextline("1 match"); |
| 86 | ut_assert_console_end(); |
| 87 | |
| 88 | ut_asserteq(1, env_get_hex("memmatches", 0)); |
| 89 | ut_asserteq(0x38, env_get_hex("memaddr", 0)); |
| 90 | ut_asserteq(0x38 / 4, env_get_hex("mempos", 0)); |
| 91 | |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 92 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 93 | run_command("ms 0 80 12345679", 0); |
| 94 | ut_assert_nextline("0 matches"); |
| 95 | ut_assert_console_end(); |
| 96 | |
| 97 | ut_asserteq(0, env_get_hex("memmatches", 0)); |
| 98 | ut_asserteq(0, env_get_hex("memaddr", 0)); |
| 99 | ut_asserteq(0 / 4, env_get_hex("mempos", 0)); |
| 100 | |
| 101 | unmap_sysmem(buf); |
| 102 | |
| 103 | return 0; |
| 104 | } |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 105 | MEM_TEST(mem_test_ms_l, UT_TESTF_CONSOLE_REC); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 106 | |
| 107 | /* Test 'ms' command with continuation */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 108 | static int mem_test_ms_cont(struct unit_test_state *uts) |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 109 | { |
| 110 | char *const args[] = {"ms.b", "0", "100", "34"}; |
| 111 | int repeatable; |
| 112 | u8 *buf; |
| 113 | int i; |
| 114 | |
| 115 | buf = map_sysmem(0, BUF_SIZE); |
| 116 | memset(buf, '\0', BUF_SIZE); |
| 117 | for (i = 5; i < 0x33; i += 3) |
| 118 | buf[i] = 0x34; |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 119 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 120 | run_command("ms.b 0 100 34", 0); |
| 121 | ut_assert_nextlinen("00000000: 00 00 00 00 00 34 00 00 34 00 00 34 00 00 34 00"); |
| 122 | ut_assert_nextline("--"); |
| 123 | ut_assert_nextlinen("00000010: 00 34 00 00 34 00 00 34 00 00 34 00 00 34 00 00"); |
| 124 | ut_assert_nextline("--"); |
| 125 | ut_assert_nextlinen("00000020: 34 00 00 34 00 00 34 00 00 34 00 00 34 00 00 34"); |
| 126 | ut_assert_nextlinen("10 matches (repeat command to check for more)"); |
| 127 | ut_assert_console_end(); |
| 128 | |
| 129 | ut_asserteq(10, env_get_hex("memmatches", 0)); |
| 130 | ut_asserteq(0x20, env_get_hex("memaddr", 0)); |
| 131 | ut_asserteq(0x20, env_get_hex("mempos", 0)); |
| 132 | |
| 133 | /* |
| 134 | * run_command() ignoes the repeatable flag when using hush, so call |
| 135 | * cmd_process() directly |
| 136 | */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 137 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 138 | cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL); |
| 139 | ut_assert_nextlinen("00000020: 34 00 00 34 00 00 34 00 00 34 00 00 34 00 00 34"); |
| 140 | ut_assert_nextline("--"); |
| 141 | ut_assert_nextlinen("00000030: 00 00 34 00 00 00 00 00"); |
| 142 | ut_assert_nextlinen("6 matches"); |
| 143 | ut_assert_console_end(); |
| 144 | |
| 145 | ut_asserteq(6, env_get_hex("memmatches", 0)); |
| 146 | ut_asserteq(0x32, env_get_hex("memaddr", 0)); |
| 147 | |
| 148 | /* 0x32 less 0x21, where the second search started */ |
| 149 | ut_asserteq(0x11, env_get_hex("mempos", 0)); |
| 150 | |
| 151 | unmap_sysmem(buf); |
| 152 | |
| 153 | return 0; |
| 154 | } |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 155 | MEM_TEST(mem_test_ms_cont, UT_TESTF_CONSOLE_REC); |
| 156 | |
| 157 | /* Test that an 'ms' command with continuation stops at the end of the range */ |
| 158 | static int mem_test_ms_cont_end(struct unit_test_state *uts) |
| 159 | { |
| 160 | char *const args[] = {"ms.b", "1", "ff", "12"}; |
| 161 | int repeatable; |
| 162 | u8 *buf; |
| 163 | |
| 164 | buf = map_sysmem(0, BUF_SIZE); |
| 165 | memset(buf, '\0', BUF_SIZE); |
| 166 | buf[0x0] = 0x12; |
| 167 | buf[0x31] = 0x12; |
| 168 | buf[0xff] = 0x12; |
| 169 | buf[0x100] = 0x12; |
| 170 | ut_assertok(console_record_reset_enable()); |
| 171 | run_command("ms.b 1 ff 12", 0); |
| 172 | ut_assert_nextlinen("00000030"); |
| 173 | ut_assert_nextlinen("--"); |
| 174 | ut_assert_nextlinen("000000f0"); |
| 175 | ut_assert_nextlinen("2 matches"); |
| 176 | ut_assert_console_end(); |
| 177 | |
| 178 | /* |
| 179 | * run_command() ignoes the repeatable flag when using hush, so call |
| 180 | * cmd_process() directly. |
| 181 | * |
| 182 | * This should produce no matches. |
| 183 | */ |
| 184 | ut_assertok(console_record_reset_enable()); |
| 185 | cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL); |
| 186 | ut_assert_nextlinen("0 matches"); |
| 187 | ut_assert_console_end(); |
| 188 | |
| 189 | /* One more time */ |
| 190 | ut_assertok(console_record_reset_enable()); |
| 191 | cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL); |
| 192 | ut_assert_nextlinen("0 matches"); |
| 193 | ut_assert_console_end(); |
| 194 | |
| 195 | unmap_sysmem(buf); |
| 196 | |
| 197 | return 0; |
| 198 | } |
| 199 | MEM_TEST(mem_test_ms_cont_end, UT_TESTF_CONSOLE_REC); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 200 | |
| 201 | /* Test 'ms' command with multiple values */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 202 | static int mem_test_ms_mult(struct unit_test_state *uts) |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 203 | { |
| 204 | static const char str[] = "hello"; |
| 205 | char *buf; |
| 206 | |
| 207 | buf = map_sysmem(0, BUF_SIZE + 5); |
| 208 | memset(buf, '\0', BUF_SIZE); |
| 209 | strcpy(buf + 0x1e, str); |
| 210 | strcpy(buf + 0x63, str); |
| 211 | strcpy(buf + BUF_SIZE - strlen(str) + 1, str); |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 212 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 213 | run_command("ms.b 0 100 68 65 6c 6c 6f", 0); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 214 | ut_assert_nextline("00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 65 ..............he"); |
| 215 | ut_assert_nextline("00000020: 6c 6c 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 llo............."); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 216 | ut_assert_nextline("--"); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 217 | ut_assert_nextline("00000060: 00 00 00 68 65 6c 6c 6f 00 00 00 00 00 00 00 00 ...hello........"); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 218 | ut_assert_nextline("2 matches"); |
| 219 | ut_assert_console_end(); |
| 220 | unmap_sysmem(buf); |
| 221 | |
| 222 | ut_asserteq(2, env_get_hex("memmatches", 0)); |
| 223 | ut_asserteq(0x63, env_get_hex("memaddr", 0)); |
| 224 | ut_asserteq(0x63, env_get_hex("mempos", 0)); |
| 225 | |
| 226 | return 0; |
| 227 | } |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 228 | MEM_TEST(mem_test_ms_mult, UT_TESTF_CONSOLE_REC); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 229 | |
| 230 | /* Test 'ms' command with string */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 231 | static int mem_test_ms_s(struct unit_test_state *uts) |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 232 | { |
| 233 | static const char str[] = "hello"; |
| 234 | static const char str2[] = "hellothere"; |
| 235 | char *buf; |
| 236 | |
| 237 | buf = map_sysmem(0, BUF_SIZE); |
| 238 | memset(buf, '\0', BUF_SIZE); |
| 239 | strcpy(buf + 0x1e, str); |
| 240 | strcpy(buf + 0x63, str); |
| 241 | strcpy(buf + 0xa1, str2); |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 242 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 243 | run_command("ms.s 0 100 hello", 0); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 244 | ut_assert_nextline("00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 65 ..............he"); |
| 245 | ut_assert_nextline("00000020: 6c 6c 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 llo............."); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 246 | ut_assert_nextline("--"); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 247 | ut_assert_nextline("00000060: 00 00 00 68 65 6c 6c 6f 00 00 00 00 00 00 00 00 ...hello........"); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 248 | ut_assert_nextline("--"); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 249 | ut_assert_nextline("000000a0: 00 68 65 6c 6c 6f 74 68 65 72 65 00 00 00 00 00 .hellothere....."); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 250 | ut_assert_nextline("3 matches"); |
| 251 | ut_assert_console_end(); |
| 252 | |
| 253 | ut_asserteq(3, env_get_hex("memmatches", 0)); |
| 254 | ut_asserteq(0xa1, env_get_hex("memaddr", 0)); |
| 255 | ut_asserteq(0xa1, env_get_hex("mempos", 0)); |
| 256 | |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 257 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 258 | run_command("ms.s 0 100 hello there", 0); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 259 | ut_assert_nextline("000000a0: 00 68 65 6c 6c 6f 74 68 65 72 65 00 00 00 00 00 .hellothere....."); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 260 | ut_assert_nextline("1 match"); |
| 261 | ut_assert_console_end(); |
| 262 | |
| 263 | ut_asserteq(1, env_get_hex("memmatches", 0)); |
| 264 | ut_asserteq(0xa1, env_get_hex("memaddr", 0)); |
| 265 | ut_asserteq(0xa1, env_get_hex("mempos", 0)); |
| 266 | |
| 267 | unmap_sysmem(buf); |
| 268 | |
| 269 | return 0; |
| 270 | } |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 271 | MEM_TEST(mem_test_ms_s, UT_TESTF_CONSOLE_REC); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 272 | |
| 273 | /* Test 'ms' command with limit */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 274 | static int mem_test_ms_limit(struct unit_test_state *uts) |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 275 | { |
| 276 | u8 *buf; |
| 277 | |
| 278 | buf = map_sysmem(0, BUF_SIZE + 1); |
| 279 | memset(buf, '\0', BUF_SIZE); |
| 280 | buf[0x0] = 0x12; |
| 281 | buf[0x31] = 0x12; |
| 282 | buf[0x62] = 0x12; |
| 283 | buf[0x76] = 0x12; |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 284 | ut_assertok(console_record_reset_enable()); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 285 | run_command("ms.b -l2 1 ff 12", 0); |
Simon Glass | 85c8fc5 | 2021-05-08 07:00:00 -0600 | [diff] [blame] | 286 | ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................"); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 287 | ut_assert_nextline("--"); |
| 288 | ut_assert_nextlinen("00000060: 00 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00"); |
| 289 | ut_assert_nextline("2 matches (repeat command to check for more)"); |
| 290 | ut_assert_console_end(); |
| 291 | |
| 292 | ut_asserteq(2, env_get_hex("memmatches", 0)); |
| 293 | ut_asserteq(0x62, env_get_hex("memaddr", 0)); |
| 294 | ut_asserteq(0x61, env_get_hex("mempos", 0)); |
| 295 | |
| 296 | unmap_sysmem(buf); |
| 297 | |
| 298 | return 0; |
| 299 | } |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 300 | MEM_TEST(mem_test_ms_limit, UT_TESTF_CONSOLE_REC); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 301 | |
| 302 | /* Test 'ms' command in quiet mode */ |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 303 | static int mem_test_ms_quiet(struct unit_test_state *uts) |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 304 | { |
| 305 | u8 *buf; |
| 306 | |
| 307 | buf = map_sysmem(0, BUF_SIZE + 1); |
| 308 | memset(buf, '\0', BUF_SIZE); |
| 309 | buf[0x0] = 0x12; |
| 310 | buf[0x31] = 0x12; |
| 311 | buf[0x62] = 0x12; |
| 312 | buf[0x76] = 0x12; |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 313 | ut_assertok(console_record_reset_enable()); |
| 314 | run_command("ms.b -q -l2 1 ff 12", 0); |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 315 | ut_assert_console_end(); |
| 316 | unmap_sysmem(buf); |
| 317 | |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 318 | ut_asserteq(2, env_get_hex("memmatches", 0)); |
| 319 | ut_asserteq(0x62, env_get_hex("memaddr", 0)); |
| 320 | ut_asserteq(0x61, env_get_hex("mempos", 0)); |
| 321 | |
Simon Glass | 19038de | 2020-06-02 19:26:49 -0600 | [diff] [blame] | 322 | return 0; |
| 323 | } |
Simon Glass | 573c0fa | 2020-07-28 19:41:14 -0600 | [diff] [blame] | 324 | MEM_TEST(mem_test_ms_quiet, UT_TESTF_CONSOLE_REC); |