summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/locate_chip/src/locate_chip.c
blob: 881b17a54c6372aa85fdd274d579fb08f4ed6c59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Copyright 2022 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "host_command.h"
#include "test/drivers/test_state.h"

#include <zephyr/ztest.h>

ZTEST_SUITE(locate_chip, drivers_predicate_post_main, NULL, NULL, NULL, NULL);

ZTEST_USER(locate_chip, test_invalid_request_for_eeprom)
{
	int ret;
	struct ec_params_locate_chip p = {
		.type = EC_CHIP_TYPE_CBI_EEPROM,
	};
	struct ec_response_locate_chip r;
	struct host_cmd_handler_args args =
		BUILD_HOST_COMMAND(EC_CMD_LOCATE_CHIP, 0, r, p);

	ret = host_command_process(&args);

	zassert_equal(ret, EC_RES_UNAVAILABLE, "Unexpected return value: %d",
		      ret);
}