summaryrefslogtreecommitdiff
path: root/test/is_enabled.c
blob: fe93bafc31d22871cc963d3a653810951d79d942 (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
35
/* Copyright 2019 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.
 *
 * Test the IS_ENABLED macro.
 */
#include "common.h"
#include "test_util.h"

#undef	CONFIG_UNDEFINED
#define	CONFIG_BLANK

static int test_undef(void)
{
	TEST_ASSERT(IS_ENABLED(CONFIG_UNDEFINED) == 0);

	return EC_SUCCESS;
}

static int test_blank(void)
{
	TEST_ASSERT(IS_ENABLED(CONFIG_BLANK) == 1);

	return EC_SUCCESS;
}

void run_test(int argc, char **argv)
{
	test_reset();

	RUN_TEST(test_undef);
	RUN_TEST(test_blank);

	test_print_result();
}