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