summaryrefslogtreecommitdiff
path: root/zephyr/test/drivers/default/src/console_cmd/i2c_portmap.c
blob: 4b2ec548a2e3dcb09d918153b3d214bfe433e6d3 (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 <zephyr/shell/shell.h>
#include <zephyr/ztest.h>

#include "console.h"
#include "ec_commands.h"
#include "test/drivers/test_state.h"

ZTEST_SUITE(console_cmd_i2c_portmap, drivers_predicate_post_main, NULL, NULL,
	    NULL, NULL);

ZTEST_USER(console_cmd_i2c_portmap, test_too_many_args)
{
	int rv = shell_execute_cmd(get_ec_shell(), "i2c_portmap arg1");

	zassert_equal(rv, EC_ERROR_PARAM_COUNT, "Expected %d, but got %d",
		      EC_ERROR_PARAM_COUNT, rv);
}

ZTEST_USER(console_cmd_i2c_portmap, test_get_i2c_portmap)
{
	zassert_ok(shell_execute_cmd(get_ec_shell(), "i2c_portmap"), NULL);
}