MCPcopy Create free account
hub / github.com/commonmark/cmark / constructor

Function constructor

api_test/main.c:43–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43static void constructor(test_batch_runner *runner) {
44 for (int i = 0; i < num_node_types; ++i) {
45 cmark_node_type type = node_types[i];
46 cmark_node *node = cmark_node_new(type);
47 OK(runner, node != NULL, "new type %d", type);
48 INT_EQ(runner, cmark_node_get_type(node), type, "get_type %d", type);
49
50 switch (node->type) {
51 case CMARK_NODE_HEADING:
52 INT_EQ(runner, cmark_node_get_heading_level(node), 1,
53 "default heading level is 1");
54 node->as.heading.level = 1;
55 break;
56
57 case CMARK_NODE_LIST:
58 INT_EQ(runner, cmark_node_get_list_type(node), CMARK_BULLET_LIST,
59 "default is list type is bullet");
60 INT_EQ(runner, cmark_node_get_list_delim(node), CMARK_NO_DELIM,
61 "default is list delim is NO_DELIM");
62 INT_EQ(runner, cmark_node_get_list_start(node), 0,
63 "default is list start is 0");
64 INT_EQ(runner, cmark_node_get_list_tight(node), 0,
65 "default is list is loose");
66 break;
67
68 default:
69 break;
70 }
71
72 cmark_node_free(node);
73 }
74}
75
76static void classifiers(test_batch_runner *runner) {
77 cmark_node *node = cmark_node_new(CMARK_NODE_BLOCK_QUOTE);

Callers 1

mainFunction · 0.85

Calls 10

cmark_node_newFunction · 0.85
OKFunction · 0.85
INT_EQFunction · 0.85
cmark_node_get_typeFunction · 0.85
cmark_node_get_list_typeFunction · 0.85
cmark_node_freeFunction · 0.85

Tested by

no test coverage detected