Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
exceptions.h File Reference

Go to the source code of this file.

Macros

#define CRI_ASSERT_TEST_SPECIFIER_throw(...)   ,
 
#define CRI_ASSERT_SPECIFIER_throw(Ex, Stmt)
 
#define CRI_ASSERT_TEST_SPECIFIER_nothrow(...)   ,
 
#define CRI_ASSERT_SPECIFIER_nothrow(Stmt)
 
#define CRI_ASSERT_TEST_SPECIFIER_anythrow(...)   ,
 
#define CRI_ASSERT_SPECIFIER_anythrow(Stmt)
 

Macro Definition Documentation

◆ CRI_ASSERT_SPECIFIER_anythrow

#define CRI_ASSERT_SPECIFIER_anythrow ( Stmt)
Value:
cri_cond_def; do { \
cri_assert_node_init(&cri_tmpn); \
cri_tmpn.repr = "anythrow(" #Stmt ")"; \
try { \
Stmt; \
cri_cond_un = 0; \
} catch (...) { \
cri_cond_un = 1; \
char *cri_str; \
cr_asprintf(&cri_str, "<unprintable>"); \
cri_tmpn.params[0].name = "message"; \
cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
cri_tmpn.params[0].data = cri_str; \
} \
cri_prevnode = cri_assert_node_add(cri_node, &cri_tmpn); \
} while (0)
CR_API struct cri_assert_node * cri_assert_node_add(struct cri_assert_node *tree, struct cri_assert_node *node)
@ CRI_ASSERT_RT_STR

Definition at line 89 of file exceptions.h.

89#define CRI_ASSERT_SPECIFIER_anythrow(Stmt) \
90 cri_cond_def; do { \
91 cri_assert_node_init(&cri_tmpn); \
92 cri_tmpn.repr = "anythrow(" #Stmt ")"; \
93 try { \
94 Stmt; \
95 cri_cond_un = 0; \
96 } catch (...) { \
97 cri_cond_un = 1; \
98 char *cri_str; \
99 cr_asprintf(&cri_str, "<unprintable>"); \
100 cri_tmpn.params[0].name = "message"; \
101 cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
102 cri_tmpn.params[0].data = cri_str; \
103 } \
104 cri_prevnode = cri_assert_node_add(cri_node, &cri_tmpn); \
105 } while (0)

◆ CRI_ASSERT_SPECIFIER_nothrow

#define CRI_ASSERT_SPECIFIER_nothrow ( Stmt)
Value:
cri_cond_def; do { \
cri_assert_node_init(&cri_tmpn); \
cri_tmpn.repr = "nothrow(" #Stmt ")"; \
try { \
Stmt; \
cri_cond_un = 1; \
} catch (std::exception &cri_ex) { \
cri_cond_un = 0; \
const char *cri_what = cri_ex.what(); \
char *cri_str = cr_user_str_tostr(&cri_what); \
cri_tmpn.params[0].name = "message"; \
cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
cri_tmpn.params[0].data = cri_str; \
} catch (...) { \
cri_cond_un = 0; \
char *cri_str; \
cr_asprintf(&cri_str, "<unprintable>"); \
cri_tmpn.params[0].name = "message"; \
cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
cri_tmpn.params[0].data = cri_str; \
} \
cri_prevnode = cri_assert_node_add(cri_node, &cri_tmpn); \
} while (0)

Definition at line 63 of file exceptions.h.

63#define CRI_ASSERT_SPECIFIER_nothrow(Stmt) \
64 cri_cond_def; do { \
65 cri_assert_node_init(&cri_tmpn); \
66 cri_tmpn.repr = "nothrow(" #Stmt ")"; \
67 try { \
68 Stmt; \
69 cri_cond_un = 1; \
70 } catch (std::exception &cri_ex) { \
71 cri_cond_un = 0; \
72 const char *cri_what = cri_ex.what(); \
73 char *cri_str = cr_user_str_tostr(&cri_what); \
74 cri_tmpn.params[0].name = "message"; \
75 cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
76 cri_tmpn.params[0].data = cri_str; \
77 } catch (...) { \
78 cri_cond_un = 0; \
79 char *cri_str; \
80 cr_asprintf(&cri_str, "<unprintable>"); \
81 cri_tmpn.params[0].name = "message"; \
82 cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
83 cri_tmpn.params[0].data = cri_str; \
84 } \
85 cri_prevnode = cri_assert_node_add(cri_node, &cri_tmpn); \
86 } while (0)

◆ CRI_ASSERT_SPECIFIER_throw

#define CRI_ASSERT_SPECIFIER_throw ( Ex,
Stmt )
Value:
cri_cond_def; do { \
cri_assert_node_init(&cri_tmpn); \
cri_tmpn.repr = "throw(" #Ex ", " #Stmt ")"; \
try { \
Stmt; \
cri_cond_un = 0; \
char *cri_str; \
cr_asprintf(&cri_str, "<nothing was thrown>"); \
cri_tmpn.params[0].name = "message"; \
cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
cri_tmpn.params[0].data = cri_str; \
} catch (Ex &cri_ex) { \
cri_cond_un = 1; \
} catch (std::exception &cri_ex) { \
cri_cond_un = 0; \
const char *cri_what = cri_ex.what(); \
char *cri_str = cr_user_str_tostr(&cri_what); \
cri_tmpn.params[0].name = "message"; \
cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
cri_tmpn.params[0].data = cri_str; \
} catch (...) { \
cri_cond_un = 0; \
char *cri_str; \
cr_asprintf(&cri_str, "<unprintable>"); \
cri_tmpn.params[0].name = "message"; \
cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
cri_tmpn.params[0].data = cri_str; \
} \
cri_prevnode = cri_assert_node_add(cri_node, &cri_tmpn); \
} while (0)

Definition at line 30 of file exceptions.h.

30#define CRI_ASSERT_SPECIFIER_throw(Ex, Stmt) \
31 cri_cond_def; do { \
32 cri_assert_node_init(&cri_tmpn); \
33 cri_tmpn.repr = "throw(" #Ex ", " #Stmt ")"; \
34 try { \
35 Stmt; \
36 cri_cond_un = 0; \
37 char *cri_str; \
38 cr_asprintf(&cri_str, "<nothing was thrown>"); \
39 cri_tmpn.params[0].name = "message"; \
40 cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
41 cri_tmpn.params[0].data = cri_str; \
42 } catch (Ex &cri_ex) { \
43 cri_cond_un = 1; \
44 } catch (std::exception &cri_ex) { \
45 cri_cond_un = 0; \
46 const char *cri_what = cri_ex.what(); \
47 char *cri_str = cr_user_str_tostr(&cri_what); \
48 cri_tmpn.params[0].name = "message"; \
49 cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
50 cri_tmpn.params[0].data = cri_str; \
51 } catch (...) { \
52 cri_cond_un = 0; \
53 char *cri_str; \
54 cr_asprintf(&cri_str, "<unprintable>"); \
55 cri_tmpn.params[0].name = "message"; \
56 cri_tmpn.params[0].type = CRI_ASSERT_RT_STR; \
57 cri_tmpn.params[0].data = cri_str; \
58 } \
59 cri_prevnode = cri_assert_node_add(cri_node, &cri_tmpn); \
60 } while (0)

◆ CRI_ASSERT_TEST_SPECIFIER_anythrow

#define CRI_ASSERT_TEST_SPECIFIER_anythrow ( ...)    ,

Definition at line 88 of file exceptions.h.

◆ CRI_ASSERT_TEST_SPECIFIER_nothrow

#define CRI_ASSERT_TEST_SPECIFIER_nothrow ( ...)    ,

Definition at line 62 of file exceptions.h.

◆ CRI_ASSERT_TEST_SPECIFIER_throw

#define CRI_ASSERT_TEST_SPECIFIER_throw ( ...)    ,

Definition at line 29 of file exceptions.h.