MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / mc_foreacharray

Function mc_foreacharray

unittest/unittest.cpp:205–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203 int failure = 0;
204 int success = 0;
205 mc_foreacharray(String, filename, list) {
206 MessageParser * parser = MessageParser::messageParserWithContentsOfFile(filename);
207 prepareHeaderForUnitTest(parser->header());
208 preparePartForUnitTest(parser->mainPart());
209 HashMap * result = parser->serializable();
210 String * expectedPath = outputPath->stringByAppendingPathComponent(filename->substringFromIndex(inputPath->length()));
211 //fprintf(stderr, "expected: %s\n", MCUTF8(expectedPath));
212 HashMap * expectedResult = (HashMap *) JSON::objectFromJSONData(Data::dataWithContentsOfFile(expectedPath));
213 if (result->isEqual(expectedResult)) {
214 success ++;
215 }
216 else {
217 fprintf(stderr, "testMessageParser: failed for %s\n", MCUTF8(filename));
218 fprintf(stderr, "expected: %s\n", MCUTF8(expectedResult));
219 fprintf(stderr, "got: %s\n", MCUTF8(result));
220 failure ++;
221 }
222 }
223 if (failure > 0) {
224 printf("testMessageParser ok: %i succeeded, %i failed\n", success, failure);
225 global_failure ++;

Callers

nothing calls this directly

Calls 15

prepareHeaderForUnitTestFunction · 0.85
preparePartForUnitTestFunction · 0.85
tweakDateFromSummaryFunction · 0.85
substringFromIndexMethod · 0.80
lowercaseStringMethod · 0.80
lastPathComponentMethod · 0.80
hasPrefixMethod · 0.80

Tested by

no test coverage detected