blob: 8b69bc2ab11923c9c91f029b3e50954e6fc609d9 [file] [log] [blame]
Simon Glass2e7d35d2014-02-26 15:59:21 -07001/*
2 * Simple unit test library for driver model
3 *
4 * Copyright (c) 2013 Google, Inc
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9#include <common.h>
10#include <dm/test.h>
11#include <dm/ut.h>
12
13struct dm_test_state;
14
15void ut_fail(struct dm_test_state *dms, const char *fname, int line,
16 const char *func, const char *cond)
17{
18 printf("%s:%d, %s(): %s\n", fname, line, func, cond);
19 dms->fail_count++;
20}
21
22void ut_failf(struct dm_test_state *dms, const char *fname, int line,
23 const char *func, const char *cond, const char *fmt, ...)
24{
25 va_list args;
26
27 printf("%s:%d, %s(): %s: ", fname, line, func, cond);
28 va_start(args, fmt);
29 vprintf(fmt, args);
30 va_end(args);
31 putc('\n');
32 dms->fail_count++;
33}