From 62f2a33ff2ff37ad8226fd854712206f3ccd745e Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Wed, 19 Jun 2013 00:29:08 +0800 Subject: Add flash host read command test This checks the correctness of data returned by flash read host command. BUG=chrome-os-partner:19236 TEST=Pass all tests. BRANCH=None Change-Id: I3b97addb9b14922e9f33a71b865000ae9a8d40a8 Signed-off-by: Vic Yang Reviewed-on: https://gerrit.chromium.org/gerrit/60963 Reviewed-by: Randall Spangler --- common/test_util.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'common/test_util.c') diff --git a/common/test_util.c b/common/test_util.c index c133ac9d24..10e718399f 100644 --- a/common/test_util.c +++ b/common/test_util.c @@ -70,6 +70,7 @@ int test_send_host_command(int command, int version, const void *params, int params_size, void *resp, int resp_size) { struct host_cmd_handler_args args; + int rv; args.version = version; args.command = command; @@ -79,7 +80,12 @@ int test_send_host_command(int command, int version, const void *params, args.response_max = resp_size; args.response_size = 0; - return host_command_process(&args); + rv = host_command_process(&args); + + if (args.response != resp) + memcpy(resp, args.response, args.response_size); + + return rv; } #endif /* TASK_HAS_HOSTCMD */ -- cgit v1.2.1