module_oxcprpt.c File Reference

Property and Stream Object Protocol test suite. More...

Macros

#define NAMEDPROP_IDNUM   0xDB
 
#define NAMEDPROP_NAME   "mapitest_namedprop"
 

Functions

bool mapitest_oxcprpt_CopyProps (struct mapitest *mt)
 
bool mapitest_oxcprpt_CopyTo (struct mapitest *mt)
 
bool mapitest_oxcprpt_CopyToStream (struct mapitest *mt)
 
bool mapitest_oxcprpt_DeleteProps (struct mapitest *mt)
 
bool mapitest_oxcprpt_GetPropList (struct mapitest *mt)
 
bool mapitest_oxcprpt_GetProps (struct mapitest *mt)
 
bool mapitest_oxcprpt_GetPropsAll (struct mapitest *mt)
 
bool mapitest_oxcprpt_NameId (struct mapitest *mt)
 
bool mapitest_oxcprpt_NameId_PSMAPI (struct mapitest *mt)
 
bool mapitest_oxcprpt_NoReplicate (struct mapitest *mt)
 
bool mapitest_oxcprpt_SetProps (struct mapitest *mt)
 
bool mapitest_oxcprpt_Stream (struct mapitest *mt)
 
bool mapitest_oxcprpt_WriteAndCommitStream (struct mapitest *mt)
 

Detailed Description

Property and Stream Object Protocol test suite.

Macro Definition Documentation

#define NAMEDPROP_IDNUM   0xDB

Referenced by mapitest_oxcprpt_NameId().

#define NAMEDPROP_NAME   "mapitest_namedprop"

Referenced by mapitest_oxcprpt_NameId().

Function Documentation

bool mapitest_oxcprpt_CopyProps ( struct mapitest mt)

Test the CopyProps (0x67) operation

This function:

  1. Opens the mailbox
  2. Creates a test folder
  3. Creates a reference email, and sets some properties on it
  4. Checks those properties are set correctly
  5. Creates a second email, and sets some (different) properties on it
  6. Checks those properties on the second folder are set correctly
  7. Copies properties from the reference email to the second email (no overwrite)
  8. Checks that properties on both emails are correct
  9. Copies properties again, but with overwrite
  10. Checks that properties on both emails are correct
  11. Moves properties from the original email to the second email (no overwrite)
  12. Checks that properties on both emails are correct
  13. Deletes both emails and the test folder
Todo:
It would be useful to test the problem return values
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest::info, mapitest_common_message_create(), mapitest_print(), mapitest_print_retval_step(), mapitest_print_retval_step_fmt(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_CopyTo ( struct mapitest mt)

Test the CopyTo (0x39) operation

This function:

  1. Opens the mailbox
  2. Creates a test folder
  3. Creates a reference email, and sets some properties on it
  4. Checks those properties are set correctly
  5. Creates a second email, and sets some (different) properties on it
  6. Checks those properties on the second folder are set correctly
  7. Copies properties from the reference email to the second email (no overwrite)
  8. Checks that properties on both emails are correct
  9. Copies properties again, but with overwrite
  10. Checks that properties on both emails are correct
  11. Moves properties from the original email to the second email (no overwrite)
  12. Checks that properties on both emails are correct
  13. Creates an attachment (with properties) on the reference email
  14. Creates an attachment (with different properties) on the target email
  15. Copies the properties on the reference email to the target
  16. Checks the properties on both attachments are correct
  17. Creates another folder
  18. Copies properties from the test folder to the new folder
  19. Checks that the properties on both folders are correct
  20. Deletes both emails and the test folders
Todo:
It would be useful to test the problem return values
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise false

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

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_CopyToStream ( struct mapitest mt)

Test the CopyToStream (0x3a) operation

This function:

  1. Logon the mailbox
  2. Open the inbox folder
  3. Create a sample messages with an attachment
  4. Create 2 streams
  5. Fill the first stream with random data
  6. Seek stream positions to the beginning
  7. CopyToStream data from first stream to the second stream
  8. Read dst stream and compare with src stream
  9. Delete the message
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise false

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

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_DeleteProps ( struct mapitest mt)

Test the DeleteProps (0xb) operation)

This function:

  1. Opens the mailbox
  2. Create a test folder
  3. Creates a reference email, and sets some properties on it
  4. Delete properties from this message
  5. Checks that properties got deleted
  6. Deletes both email and the test folder
Todo:
It would be useful to test the problem return values
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest_common_message_create(), mapitest_print(), mapitest_print_retval_step(), mapitest_print_retval_step_fmt(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_GetPropList ( struct mapitest mt)

Test the GetPropList (0x9) operation

This function:

  1. Log on the user private mailbox
  2. Retrieve the list of properties associated to the store object object
Parameters
mtpointer on the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest_print_retval(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_GetProps ( struct mapitest mt)

Test the GetProps (0x7) operation

This function:

  1. Log on the user private mailbox
  2. Retrieve the properties list using GetPropList
  3. Retrieve their associated values using the GetProps operation
Parameters
mtpointer on the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest_print_retval(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_GetPropsAll ( struct mapitest mt)

Test the GetPropsAll (0x8) operation

This function:

  1. Log on the user private mailbox
  2. Retrieve the whole set of properties and values associated to the store object
Parameters
mtpointer on the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest_print_retval(), and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_NameId ( struct mapitest mt)

Test the GetPropertyIdsFromNames (0x56), GetNamesFromPropertyIds (0x55) and QueryNamesFromIDs (0x5f) operations

This function:

  1. Logs into the server
  2. Create a test folder and test message
  3. Creates one MNID_ID property
  4. Creates one MNID_STRING property
  5. Builds a table of Name, ID pairs using QueryNamesFromIDs()
  6. Iterates over names, and calls GetIDsFromNames() on each name
  7. Iterates over IDs, and calls GetNamesFromIDs() on each ID
  8. Cleans up
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest_common_message_create(), mapitest_print(), mapitest_print_retval(), mapitest_print_retval_fmt(), mapitest::mem_ctx, NAMEDPROP_IDNUM, NAMEDPROP_NAME, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_NameId_PSMAPI ( struct mapitest mt)

Test the GetPropertyIdsFromNames (0x56) and GetNamesFromPropertyIds (0x55) operations for the special case of the PS_MAPI namespace

This function:

  1. Logs into the server
  2. Gets a property ID for a known property name
  3. Gets a property name for a known property ID
  4. Cleans up

Refer to MS-OXPROPS for the list of properties

Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest_print(), mapitest_print_retval_clean(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_NoReplicate ( struct mapitest mt)

Test the SetPropertiesNoReplicate (0x79) and DeletePropertiesNoReplicate (0x7a) operations

This function:

  1. Opens the mailbox
  2. Create a test folder
  3. Sets some properties on the test folder
  4. Delete properties from the test folder
  5. Deletes the test folder
Todo:
It would be useful to test the problem return values
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest_print(), mapitest_print_retval_step(), mapitest_print_retval_step_fmt(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_SetProps ( struct mapitest mt)

Test the SetProps (0xa) operation

This function:

  1. Logon Private mailbox
  2. Use GetProps to retrieve the mailbox name
  3. Change it using SetProps
  4. Reset the mailbox name to its original value
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise false

References mapitest_print(), mapitest_print_retval_step_fmt(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_Stream ( struct mapitest mt)

Test Stream operations. This test uses related stream operations: OpenStream (0x2b), SetStreamSize (0x2f), WriteStream (0x2d), CommitStream (0x5d), ReadStream (0x2c), SeekStream (0x2e), LockRegionStream (0x5b), UnlockRegionStream (0x5c), CloneStream (0x3b)

This function:

  1. Logon
  2. Open Outbox folder
  3. Create message
  4. Create attachment and set properties
  5. Open the stream
  6. Set the stream size
  7. Write into the stream
  8. Commit the stream
  9. Save the message
  10. Get stream size and compare values
  11. Open the stream again with different permissions
  12. Read the stream and compare buffers
  13. SeekStream at 0x1000 from the end of the stream
  14. Read the 0x1000 last bytes and check if it matches
  15. Lock a range of the stream
  16. TODO: test if the locking works
  17. Unlock a range of the stream
  18. Clone the stream
  19. Delete the message;
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise -1

References mapitest::info, mapitest_common_genblob(), mapitest_common_message_create(), mapitest_print(), mapitest_print_retval(), mapitest_print_retval_fmt(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().

bool mapitest_oxcprpt_WriteAndCommitStream ( struct mapitest mt)

Test WriteAndCommitStream (0x90) operation.

This function:

  1. Logs in
  2. Opens the Outbox folder
  3. Creates a test message
  4. Creates an attachment on the test messages and set properties on the attachment
  5. Opens a stream on the attachment
  6. Sets the stream size
  7. Write and commits into the stream
  8. Saves the message
  9. Gets stream size and compare values
  10. Opens the stream again with different permissions
  11. Reads the stream and compares buffers
  12. Deletes the test message
Parameters
mtpointer to the top-level mapitest structure
Returns
true on success, otherwise -1

References mapitest_common_genblob(), mapitest_common_message_create(), mapitest_print(), mapitest_print_retval(), mapitest_print_retval_clean(), mapitest_print_retval_fmt_clean(), mapitest::mem_ctx, and mapitest::session.

Referenced by module_oxcprpt_init().


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/