LMMP 4.3.0
Lamina High-Precision Arithmetic Library
载入中...
搜索中...
未找到
test.c 文件参考
#include "test.h"
test.c 的引用(Include)关系图:

浏览该文件的源代码.

函数

void lmmp_test_check (bool ok, const char *file, int line, const char *expr, const char *message)
int lmmp_test_finish (void)
void lmmp_test_run (const char *name, void(*test)(void))

变量

static unsigned checks
static unsigned failed_tests
static unsigned failures
static unsigned tests
 Copyright (C) 2026 HJimmyK (Jericho Knox)

函数说明

◆ lmmp_test_check()

void lmmp_test_check ( bool ok,
const char * file,
int line,
const char * expr,
const char * message )

在文件 test.c 第 30 行定义.

30 {
31 ++checks;
32 if (ok)
33 return;
34 ++failures;
35 fprintf(stderr, "%s:%d: %s", file, line, expr);
36 if (message)
37 fprintf(stderr, " (%s)", message);
38 fputc('\n', stderr);
39}
static unsigned checks
定义 test.c:27
static unsigned failures
定义 test.c:28

引用了 checks, failures , 以及 lmmp_test_check().

被这些函数引用 lmmp_test_check().

函数调用图:
这是这个函数的调用关系图:

◆ lmmp_test_finish()

int lmmp_test_finish ( void )

在文件 test.c 第 51 行定义.

51 {
52 printf("TOTAL: %u tests, %u failed, %u checks\n", tests, failed_tests, checks);
53 return failed_tests != 0;
54}
static unsigned failed_tests
定义 test.c:26
static unsigned tests
Copyright (C) 2026 HJimmyK (Jericho Knox)
定义 test.c:25

引用了 checks, failed_tests, lmmp_test_finish() , 以及 tests.

被这些函数引用 lmmp_test_finish() , 以及 main().

函数调用图:
这是这个函数的调用关系图:

◆ lmmp_test_run()

void lmmp_test_run ( const char * name,
void(* test )(void) )

在文件 test.c 第 41 行定义.

41 {
42 unsigned before = failures;
43 ++tests;
44 printf("[ RUN ] %s\n", name);
45 test();
46 if (failures != before)
48 printf("[ %s ] %s\n", failures == before ? "PASSED" : "FAILED", name);
49}

引用了 failed_tests, failures, lmmp_test_run() , 以及 tests.

被这些函数引用 lmmp_test_run().

函数调用图:
这是这个函数的调用关系图:

变量说明

◆ checks

unsigned checks
static

在文件 test.c 第 27 行定义.

被这些函数引用 lmmp_test_check() , 以及 lmmp_test_finish().

◆ failed_tests

unsigned failed_tests
static

在文件 test.c 第 26 行定义.

被这些函数引用 lmmp_test_finish() , 以及 lmmp_test_run().

◆ failures

unsigned failures
static

在文件 test.c 第 28 行定义.

被这些函数引用 lmmp_test_check() , 以及 lmmp_test_run().

◆ tests

unsigned tests
static

Copyright (C) 2026 HJimmyK (Jericho Knox)

This file is part of LMMP.

LMMP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see https://www.gnu.org/licenses/.

SPDX-License-Identifier: LGPL-3.0-or-later

在文件 test.c 第 25 行定义.

被这些函数引用 lmmp_test_finish() , 以及 lmmp_test_run().