utils/mapitest/mapitest_common.c File Reference

    Support functions for %mapitest modules
More...

Functions

void mapitest_common_cleanup (struct mapitest *mt)
 Convenience function to clean up after logging into the server.
bool mapitest_common_create_filled_test_folder (struct mapitest *mt)
 Create a test folder, and fill with 10 sample messages.
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.
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.
char * mapitest_common_genblob (TALLOC_CTX *mem_ctx, size_t len)
 Generate a random blob of readable data.
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.
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.
bool mapitest_common_message_fill (struct mapitest *mt, mapi_object_t *obj_message, const char *subject)
 Create a message ready to submit.
bool mapitest_common_setup (struct mapitest *mt, mapi_object_t *obj_htable, uint32_t *count)
 Convenience function to login to the server.

Detailed Description

    Support functions for %mapitest modules

These functions implement commonly needed functionality that would otherwise be copied into each module implementation


Function Documentation

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.

Parameters:
mtpointer 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:

  • olFolderTopInformationStore
  • olFolderDeletedItems
  • olFolderOutbox
  • olFolderSentMail
  • olFolderInbox
  • olFolderCalendar
  • olFolderContacts
  • olFolderJournal
  • olFolderNotes
  • olFolderTasks
  • olFolderDrafts
Parameters:
mtpointer to the top level mapitest structure
obj_parentparent folder (usually the message store, must be opened)
obj_childthe folder that has been opened
olNumthe folder identifier (see list above)
Returns:
true on success, false on failure

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.

Parameters:
mem_ctxthe talloc memory context to create the blob in
lenthe length of the blob to create
Returns:
random blob of readable data, of length len bytes, with a null terminator.
Note:
the data is from 0..len, and the null terminator is at position len+1. So the returned array is actually len+1 bytes in total.

Referenced by mapitest_oxcprpt_CopyToStream(), mapitest_oxcprpt_Stream(), and mapitest_oxcprpt_WriteAndCommitStream().

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.

Parameters:
mtpointer to the top level mapitest structure
obj_folderthe folder to search through
subjectthe 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 
)
bool mapitest_common_setup ( struct mapitest mt,
mapi_object_t *  obj_htable,
uint32_t *  count 
)

Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/