102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
dttr_test_support.h File Reference
#include <setjmp.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <cmocka.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  DTTR_TestCase

Macros

#define DTTR_TEST_ARRAY_COUNT(TESTS)
#define DTTR_TEST_MAIN(TESTS)

Functions

static int dttr_test_run_case (const DTTR_TestCase *test_case)
static void dttr_test_require_available (bool available)
static const DTTR_TestCasedttr_test_find_case (const DTTR_TestCase *test_cases, size_t test_case_count, const char *name)
static int dttr_test_run_cases (const DTTR_TestCase *test_cases, size_t test_case_count, int argc, char **argv)

Macro Definition Documentation

◆ DTTR_TEST_ARRAY_COUNT

#define DTTR_TEST_ARRAY_COUNT ( TESTS)
Value:
(sizeof(TESTS) / sizeof(*(TESTS)))

Definition at line 20 of file dttr_test_support.h.

Referenced by chain_log(), and test_patch_group_target_failure_rolls_back_only_new_entries().

◆ DTTR_TEST_MAIN

#define DTTR_TEST_MAIN ( TESTS)
Value:
int main(int argc, char **argv) { \
return dttr_test_run_cases((TESTS), DTTR_TEST_ARRAY_COUNT(TESTS), argc, argv); \
}
int main(int argc, char *argv[])
Definition main.c:69
static int dttr_test_run_cases(const DTTR_TestCase *test_cases, size_t test_case_count, int argc, char **argv)
#define DTTR_TEST_ARRAY_COUNT(TESTS)

Definition at line 21 of file dttr_test_support.h.

Function Documentation

◆ dttr_test_find_case()

const DTTR_TestCase * dttr_test_find_case ( const DTTR_TestCase * test_cases,
size_t test_case_count,
const char * name )
inlinestatic

Definition at line 54 of file dttr_test_support.h.

References NULL.

Referenced by dttr_test_run_cases().

◆ dttr_test_require_available()

◆ dttr_test_run_case()

int dttr_test_run_case ( const DTTR_TestCase * test_case)
inlinestatic

Definition at line 27 of file dttr_test_support.h.

References DTTR_TestCase::fn, DTTR_TestCase::name, and NULL.

Referenced by dttr_test_run_cases().

◆ dttr_test_run_cases()

int dttr_test_run_cases ( const DTTR_TestCase * test_cases,
size_t test_case_count,
int argc,
char ** argv )
inlinestatic

Definition at line 73 of file dttr_test_support.h.

References dttr_test_find_case(), and dttr_test_run_case().