Debian Codegraph @

tests/libxml_reporter_tests.c

raw symbols SCIP
1 #cxx . . $ `<file>/tests/libxml_reporter_tests.c`/include <cgreen/cgreen.h>cxx . . $ `<file>/include/cgreen/cgreen.h`/
2 #include <cgreen/breadcrumb.h>cxx . . $ `<file>/include/cgreen/breadcrumb.h`/
3 #include <cgreen/messaging.h>cxx . . $ `<file>/include/cgreen/messaging.h`/
4 #include "cgreen_value_internal.h"cxx . . $ `<file>/src/cgreen_value_internal.h`/
5 #include "constraint_internal.h"cxx . . $ `<file>/src/constraint_internal.h`/
6
7 #include <stdio.h>
8 #include <string.h>
9 #include <unistd.h>
10 #include <stdint.h>
11
12 #include <libxml/tree.h>
13
14 #ifdef __cpluspluscxx . . $ `<built-in>:440:9`!
15 using namespace cgreen;
16 #endif
17
18
19 #include "libxml_reporter_internal.h"cxx . . $ `<file>/src/libxml_reporter_internal.h`/
20
21 #define XMLSTRINGcxx . . $ `tests/libxml_reporter_tests.c:21:9`!(x) (BAD_CASTcxx . . $ `<external>/11592416788776295748/xmlstring.h:34:9`! x)
22
23 static const int linecxx . . $ line.=666;
24 static xmlCharcxx . . $ xmlChar# *outputcxx . . $ output. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
25
26 static void clear_outputcxx . . $ clear_output(49f6e7a06ebc5aa8).(void)
27 {
28 if (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! != outputcxx . . $ output.) {
29 xmlFreecxx . . $ xmlFree.(outputcxx . . $ output.);
30 }
31 outputcxx . . $ output. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!;
32 }
33
34 static int mocked_xmloutcxx . . $ mocked_xmlout(57df01901802f030).(xmlDocPtrcxx . . $ xmlDocPtr# doc) {
35 if (outputcxx . . $ output.) {
36 xmlFreecxx . . $ xmlFree.(outputcxx . . $ output.);
37 }
38
39 xmlDocDumpMemoryEnccxx . . $ xmlDocDumpMemoryEnc(c6f5efde093d40a3).(doc, &outputcxx . . $ output., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!, "UTF-8");
40 return 0;
41 }
42
43 static TestReportercxx . . $ TestReporter# *reportercxx . . $ reporter.;
44
45 static void setup_xml_reporter_testscxx . . $ setup_xml_reporter_tests(49f6e7a06ebc5aa8).(void) {
46 reportercxx . . $ reporter. = create_libxml_reportercxx . . $ create_libxml_reporter(7e5a2d32a0879f75).("PREFIX");
47
48 // We can not use setup_reporting() since we are running
49 // inside a test suite which needs the real reporting
50 // So we'll have to set up the messaging explicitly
51 reportercxx . . $ reporter.->ipccxx . . $ TestReporter_#ipc. = start_cgreen_messagingcxx . . $ start_cgreen_messaging(7864480464b09eea).(667);
52
53 clear_outputcxx . . $ clear_output(49f6e7a06ebc5aa8).();
54 set_libxml_reporter_printercxx . . $ set_libxml_reporter_printer(3d8c4a835df8455d).(reportercxx . . $ reporter., mocked_xmloutcxx . . $ mocked_xmlout(57df01901802f030).);
55 }
56
57 static void teardown_xml_reporter_testscxx . . $ teardown_xml_reporter_tests(49f6e7a06ebc5aa8).(void) {
58 //bad mojo when running tests in same process, as destroy_reporter also sets
59 //context.reporter = NULL, thus breaking the next test to run
60 destroy_reportercxx . . $ destroy_reporter(1083e9dac9de8fd0).(reportercxx . . $ reporter.);
61 if (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`! != outputcxx . . $ output.) {
62 freecxx . . $ free(5d22bdacc48458e8).(outputcxx . . $ output.);
63 //need to set output to NULL to avoid second free in
64 //subsequent call to setup_xml_reporter_tests->clear_output
65 //when running tests in same process
66 outputcxx . . $ output. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!;
67 }
68 }
69
70 static xmlCharcxx . . $ xmlChar#* getAttributecxx . . $ getAttribute(30ca78154f1a9045).(xmlNodePtrcxx . . $ xmlNodePtr# node, const xmlCharcxx . . $ xmlChar#* name) {
71 xmlAttrcxx . . $ xmlAttr# *attr = node->propertiescxx . . $ _xmlNode#properties.;
72 while (attr) {
73 if (xmlStrEqualcxx . . $ xmlStrEqual(e46526da1a64e2fc).(attr->namecxx . . $ _xmlAttr#name., name)) {
74 return xmlNodeGetContentcxx . . $ xmlNodeGetContent(cadd6f62b3cc3aeb).((xmlNodecxx . . $ xmlNode#*)attr);
75 }
76 attr = attr->nextcxx . . $ _xmlAttr#next.;
77 }
78
79 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
80 }
81
82 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! hasAttributecxx . . $ hasAttribute(b8a7b265cbb7da0f).(xmlNodePtrcxx . . $ xmlNodePtr# node, const xmlCharcxx . . $ xmlChar#* name) {
83 xmlAttrcxx . . $ xmlAttr# *attr = node->propertiescxx . . $ _xmlNode#properties.;
84 while (attr) {
85 if (xmlStrEqualcxx . . $ xmlStrEqual(e46526da1a64e2fc).(attr->namecxx . . $ _xmlAttr#name., name)) {
86 return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!;
87 }
88 attr = attr->nextcxx . . $ _xmlAttr#next.;
89 }
90
91 return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!;
92 }
93
94 struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to# {
95 xmlCharcxx . . $ xmlChar# *attrcxx . . $ xmlNode_has_attribute_equal_to#attr., *valuecxx . . $ xmlNode_has_attribute_equal_to#value.;
96 };
97
98 static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! compare_xmlNode_has_attribute_equal_tocxx . . $ compare_xmlNode_has_attribute_equal_to(967c8d0e1b1425dd).(Constraintcxx . . $ Constraint# *constraint,
99 CgreenValuecxx . . $ CgreenValue# actual) {
100 xmlNodePtrcxx . . $ xmlNodePtr# actualNode = (xmlNodePtrcxx . . $ xmlNodePtr#)actual.valuecxx . . $ $anonymous_type_b16cac6eed758fe0_1#value..pointer_valuecxx . . $ $anonymous_type_b16cac6eed758fe0_1#$anonymous_type_2#pointer_value.;
101 struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to# *expected =
102 (struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to#*)constraint->expected_valuecxx . . $ Constraint_#expected_value..valuecxx . . $ $anonymous_type_b16cac6eed758fe0_1#value..pointer_valuecxx . . $ $anonymous_type_b16cac6eed758fe0_1#$anonymous_type_2#pointer_value.;
103 xmlCharcxx . . $ xmlChar#* actualValue = getAttributecxx . . $ getAttribute(30ca78154f1a9045).(actualNode, expected->attrcxx . . $ xmlNode_has_attribute_equal_to#attr.);
104
105 boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! ret = xmlStrEqualcxx . . $ xmlStrEqual(e46526da1a64e2fc).(actualValue, expected->valuecxx . . $ xmlNode_has_attribute_equal_to#value.);
106 xmlFreecxx . . $ xmlFree.(actualValue);
107 return ret;
108 }
109
110 static char *failure_message_xmlNode_has_attribute_equal_tocxx . . $ failure_message_xmlNode_has_attribute_equal_to(12dea272953de187).(
111 Constraintcxx . . $ Constraint# *constraint, const char *actual_string, intptr_tcxx . . $ intptr_t# actual_value) {
112 struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to# *expected =
113 (struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to#*)constraint->expected_valuecxx . . $ Constraint_#expected_value..valuecxx . . $ $anonymous_type_b16cac6eed758fe0_1#value..pointer_valuecxx . . $ $anonymous_type_b16cac6eed758fe0_1#$anonymous_type_2#pointer_value.;
114 xmlCharcxx . . $ xmlChar#* actualValue = getAttributecxx . . $ getAttribute(30ca78154f1a9045).((xmlNodePtrcxx . . $ xmlNodePtr#)actual_value, expected->attrcxx . . $ xmlNode_has_attribute_equal_to#attr.);
115
116 const char *message_template = "Expected attribute [%s] of [%s] to [equal] [%s]\n"
117 "\tactual value:\t\t[%s]\n"
118 "\texpected to equal:\t[%s]\n";
119 size_t msglen = xmlStrlencxx . . $ xmlStrlen(b84ccf4e0bb14b06).(expected->attrcxx . . $ xmlNode_has_attribute_equal_to#attr.) + strlencxx . . $ strlen(751346f8406fd082).(actual_string) +
120 strlencxx . . $ strlen(751346f8406fd082).(constraint->expected_value_namecxx . . $ Constraint_#expected_value_name.) + xmlStrlencxx . . $ xmlStrlen(b84ccf4e0bb14b06).(actualValue) +
121 xmlStrlencxx . . $ xmlStrlen(b84ccf4e0bb14b06).(expected->valuecxx . . $ xmlNode_has_attribute_equal_to#value.) + strlencxx . . $ strlen(751346f8406fd082).(message_template);
122 char *message = (char*)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(msglen);
123 if (!message) {
124 xmlFreecxx . . $ xmlFree.(actualValue);
125 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
126 }
127
128 if (snprintfcxx . . $ snprintf(ea502d73e74c754c).(message, msglen, message_template,
129 expected->attrcxx . . $ xmlNode_has_attribute_equal_to#attr., actual_string, constraint->expected_value_namecxx . . $ Constraint_#expected_value_name.,
130 actualValue, expected->valuecxx . . $ xmlNode_has_attribute_equal_to#value.) >= (ssize_tcxx . . $ ssize_t#)msglen) {
131 xmlFreecxx . . $ xmlFree.(actualValue);
132 freecxx . . $ free(5d22bdacc48458e8).(message);
133 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!;
134 }
135
136 xmlFreecxx . . $ xmlFree.(actualValue);
137 return message;
138 }
139
140 static void destroy_xmlNode_has_attribute_equal_tocxx . . $ destroy_xmlNode_has_attribute_equal_to(f159a969fe179808).(Constraintcxx . . $ Constraint#* constraint) {
141 struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to# *expected =
142 (struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to#*)constraint->expected_valuecxx . . $ Constraint_#expected_value..valuecxx . . $ $anonymous_type_b16cac6eed758fe0_1#value..pointer_valuecxx . . $ $anonymous_type_b16cac6eed758fe0_1#$anonymous_type_2#pointer_value.;
143 xmlFreecxx . . $ xmlFree.(expected->attrcxx . . $ xmlNode_has_attribute_equal_to#attr.);
144 xmlFreecxx . . $ xmlFree.(expected->valuecxx . . $ xmlNode_has_attribute_equal_to#value.);
145 freecxx . . $ free(5d22bdacc48458e8).(expected);
146 destroy_empty_constraintcxx . . $ destroy_empty_constraint(f159a969fe179808).(constraint);
147 }
148
149 static Constraintcxx . . $ Constraint# *create_xmlNode_has_attribute_equal_tocxx . . $ create_xmlNode_has_attribute_equal_to(114021bc0e223331).(const xmlCharcxx . . $ xmlChar#* attr,
150 const xmlCharcxx . . $ xmlChar# *value,
151 const char* expected_value_name)
152 {
153 Constraintcxx . . $ Constraint# *constraint = create_constraintcxx . . $ create_constraint(ba55e2de72051eb6).();
154 if (!constraint)
155 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
156
157 struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to# *expected =
158 (struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to# *)malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(sizeof(struct xmlNode_has_attribute_equal_tocxx . . $ xmlNode_has_attribute_equal_to#));
159 if (!expected) {
160 constraint->destroycxx . . $ Constraint_#destroy.(constraint);
161 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!;
162 }
163
164 expected->attrcxx . . $ xmlNode_has_attribute_equal_to#attr. = xmlStrdupcxx . . $ xmlStrdup(e2f506498e388245).(attr);
165 expected->valuecxx . . $ xmlNode_has_attribute_equal_to#value. = xmlStrdupcxx . . $ xmlStrdup(e2f506498e388245).(value);
166
167 constraint->expected_valuecxx . . $ Constraint_#expected_value. =cxx . . $ $anonymous_type_b16cac6eed758fe0_1#`operator=`(a2511b233eaf4cb9). make_cgreen_pointer_valuecxx . . $ make_cgreen_pointer_value(32799a8d7b9a4e33).(expected);
168 constraint->expected_value_namecxx . . $ Constraint_#expected_value_name. = strdupcxx . . $ strdup(a8b8e32347182212).(expected_value_name);
169 constraint->typecxx . . $ Constraint_#type. = CGREEN_STRING_COMPARER_CONSTRAINTcxx . . $ CGREEN_STRING_COMPARER_CONSTRAINT.;
170
171 constraint->comparecxx . . $ Constraint_#compare. = &compare_xmlNode_has_attribute_equal_tocxx . . $ compare_xmlNode_has_attribute_equal_to(967c8d0e1b1425dd).;
172 constraint->failure_messagecxx . . $ Constraint_#failure_message. = &failure_message_xmlNode_has_attribute_equal_tocxx . . $ failure_message_xmlNode_has_attribute_equal_to(12dea272953de187).;
173 constraint->namecxx . . $ Constraint_#name. = "have attribute with value";
174 constraint->size_of_expected_valuecxx . . $ Constraint_#size_of_expected_value. = sizeof(intptr_tcxx . . $ intptr_t#);
175 constraint->destroycxx . . $ Constraint_#destroy. = &destroy_xmlNode_has_attribute_equal_tocxx . . $ destroy_xmlNode_has_attribute_equal_to(f159a969fe179808).;
176
177 return constraint;
178 }
179
180 #define xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!(attr, value) \
181 create_xmlNode_has_attribute_equal_to(XMLSTRINGcxx . . $ `tests/libxml_reporter_tests.c:21:9`!(attr), XMLSTRINGcxx . . $ `tests/libxml_reporter_tests.c:21:9`!(value), #value)
182
183 static xmlNodePtrcxx . . $ xmlNodePtr# xmlnode_find_siblingcxx . . $ xmlnode_find_sibling(2d28023bb541569e).(xmlNodePtrcxx . . $ xmlNodePtr# node, const char *name)
184 {
185 while (node) {
186 if (xmlStrEqualcxx . . $ xmlStrEqual(e46526da1a64e2fc).(node->namecxx . . $ _xmlNode#name., XMLSTRINGcxx . . $ `tests/libxml_reporter_tests.c:21:9`!(name)))
187 break;
188 node = xmlNextElementSiblingcxx . . $ xmlNextElementSibling(3a610665e8c694f1).(node);
189 }
190 return node;
191 }
192
193 Describecxx . . $ contextForLibXmlReporter.(LibXmlReporter);
194 BeforeEachcxx . . $ BeforeEach_For_LibXmlReporter_Function(49f6e7a06ebc5aa8).(LibXmlReporter) {
195 setup_xml_reporter_testscxx . . $ setup_xml_reporter_tests(49f6e7a06ebc5aa8).();
196 }
197 AfterEachcxx . . $ `include/cgreen/unit.h:18:9`!(LibXmlReporter) {
198 teardown_xml_reporter_testscxx . . $ teardown_xml_reporter_tests(49f6e7a06ebc5aa8).();
199 }
200
201
202 Ensurecxx . . $ CgreenSpec__LibXmlReporter__will_report_beginning_of_suite__.(LibXmlReporter, will_report_beginning_of_suite) {
203 reportercxx . . $ reporter.->start_suitecxx . . $ TestReporter_#start_suite.(reportercxx . . $ reporter., "suite_name", 2);
204 reportercxx . . $ reporter.->finish_suitecxx . . $ TestReporter_#finish_suite.(reportercxx . . $ reporter., "filename", linecxx . . $ line.);
205
206 xmlDocPtrcxx . . $ xmlDocPtr# doc = xmlParseDoccxx . . $ xmlParseDoc(6ad5ddcc52642397).(outputcxx . . $ output.);
207 assert_thatcxx . . $ cgreen/(doc, is_not_nullcxx . . $ `include/cgreen/constraint_syntax_helpers.h:30:9`!);
208
209 xmlNodePtrcxx . . $ xmlNodePtr# testsuite = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc);
210 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(testsuite->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("testsuite"));
211 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(xmlChildElementCount(testsuite), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(0));
212 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(testsuite, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("name", "suite_name"));
213 xmlFreeDoccxx . . $ xmlFreeDoc(42de24d0ab3f771).(doc);
214 }
215
216
217 static void reporter_show_pass_vargscxx . . $ reporter_show_pass_vargs(f41b995409722d28).(TestReportercxx . . $ TestReporter# *reporter, const char *name, int line,
218 const char *format, ...)
219 {
220 va_listcxx . . $ va_list# vargs;
221 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(vargs, format);
222 reporter->show_passcxx . . $ TestReporter_#show_pass.(reporter, name, line, format, vargs);
223 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(vargs);
224 }
225
226 Ensurecxx . . $ CgreenTest#(LibXmlReporter, will_report_beginning_and_successful_finishing_of_passing_test) {
227 reportercxx . . $ reporter.->start_suitecxx . . $ TestReporter_#start_suite.(reportercxx . . $ reporter., "suite_name", 2);
228 reportercxx . . $ reporter.->start_testcxx . . $ TestReporter_#start_test.(reportercxx . . $ reporter., "test_name");
229 reporter_show_pass_vargscxx . . $ reporter_show_pass_vargs(f41b995409722d28).(reportercxx . . $ reporter., "file", 2, "test_name");
230 send_reporter_completion_notificationcxx . . $ send_reporter_completion_notification(1083e9dac9de8fd0).(reportercxx . . $ reporter.);
231 reportercxx . . $ reporter.->finish_testcxx . . $ TestReporter_#finish_test.(reportercxx . . $ reporter., "filename", linecxx . . $ line., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
232 reportercxx . . $ reporter.->finish_suitecxx . . $ TestReporter_#finish_suite.(reportercxx . . $ reporter., "filename", linecxx . . $ line.);
233
234 xmlDocPtrcxx . . $ xmlDocPtr# doc = xmlParseDoccxx . . $ xmlParseDoc(6ad5ddcc52642397).(outputcxx . . $ output.);
235 assert_thatcxx . . $ intptr_t#(doc, is_not_nullcxx . . $ `include/cgreen/constraint_syntax_helpers.h:30:9`!);
236
237 xmlNodePtrcxx . . $ xmlNodePtr# testsuite = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc);
238 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(xmlChildElementCount(testsuite), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1));
239
240 xmlNodePtrcxx . . $ xmlNodePtr# testcase = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testsuite);
241 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(testcase->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("testcase"));
242 assert_thatcxx . . $ cgreen/(xmlChildElementCount(testcase), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(0));
243 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(testcase, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("name", "test_name"));
244 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(testcase, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("classname", "suite_name"));
245 }
246
247
248 static void reporter_show_fail_vargscxx . . $ reporter_show_fail_vargs(f41b995409722d28).(TestReportercxx . . $ TestReporter# *reporter, const char *name, int line,
249 const char *format, ...)
250 {
251 va_listcxx . . $ va_list# vargs;
252 va_startcxx . . $ `<external>/8293021631987149590/stdarg.h:51:9`!(vargs, format);
253 reporter->show_failcxx . . $ TestReporter_#show_fail.(reporter, name, line, format, vargs);
254 va_endcxx . . $ `<external>/8293021631987149590/stdarg.h:53:9`!(vargs);
255 }
256
257 Ensurecxx . . $ LibXmlReporter__will_report_a_failing_test(49f6e7a06ebc5aa8).(LibXmlReporter, will_report_a_failing_test) {
258 reportercxx . . $ reporter.->start_suitecxx . . $ TestReporter_#start_suite.(reportercxx . . $ reporter., "suite_name", 2);
259 reportercxx . . $ reporter.->start_testcxx . . $ TestReporter_#start_test.(reportercxx . . $ reporter., "test_name");
260 reporter_show_fail_vargscxx . . $ reporter_show_fail_vargs(f41b995409722d28).(reportercxx . . $ reporter., "file", 2, "test_name");
261 send_reporter_completion_notificationcxx . . $ send_reporter_completion_notification(1083e9dac9de8fd0).(reportercxx . . $ reporter.);
262 reportercxx . . $ reporter.->finish_testcxx . . $ TestReporter_#finish_test.(reportercxx . . $ reporter., "filename", linecxx . . $ line., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!);
263 reportercxx . . $ reporter.->finish_suitecxx . . $ TestReporter_#finish_suite.(reportercxx . . $ reporter., "filename", linecxx . . $ line.);
264
265 xmlDocPtrcxx . . $ xmlDocPtr# doc = xmlParseDoccxx . . $ xmlParseDoc(6ad5ddcc52642397).(outputcxx . . $ output.);
266 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(doc, is_not_nullcxx . . $ `include/cgreen/constraint_syntax_helpers.h:30:9`!);
267
268 xmlNodePtrcxx . . $ xmlNodePtr# testsuite = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc);
269 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(xmlChildElementCount(testsuite), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1));
270
271 xmlNodePtrcxx . . $ xmlNodePtr# testcase = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testsuite);
272 assert_thatcxx . . $ _xmlNode#name.(testcase->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("testcase"));
273 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(xmlChildElementCount(testcase), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1));
274 assert_thatcxx . . $ intptr_t#(hasAttribute(testcase, XMLSTRINGcxx . . $ `tests/libxml_reporter_tests.c:21:9`!("time")), is_truecxx . . $ `include/cgreen/constraint_syntax_helpers.h:33:9`!);
275
276 xmlNodePtrcxx . . $ xmlNodePtr# failure = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testcase);
277 assert_thatcxx . . $ intptr_t#(failure->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("failure"));
278 assert_thatcxx . . $ cgreen/(xmlChildElementCount(failure), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1));
279 assert_thatcxx . . $ intptr_t#(failure, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("message", "test_name"));
280
281 xmlNodePtrcxx . . $ xmlNodePtr# location = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(failure);
282 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(location->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("location"));
283 assert_thatcxx . . $ cgreen/(xmlChildElementCount(location), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(0));
284 assert_thatcxx . . $ create_xmlNode_has_attribute_equal_to(114021bc0e223331).(location, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("file", "file"));
285 assert_thatcxx . . $ intptr_t#(location, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("line", "2"));
286 }
287
288 Ensurecxx . . $ CgreenTest#(LibXmlReporter, will_report_a_failing_test_only_once) {
289 va_listcxx . . $ va_list# null_arguments;
290 memsetcxx . . $ memset(d1de1e4fb215f1c6).(&null_arguments, 0, sizeof(null_arguments));
291
292 reportercxx . . $ reporter.->start_suitecxx . . $ TestReporter_#start_suite.(reportercxx . . $ reporter., "suite_name", 2);
293 reportercxx . . $ reporter.->start_testcxx . . $ TestReporter_#start_test.(reportercxx . . $ reporter., "test_name");
294 reportercxx . . $ reporter.->show_failcxx . . $ TestReporter_#show_fail.(reportercxx . . $ reporter., "file", 2, "test_failure_message", null_arguments);
295 reportercxx . . $ reporter.->show_failcxx . . $ TestReporter_#show_fail.(reportercxx . . $ reporter., "file", 2, "other_message", null_arguments);
296 reportercxx . . $ reporter.->finish_testcxx . . $ TestReporter_#finish_test.(reportercxx . . $ reporter., "filename", linecxx . . $ line., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:416:9`!);
297 reportercxx . . $ reporter.->finish_suitecxx . . $ TestReporter_#finish_suite.(reportercxx . . $ reporter., "filename", linecxx . . $ line.);
298
299 xmlDocPtrcxx . . $ xmlDocPtr# doc = xmlParseDoccxx . . $ xmlParseDoc(6ad5ddcc52642397).(outputcxx . . $ output.);
300 xmlNodePtrcxx . . $ xmlNodePtr# testsuite = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc);
301 xmlNodePtrcxx . . $ xmlNodePtr# testcase = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testsuite);
302
303 static const char FAILURE[] = "failure";
304 xmlNodePtrcxx . . $ xmlNodePtr# failure = xmlnode_find_siblingcxx . . $ xmlnode_find_sibling(2d28023bb541569e).(xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testcase), FAILURE);
305
306 assert_thatcxx . . $ _xmlNode#name.(failure->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!(FAILURE));
307 assert_thatcxx . . $ xmlChar#(failure, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("message", "test_failure_message"));
308
309 failure = xmlnode_find_siblingcxx . . $ xmlnode_find_sibling(2d28023bb541569e).(xmlNextElementSiblingcxx . . $ xmlNextElementSibling(3a610665e8c694f1).(failure), FAILURE);
310 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(failure, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("message", "other_message"));
311
312 failure = xmlnode_find_siblingcxx . . $ xmlnode_find_sibling(2d28023bb541569e).(xmlNextElementSiblingcxx . . $ xmlNextElementSibling(3a610665e8c694f1).(failure), FAILURE);
313 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(failure, is_nullcxx . . $ `include/cgreen/constraint_syntax_helpers.h:31:9`!);
314 }
315
316 Ensurecxx . . $ LibXmlReporter__will_mark_ignored_test_as_skipped(49f6e7a06ebc5aa8).(LibXmlReporter, will_mark_ignored_test_as_skipped) {
317 const int line = 666;
318
319 reportercxx . . $ reporter.->start_suitecxx . . $ TestReporter_#start_suite.(reportercxx . . $ reporter., "suite_name", 1);
320 reportercxx . . $ reporter.->start_testcxx . . $ TestReporter_#start_test.(reportercxx . . $ reporter., "skipped_test_name");
321 send_reporter_skipped_notificationcxx . . $ send_reporter_skipped_notification(1083e9dac9de8fd0).(reportercxx . . $ reporter.);
322 reportercxx . . $ reporter.->finish_testcxx . . $ TestReporter_#finish_test.(reportercxx . . $ reporter., "filename", line, "message");
323 reportercxx . . $ reporter.->finish_suitecxx . . $ TestReporter_#finish_suite.(reportercxx . . $ reporter., "filename", line);
324
325 xmlDocPtrcxx . . $ xmlDocPtr# doc = xmlParseDoccxx . . $ xmlParseDoc(6ad5ddcc52642397).(outputcxx . . $ output.);
326 assert_thatcxx . . $ cgreen/(doc, is_not_nullcxx . . $ `include/cgreen/constraint_syntax_helpers.h:30:9`!);
327
328 xmlNodePtrcxx . . $ xmlNodePtr# testsuite = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc);
329 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(xmlChildElementCount(testsuite), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1));
330
331 xmlNodePtrcxx . . $ xmlNodePtr# testcase = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testsuite);
332 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(testcase->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("testcase"));
333 assert_thatcxx . . $ intptr_t#(xmlChildElementCount(testcase), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1));
334 assert_thatcxx . . $ xmlChar#(hasAttribute(testcase, XMLSTRINGcxx . . $ `tests/libxml_reporter_tests.c:21:9`!("time")), is_truecxx . . $ `include/cgreen/constraint_syntax_helpers.h:33:9`!);
335
336 xmlNodePtrcxx . . $ xmlNodePtr# skipped = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testcase);
337 assert_thatcxx . . $ intptr_t#(skipped->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("skipped"));
338 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(xmlChildElementCount(skipped), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(0));
339 }
340
341
342 Ensurecxx . . $ CgreenTest#(LibXmlReporter, will_report_non_finishing_test) {
343 const int line = 666;
344
345 reportercxx . . $ reporter.->start_suitecxx . . $ TestReporter_#start_suite.(reportercxx . . $ reporter., "suite_name", 1);
346 reportercxx . . $ reporter.->start_testcxx . . $ TestReporter_#start_test.(reportercxx . . $ reporter., "test_name");
347 send_reporter_exception_notificationcxx . . $ send_reporter_exception_notification(1083e9dac9de8fd0).(reportercxx . . $ reporter.);
348 reportercxx . . $ reporter.->finish_testcxx . . $ TestReporter_#finish_test.(reportercxx . . $ reporter., "filename", line, "message");
349 reportercxx . . $ reporter.->finish_suitecxx . . $ TestReporter_#finish_suite.(reportercxx . . $ reporter., "filename", line);
350
351 xmlDocPtrcxx . . $ xmlDocPtr# doc = xmlParseDoccxx . . $ xmlParseDoc(6ad5ddcc52642397).(outputcxx . . $ output.);
352 assert_thatcxx . . $ cgreen/(doc, is_not_nullcxx . . $ `include/cgreen/constraint_syntax_helpers.h:30:9`!);
353
354 xmlNodePtrcxx . . $ xmlNodePtr# testsuite = xmlDocGetRootElementcxx . . $ xmlDocGetRootElement(53aa9a676bd496f2).(doc);
355 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(xmlChildElementCount(testsuite), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1));
356
357 xmlNodePtrcxx . . $ xmlNodePtr# testcase = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testsuite);
358 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(testcase->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("testcase"));
359 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(xmlChildElementCount(testcase), is_equal_tocxx . . $ `include/cgreen/constraint_syntax_helpers.h:26:9`!(1));
360 assert_thatcxx . . $ intptr_t#(hasAttribute(testcase, XMLSTRINGcxx . . $ `tests/libxml_reporter_tests.c:21:9`!("time")), is_truecxx . . $ `include/cgreen/constraint_syntax_helpers.h:33:9`!);
361
362 xmlNodePtrcxx . . $ xmlNodePtr# error = xmlFirstElementChildcxx . . $ xmlFirstElementChild(3a610665e8c694f1).(testcase);
363 assert_thatcxx . . $ `include/cgreen/assertions.h:30:9`!(error->name, is_equal_to_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:41:9`!("error"));
364 assert_thatcxx . . $ create_xmlNode_has_attribute_equal_to(114021bc0e223331).(error, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("type", "Fatal"));
365 assert_thatcxx . . $ cgreen/assert_that_(b064aa216885589).(error, xmlnode_has_attribute_equal_tocxx . . $ `tests/libxml_reporter_tests.c:180:9`!("message", "message"));
366 }
367
368 Ensurecxx . . $ CgreenSpec__LibXmlReporter__will_report_time_correctly_for_non_finishing_test__.(LibXmlReporter, will_report_time_correctly_for_non_finishing_test) {
369 const int line = 666;
370
371 reportercxx . . $ reporter.->start_suitecxx . . $ TestReporter_#start_suite.(reportercxx . . $ reporter., "suite_name", 1);
372 reportercxx . . $ reporter.->start_testcxx . . $ TestReporter_#start_test.(reportercxx . . $ reporter., "test_name");
373 send_reporter_exception_notificationcxx . . $ send_reporter_exception_notification(1083e9dac9de8fd0).(reportercxx . . $ reporter.);
374 reportercxx . . $ reporter.->finish_testcxx . . $ TestReporter_#finish_test.(reportercxx . . $ reporter., "filename", line, "message");
375 reportercxx . . $ reporter.->finish_suitecxx . . $ TestReporter_#finish_suite.(reportercxx . . $ reporter., "filename", line);
376
377 assert_thatcxx . . $ output.(output, contains_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:43:9`!("name=\"test_name\""));
378 assert_thatcxx . . $ output.(output, contains_stringcxx . . $ `include/cgreen/constraint_syntax_helpers.h:43:9`!(" time=\""));
379 }
380
381 TestSuitecxx . . $ TestSuite# *libxml_reporter_testscxx . . $ libxml_reporter_tests(564401a81ded3a53).(void) {
382 TestSuitecxx . . $ TestSuite# *suite = create_test_suitecxx . . $ `include/cgreen/suite.h:20:9`!();
383 set_setupcxx . . $ set_setup(375347ed146b1459).(suite, setup_xml_reporter_testscxx . . $ setup_xml_reporter_tests(49f6e7a06ebc5aa8).);
384
385 add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, LibXmlReporter, will_report_beginning_of_suite);
386 add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, LibXmlReporter, will_report_beginning_and_successful_finishing_of_passing_test);
387 add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, LibXmlReporter, will_report_a_failing_test);
388 add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, LibXmlReporter, will_report_a_failing_test_only_once);
389 add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, LibXmlReporter, will_mark_ignored_test_as_skipped);
390 add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, LibXmlReporter, will_report_non_finishing_test);
391 add_test_with_contextcxx . . $ `include/cgreen/suite.h:23:9`!(suite, LibXmlReporter, will_report_time_correctly_for_non_finishing_test);
392
393 set_teardowncxx . . $ set_teardown(375347ed146b1459).(suite, teardown_xml_reporter_testscxx . . $ teardown_xml_reporter_tests(49f6e7a06ebc5aa8).);
394 return suite;
395 }