Support functions for mapitest modules. More...
Functions | |
void | mapitest_common_cleanup (struct mapitest *mt) |
Convenience function to clean up after logging into the server. More... | |
bool | mapitest_common_create_filled_test_folder (struct mapitest *mt) |
Create a test folder, and fill with 10 sample messages. More... | |
bool | mapitest_common_find_folder (struct mapitest *mt, mapi_object_t *obj_parent, mapi_object_t *obj_child, const char *name) |
Find a folder within a container. More... | |
bool | mapitest_common_folder_open (struct mapitest *mt, mapi_object_t *obj_parent, mapi_object_t *obj_child, uint32_t olNum) |
Opens a default folder. More... | |
char * | mapitest_common_genblob (TALLOC_CTX *mem_ctx, size_t len) |
Generate a random blob of readable data. More... | |
bool | mapitest_common_message_create (struct mapitest *mt, mapi_object_t *obj_folder, mapi_object_t *obj_message, const char *subject) |
Create a message ready to submit. More... | |
bool | mapitest_common_message_delete_by_subject (struct mapitest *mt, mapi_object_t *obj_folder, const char *subject) |
This function deletes messages in a folder, based on matching the subject name. More... | |
bool | mapitest_common_message_fill (struct mapitest *mt, mapi_object_t *obj_message, const char *subject) |
Create a message ready to submit. More... | |
bool | mapitest_common_setup (struct mapitest *mt, mapi_object_t *obj_htable, uint32_t *count) |
Convenience function to login to the server. More... | |
Support functions for mapitest modules.
These functions implement commonly needed functionality that would otherwise be copied into each module implementation
void mapitest_common_cleanup | ( | struct mapitest * | mt) |
Convenience function to clean up after logging into the server.
This functions cleans up after a mapitest_common_setup() call
mt | pointer to the top-level mapitest structure |
References mapitest_print(), mt_common_tf_ctx::obj_store, mt_common_tf_ctx::obj_test_folder, mt_common_tf_ctx::obj_test_msg, mt_common_tf_ctx::obj_top_folder, and mapitest::priv.
Referenced by mapitest_oxcfold_HardDeleteMessagesAndSubfolders(), mapitest_oxcfxics_CopyFolder(), mapitest_oxcfxics_CopyMessages(), mapitest_oxcfxics_CopyProperties(), mapitest_oxcfxics_CopyTo(), mapitest_oxcfxics_DestConfigure(), mapitest_oxcfxics_SetLocalReplicaMidsetDeleted(), mapitest_oxcfxics_SyncConfigure(), mapitest_oxcfxics_SyncOpenCollector(), mapitest_oxcmsg_SetReadFlags(), mapitest_oxctable_Category(), mapitest_oxctable_CreateBookmark(), mapitest_oxctable_GetStatus(), mapitest_oxctable_QueryColumns(), mapitest_oxctable_QueryRows(), mapitest_oxctable_Restrict(), mapitest_oxctable_SeekRow(), mapitest_oxctable_SeekRowApprox(), mapitest_oxctable_SeekRowBookmark(), mapitest_oxctable_SetColumns(), and mapitest_oxomsg_TransportNewMail().
bool mapitest_common_create_filled_test_folder | ( | struct mapitest * | mt) |
Create a test folder, and fill with 10 sample messages.
This function creates a test folder (name set by the MT_DIRNAME_TEST define), and fills it with 5 messages with the same subject and 5 messages with the same sender.
mt | pointer to the mapitest context |
References mapitest_common_message_create(), mapitest_print(), mapitest_print_retval(), mapitest::mem_ctx, mt_common_tf_ctx::obj_test_folder, mt_common_tf_ctx::obj_test_msg, mt_common_tf_ctx::obj_top_folder, and mapitest::priv.
Referenced by mapitest_common_setup().
bool mapitest_common_find_folder | ( | struct mapitest * | mt, |
mapi_object_t * | obj_parent, | ||
mapi_object_t * | obj_child, | ||
const char * | name | ||
) |
Find a folder within a container.
References mapitest::mem_ctx.
Referenced by mapitest_oxcfold_CopyFolder(), and mapitest_oxcfold_MoveFolder().
bool mapitest_common_folder_open | ( | struct mapitest * | mt, |
mapi_object_t * | obj_parent, | ||
mapi_object_t * | obj_child, | ||
uint32_t | olNum | ||
) |
Opens a default folder.
This function opens one of the default (standard) folders, returning the folder as obj_child. olNum may be one of:
mt | pointer to the top level mapitest structure |
obj_parent | parent folder (usually the message store, must be opened) |
obj_child | the folder that has been opened |
olNum | the folder identifier (see list above) |
References mapitest_print().
Referenced by mapitest_common_setup(), mapitest_oxcfold_CopyFolder(), mapitest_oxcfold_MoveFolder(), mapitest_oxcmsg_CreateMessage(), mapitest_oxcmsg_GetValidAttachments(), mapitest_oxcmsg_OpenEmbeddedMessage(), mapitest_oxcmsg_SetMessageReadFlag(), mapitest_oxcnotif_RegisterNotification(), mapitest_oxomsg_SpoolerLockMessage(), mapitest_oxomsg_TransportSend(), and mapitest_oxorule_GetRulesTable().
char* mapitest_common_genblob | ( | TALLOC_CTX * | mem_ctx, |
size_t | len | ||
) |
Generate a random blob of readable data.
mem_ctx | the talloc memory context to create the blob in |
len | the length of the blob to create |
Referenced by mapitest_oxcprpt_CopyToStream(), mapitest_oxcprpt_Stream(), and mapitest_oxcprpt_WriteAndCommitStream().
bool mapitest_common_message_create | ( | struct mapitest * | mt, |
mapi_object_t * | obj_folder, | ||
mapi_object_t * | obj_message, | ||
const char * | subject | ||
) |
Create a message ready to submit.
References mapitest_common_message_fill(), and mapitest_print_retval().
Referenced by mapitest_common_create_filled_test_folder(), mapitest_oxcfold_HardDeleteMessages(), mapitest_oxcfold_MoveCopyMessages(), mapitest_oxcfold_MoveFolder(), mapitest_oxcmsg_GetValidAttachments(), mapitest_oxcmsg_OpenEmbeddedMessage(), mapitest_oxcmsg_SetMessageReadFlag(), mapitest_oxcprpt_CopyProps(), mapitest_oxcprpt_CopyTo(), mapitest_oxcprpt_CopyToStream(), mapitest_oxcprpt_DeleteProps(), mapitest_oxcprpt_NameId(), mapitest_oxcprpt_Stream(), mapitest_oxcprpt_WriteAndCommitStream(), mapitest_oxomsg_AbortSubmit(), mapitest_oxomsg_SpoolerLockMessage(), mapitest_oxomsg_SubmitMessage(), and mapitest_oxomsg_TransportSend().
bool mapitest_common_message_delete_by_subject | ( | struct mapitest * | mt, |
mapi_object_t * | obj_folder, | ||
const char * | subject | ||
) |
This function deletes messages in a folder, based on matching the subject name.
This is meant to clean up a folder after a test has been run.
mt | pointer to the top level mapitest structure |
obj_folder | the folder to search through |
subject | the message subject to match |
References mapitest_print(), mapitest_print_retval(), and mapitest::mem_ctx.
Referenced by mapitest_oxomsg_AbortSubmit(), mapitest_oxomsg_SubmitMessage(), and mapitest_oxomsg_TransportSend().
bool mapitest_common_message_fill | ( | struct mapitest * | mt, |
mapi_object_t * | obj_message, | ||
const char * | subject | ||
) |
Create a message ready to submit.
References mapitest_print_retval(), mapitest::mem_ctx, and mapitest::profile.
Referenced by mapitest_common_message_create(), and mapitest_oxcmsg_OpenEmbeddedMessage().
bool mapitest_common_setup | ( | struct mapitest * | mt, |
mapi_object_t * | obj_htable, | ||
uint32_t * | count | ||
) |
Convenience function to login to the server.
This functions logs into the server, gets the top level store, and gets the hierarchy table for the top level store (which is returned as obj_htable). It also creates a test folder with 10 test messages.
mt | pointer to the top-level mapitest structure |
obj_htable | the hierarchy table for the top level store |
count | the number of rows in the top level hierarchy table |
References mapitest_common_create_filled_test_folder(), mapitest_common_folder_open(), mapitest_print_retval(), mapitest::mem_ctx, mt_common_tf_ctx::obj_store, mt_common_tf_ctx::obj_top_folder, mapitest::priv, and mapitest::session.
Referenced by mapitest_oxcfold_HardDeleteMessagesAndSubfolders(), mapitest_oxcfxics_CopyFolder(), mapitest_oxcfxics_CopyMessages(), mapitest_oxcfxics_CopyProperties(), mapitest_oxcfxics_CopyTo(), mapitest_oxcfxics_DestConfigure(), mapitest_oxcfxics_SetLocalReplicaMidsetDeleted(), mapitest_oxcfxics_SyncConfigure(), mapitest_oxcfxics_SyncOpenCollector(), mapitest_oxcmsg_SetReadFlags(), mapitest_oxctable_Category(), mapitest_oxctable_CreateBookmark(), mapitest_oxctable_GetStatus(), mapitest_oxctable_QueryColumns(), mapitest_oxctable_QueryRows(), mapitest_oxctable_Restrict(), mapitest_oxctable_SeekRow(), mapitest_oxctable_SeekRowApprox(), mapitest_oxctable_SeekRowBookmark(), mapitest_oxctable_SetColumns(), and mapitest_oxomsg_TransportNewMail().
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |