Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
theories.h File Reference
#include "test.h"
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  criterion_datapoints
 

Macros

#define CR_TH_VA_NUM(Type, ...)   sizeof ((Type[]) { __VA_ARGS__ }) / sizeof (Type)
 
#define CR_TH_TEMP_ARRAY(Type, ...)   & (Type[]) { __VA_ARGS__ }
 
#define CR_TH_INTERNAL_TDPS(Category, Name)    static struct criterion_datapoints CR_IDENTIFIER_(Category, Name, dps)[]
 
#define CR_TH_INTERNAL_TDP(Category, Name)    (CR_IDENTIFIER_(Category, Name, dps))
 
#define CR_TH_INTERNAL_DP(Type, ...)
 
#define CR_NB_DATAPOINTS(Var)    (sizeof (Var) / sizeof (struct criterion_datapoints))
 
#define CR_VAARG_ID(Suffix, Category, Name, ...)    CR_IDENTIFIER_(Category, Name, Suffix)
 
#define CR_THEORY_BASE(Args, ...)
 
#define cr_assume_op_(Op, Actual, Expected)   cr_assume((Actual) Op (Expected))
 
#define cr_assume_str_op_(Op, Actual, Expected)    cr_assume(strcmp((Actual), (Expected)) Op 0)
 
#define Theory(Args, ...)   CR_EXPAND(CR_THEORY_BASE(Args, __VA_ARGS__))
 

Functions

CR_BEGIN_C_API CR_API void cr_theory_main (struct criterion_datapoints *dps, size_t datapoints, void(*fnptr)(void))
 

Macro Definition Documentation

◆ cr_assume_op_

#define cr_assume_op_ ( Op,
Actual,
Expected )   cr_assume((Actual) Op (Expected))

Definition at line 96 of file internal/theories.h.

◆ cr_assume_str_op_

#define cr_assume_str_op_ ( Op,
Actual,
Expected )    cr_assume(strcmp((Actual), (Expected)) Op 0)

Definition at line 98 of file internal/theories.h.

98#define cr_assume_str_op_(Op, Actual, Expected) \
99 cr_assume(strcmp((Actual), (Expected)) Op 0)

◆ CR_NB_DATAPOINTS

#define CR_NB_DATAPOINTS ( Var)     (sizeof (Var) / sizeof (struct criterion_datapoints))

Definition at line 79 of file internal/theories.h.

79#define CR_NB_DATAPOINTS(Var) \
80 (sizeof (Var) / sizeof (struct criterion_datapoints))

◆ CR_TH_INTERNAL_DP

#define CR_TH_INTERNAL_DP ( Type,
... )
Value:
{ \
sizeof (Type), \
CR_EXPAND(CR_TH_VA_NUM(Type, __VA_ARGS__)), \
#Type, \
CR_EXPAND(CR_TH_TEMP_ARRAY(Type, __VA_ARGS__)), \
}
#define CR_TH_VA_NUM(Type,...)

Definition at line 71 of file internal/theories.h.

71#define CR_TH_INTERNAL_DP(Type, ...) \
72 { \
73 sizeof (Type), \
74 CR_EXPAND(CR_TH_VA_NUM(Type, __VA_ARGS__)), \
75 #Type, \
76 CR_EXPAND(CR_TH_TEMP_ARRAY(Type, __VA_ARGS__)), \
77 }

◆ CR_TH_INTERNAL_TDP

#define CR_TH_INTERNAL_TDP ( Category,
Name )    (CR_IDENTIFIER_(Category, Name, dps))

Definition at line 68 of file internal/theories.h.

68#define CR_TH_INTERNAL_TDP(Category, Name) \
69 (CR_IDENTIFIER_(Category, Name, dps))

◆ CR_TH_INTERNAL_TDPS

#define CR_TH_INTERNAL_TDPS ( Category,
Name )    static struct criterion_datapoints CR_IDENTIFIER_(Category, Name, dps)[]

Definition at line 65 of file internal/theories.h.

65#define CR_TH_INTERNAL_TDPS(Category, Name) \
66 static struct criterion_datapoints CR_IDENTIFIER_(Category, Name, dps)[]

◆ CR_TH_TEMP_ARRAY

#define CR_TH_TEMP_ARRAY ( Type,
... )   & (Type[]) { __VA_ARGS__ }

Definition at line 62 of file internal/theories.h.

◆ CR_TH_VA_NUM

#define CR_TH_VA_NUM ( Type,
... )   sizeof ((Type[]) { __VA_ARGS__ }) / sizeof (Type)

Definition at line 61 of file internal/theories.h.

◆ CR_THEORY_BASE

#define CR_THEORY_BASE ( Args,
... )
Value:
void CR_EXPAND(CR_VAARG_ID(theory, __VA_ARGS__, )) Args; \
CR_EXPAND(CR_TEST_BASE(__VA_ARGS__, .sentinel_ = 0)) { \
cr_theory_main( \
CR_EXPAND(CR_VAARG_ID(dps, __VA_ARGS__, )), \
CR_NB_DATAPOINTS(CR_EXPAND(CR_VAARG_ID(dps, __VA_ARGS__, ))), \
(void (*)(void))CR_EXPAND(CR_VAARG_ID(theory, __VA_ARGS__, )) \
); \
} \
void CR_EXPAND(CR_VAARG_ID(theory, __VA_ARGS__, )) Args
#define CR_VAARG_ID(Suffix, Category, Name,...)
#define CR_NB_DATAPOINTS(Var)
static const int sentinel_
#define CR_EXPAND(x)
Definition preprocess.h:35
#define CR_TEST_BASE(Category, Name,...)
Definition test.h:156

Definition at line 85 of file internal/theories.h.

85#define CR_THEORY_BASE(Args, ...) \
86 void CR_EXPAND(CR_VAARG_ID(theory, __VA_ARGS__, )) Args; \
87 CR_EXPAND(CR_TEST_BASE(__VA_ARGS__, .sentinel_ = 0)) { \
88 cr_theory_main( \
89 CR_EXPAND(CR_VAARG_ID(dps, __VA_ARGS__, )), \
90 CR_NB_DATAPOINTS(CR_EXPAND(CR_VAARG_ID(dps, __VA_ARGS__, ))), \
91 (void (*)(void))CR_EXPAND(CR_VAARG_ID(theory, __VA_ARGS__, )) \
92 ); \
93 } \
94 void CR_EXPAND(CR_VAARG_ID(theory, __VA_ARGS__, )) Args

◆ CR_VAARG_ID

#define CR_VAARG_ID ( Suffix,
Category,
Name,
... )    CR_IDENTIFIER_(Category, Name, Suffix)

Definition at line 82 of file internal/theories.h.

82#define CR_VAARG_ID(Suffix, Category, Name, ...) \
83 CR_IDENTIFIER_(Category, Name, Suffix)

◆ Theory

#define Theory ( Args,
... )   CR_EXPAND(CR_THEORY_BASE(Args, __VA_ARGS__))

Definition at line 102 of file internal/theories.h.

Function Documentation

◆ cr_theory_main()

CR_BEGIN_C_API CR_API void cr_theory_main ( struct criterion_datapoints * dps,
size_t datapoints,
void(*)(void) fnptr )