Bitcoin Core 30.99.0
P2P Digital Currency
Classes | Macros | Typedefs | Functions | Variables
unit_test.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "unit_test.h"
#include "testrand.h"
#include "tests_common.h"
Include dependency graph for unit_test.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ArgMap
 

Macros

#define UNUSED(x)   (void)(x)
 

Typedefs

typedef int(* ArgHandler) (const char *key, const char *value, struct tf_framework *tf)
 

Functions

static int parse_jobs_count (const char *key, const char *value, struct tf_framework *tf)
 
static int parse_iterations (const char *key, const char *value, struct tf_framework *tf)
 
static int parse_seed (const char *key, const char *value, struct tf_framework *tf)
 
static int parse_target (const char *key, const char *value, struct tf_framework *tf)
 
static int parse_logging (const char *key, const char *value, struct tf_framework *tf)
 
static void print_args (const struct tf_args *args)
 
static int read_env (struct tf_framework *tf)
 
static int parse_arg (const char *key, const char *value, struct tf_framework *tf)
 
static void help (void)
 
static void print_test_list (struct tf_framework *tf)
 
static const char * normalize_key (const char *arg, const char **err_msg)
 
static int read_args (int argc, char **argv, int start, struct tf_framework *tf)
 
static void run_test_log (const struct tf_test_entry *t)
 
static void run_test (const struct tf_test_entry *t)
 
static int run_sequential (struct tf_framework *tf)
 
static int tf_init (struct tf_framework *tf, int argc, char **argv)
 
static int tf_run (struct tf_framework *tf)
 

Variables

int COUNT = 16
 
static struct ArgMap arg_map []
 

Macro Definition Documentation

◆ UNUSED

#define UNUSED (   x)    (void)(x)

Definition at line 20 of file unit_test.c.

Typedef Documentation

◆ ArgHandler

typedef int(* ArgHandler) (const char *key, const char *value, struct tf_framework *tf)

Definition at line 32 of file unit_test.c.

Function Documentation

◆ help()

static void help ( void  )
static

Definition at line 81 of file unit_test.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalize_key()

static const char * normalize_key ( const char *  arg,
const char **  err_msg 
)
static

Definition at line 159 of file unit_test.c.

Here is the caller graph for this function:

◆ parse_arg()

static int parse_arg ( const char *  key,
const char *  value,
struct tf_framework tf 
)
static

Definition at line 69 of file unit_test.c.

Here is the caller graph for this function:

◆ parse_iterations()

static int parse_iterations ( const char *  key,
const char *  value,
struct tf_framework tf 
)
static

Definition at line 135 of file unit_test.c.

Here is the caller graph for this function:

◆ parse_jobs_count()

static int parse_jobs_count ( const char *  key,
const char *  value,
struct tf_framework tf 
)
static

Definition at line 120 of file unit_test.c.

◆ parse_logging()

static int parse_logging ( const char *  key,
const char *  value,
struct tf_framework tf 
)
static

Definition at line 152 of file unit_test.c.

◆ parse_seed()

static int parse_seed ( const char *  key,
const char *  value,
struct tf_framework tf 
)
static

Definition at line 146 of file unit_test.c.

Here is the caller graph for this function:

◆ parse_target()

static int parse_target ( const char *  key,
const char *  value,
struct tf_framework tf 
)
static

Definition at line 187 of file unit_test.c.

◆ print_args()

static void print_args ( const struct tf_args args)
static

Definition at line 55 of file unit_test.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_test_list()

static void print_test_list ( struct tf_framework tf)
static

Definition at line 103 of file unit_test.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_args()

static int read_args ( int  argc,
char **  argv,
int  start,
struct tf_framework tf 
)
static

Definition at line 216 of file unit_test.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_env()

static int read_env ( struct tf_framework tf)
static

Definition at line 61 of file unit_test.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_sequential()

static int run_sequential ( struct tf_framework tf)
static

Definition at line 272 of file unit_test.c.

Here is the caller graph for this function:

◆ run_test()

static void run_test ( const struct tf_test_entry t)
static

Definition at line 269 of file unit_test.c.

Here is the caller graph for this function:

◆ run_test_log()

static void run_test_log ( const struct tf_test_entry t)
static

Definition at line 262 of file unit_test.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_init()

static int tf_init ( struct tf_framework tf,
int  argc,
char **  argv 
)
static

Definition at line 349 of file unit_test.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tf_run()

static int tf_run ( struct tf_framework tf)
static

Definition at line 411 of file unit_test.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ arg_map

struct ArgMap arg_map[]
static
Initial value:
= {
{ "t", parse_target }, { "target", parse_target },
{ "j", parse_jobs_count }, { "jobs", parse_jobs_count },
{ "i", parse_iterations }, { "iterations", parse_iterations },
{ "seed", parse_seed },
{ "log", parse_logging },
{ NULL, NULL }
}
static int parse_seed(const char *key, const char *value, struct tf_framework *tf)
Definition: unit_test.c:146
static int parse_iterations(const char *key, const char *value, struct tf_framework *tf)
Definition: unit_test.c:135
static int parse_logging(const char *key, const char *value, struct tf_framework *tf)
Definition: unit_test.c:152
static int parse_target(const char *key, const char *value, struct tf_framework *tf)
Definition: unit_test.c:187
static int parse_jobs_count(const char *key, const char *value, struct tf_framework *tf)
Definition: unit_test.c:120

Definition at line 45 of file unit_test.c.

◆ COUNT

int COUNT = 16

Definition at line 23 of file unit_test.c.