MAPITests 2.0 API Documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

Functions
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

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

Parameters

  mt | pointer to the top-level mapitest structure

References mapitest_print().

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.

Parameters

  mt | pointer to the mapitest context

References mapitest_common_message_create(), mapitest_print(), mapitest_print_retval(), and mapitest::mem_ctx.

Referenced by mapitest_common_setup().

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

  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)

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_ctx | the talloc memory context to create the blob in
  len | the 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

  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_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.

Parameters

  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

Returns
  true on success, otherwise false

References mapitest_common_create_filled_test_folder(), mapitest_common_folder_open(), mapitest_print_retval(), and mapitest::mem_ctx.

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/