]> git.ipfire.org Git - thirdparty/u-boot.git/blame - test/ut.c
dm: sound: samsung: Make local function static
[thirdparty/u-boot.git] / test / ut.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
2e7d35d2 2/*
e721b882 3 * Simple unit test library
2e7d35d2
SG
4 *
5 * Copyright (c) 2013 Google, Inc
2e7d35d2
SG
6 */
7
8#include <common.h>
e721b882
JH
9#include <test/test.h>
10#include <test/ut.h>
2e7d35d2 11
9ce8b402
SG
12DECLARE_GLOBAL_DATA_PTR;
13
e721b882 14void ut_fail(struct unit_test_state *uts, const char *fname, int line,
2e7d35d2
SG
15 const char *func, const char *cond)
16{
9ce8b402 17 gd->flags &= ~(GD_FLG_SILENT | GD_FLG_RECORD);
2e7d35d2 18 printf("%s:%d, %s(): %s\n", fname, line, func, cond);
e721b882 19 uts->fail_count++;
2e7d35d2
SG
20}
21
e721b882 22void ut_failf(struct unit_test_state *uts, const char *fname, int line,
2e7d35d2
SG
23 const char *func, const char *cond, const char *fmt, ...)
24{
25 va_list args;
26
9ce8b402 27 gd->flags &= ~(GD_FLG_SILENT | GD_FLG_RECORD);
2e7d35d2
SG
28 printf("%s:%d, %s(): %s: ", fname, line, func, cond);
29 va_start(args, fmt);
30 vprintf(fmt, args);
31 va_end(args);
32 putc('\n');
e721b882 33 uts->fail_count++;
2e7d35d2 34}