summaryrefslogtreecommitdiff
path: root/zephyr/test/i2c/src/main.c
blob: 064ce788165a56b53b318d155053e677334e8d8a (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
28
29
30
31
32
33
34
/* Copyright 2020 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include <devicetree.h>
#include <ztest.h>

#include "common.h"
#include "i2c/i2c.h"

/* Unused: required for shimming i2c. */
void watchdog_reload(void)
{
}

static void test_i2c_port_count(void)
{
	zassert_equal(NAMED_I2C(accel_0), 0,
		      "accel_0 expected to be 0 but was %d",
		      NAMED_I2C(accel_0));
	zassert_equal(I2C_PORT_COUNT, 1,
		      "I2C_PORT_COUNT expected to be 1 but was %d",
		      I2C_PORT_COUNT);
}

/* Test case main entry. */
void test_main(void)
{
	ztest_test_suite(test_i2c,
			 ztest_user_unit_test(test_i2c_port_count));
	ztest_run_test_suite(test_i2c);
}