/** \details Test dump of an new mail notification This function: -# Tests the mapidump_msgflags function with no bits set -# Tests the mapidump_msgflags function with one bit set -# Tests the mapidump_msgflags function with all bits set -# Builds an indicative new mail notification -# Calls the mapidump_newmail function to test dumping of that new mail notification \param mt pointer to the top-level mapitest structure \return true on success, otherwise false \note This currently doesn't check the results are sane, so manual inspection is required */ _PUBLIC_ bool mapitest_mapidump_newmail(struct mapitest *mt) { struct NewMailNotification notif; mapidump_msgflags(0x0, "[sep]"); mapidump_msgflags(0x100, "[sep]"); mapidump_msgflags(0x1|0x2|0x4|0x8|0x10|0x20|0x40|0x80|0x100|0x200, "[sep]"); notif.FID = 0xFEDCBA9876543210LL; notif.MID = 0xBADCAFEBEEF87625LL; notif.MessageFlags = 0x20|0x2; notif.UnicodeFlag = false; notif.MessageClass.lpszA = "Dummy class"; mapidump_newmail(¬if, "[sep]"); return true; }
_PUBLIC_ void mapidump_newmail(struct NewMailNotification *newmail, const char *sep) { printf("%sParent Entry ID: 0x%"PRIx64"\n", sep?sep:"", newmail->FID); fflush(0); printf("%sMessage Entry ID: 0x%"PRIx64"\n", sep?sep:"", newmail->MID); fflush(0); printf("%sMessage flags:\n", sep?sep:""); fflush(0); mapidump_msgflags(newmail->MessageFlags, sep); if (newmail->UnicodeFlag == 0x0) { printf("%sMessage Class: %s\n", sep?sep:"", newmail->MessageClass.lpszA); } else { printf("%sMessage Class: %s\n", sep?sep:"", newmail->MessageClass.lpszW); } fflush(0); }