MAPITests 2.0 API Documentation

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

Functions
mapitest_suite.c File Reference

mapitest test suite functions More...

## Functions
void | mapitest_run_all (struct mapitest *mt)
bool | mapitest_run_test (struct mapitest *mt, const char *name)
uint32_t | mapitest_suite_add_test (struct mapitest_suite *suite, const char *name, const char *description, bool(*run)(struct mapitest *test))
uint32_t | mapitest_suite_add_test_flagged (struct mapitest_suite *suite, const char *name, const char *description, bool(*run)(struct mapitest *test), enum TestApplicabilityFlags applicability)
struct mapitest_suite * | mapitest_suite_find (struct mapitest *mt, const char *name)
struct mapitest_suite * | mapitest_suite_init (struct mapitest *mt, const char *name, const char *description, bool online)
uint32_t | mapitest_suite_register (struct mapitest *mt, struct mapitest_suite *suite)
bool | mapitest_suite_run_test (struct mapitest *mt, struct mapitest_suite *suite, const char *name)

## Detailed Description

mapitest test suite functions

## Function Documentation

void mapitest_run_all | ( | struct mapitest * | mt | ) |

all tests from all suites

Parameters

  mt | the top-level mapitest structure

Returns
  true on success, otherwise -1

References mapitest::mapi_suite, mapitest_print_module_title_end(), mapitest_print_module_title_start(), mapitest_suite::name, mapitest_suite::next, mapitest_suite::online, and mapitest::online.

Referenced by main().

bool mapitest_run_test | ( | struct mapitest * | mt,
|  | const char * | name
| ) |  |

run a specific test from a particular suite

Parameters

  mt | the top-level mapitest structure
  name | the mapitest test name

Returns
  true on success, otherwise -1

References mapitest::mapi_suite, mapitest_suite_run_test(), mapitest_test::name, mapitest_test::next, mapitest_suite::next, mapitest_suite::online, mapitest::online, and mapitest_suite::tests.

Referenced by main().

uint32_t mapitest_suite_add_test | ( | struct mapitest_suite * | suite,
|  | const char * | name,
|  | const char * | description,
|  | bool(*)(struct mapitest *test) | run
| ) |  |

add a test to the mapitest suite with description

Parameters

  suite | pointer on the parent suite
  name | the test name
  description | the test description
  run | the test function

Returns
  MAPITEST_SUCCESS on success, otherwise MAPITEST_ERROR

See Also
  mapitest_suite_init, mapitest_suite_register
  mapitest_suite_add_test_flagged for an alternative function allowing the test to only be run under some conditions.

References ApplicableToAllVersions, and mapitest_suite_add_test_flagged().

uint32_t mapitest_suite_add_test_flagged | ( | struct mapitest_suite * | suite,
|  | const char * | name,
|  | const char * | description,
|  | bool(*)(struct mapitest *test) | run,
|  | enum TestApplicabilityFlags | applicability
| ) |  |

add a test to the mapitest suite with description and flags

This is very similar to mapitest_suite_add_test(), except it allows a test to have special applicability (e.g. to only run when a particular server configuration is available).

Parameters

  suite | pointer to the parent test suite
  name | the test name
  description | the test description
  run | the test function
  applicability | a set of applicability flags

Returns
  MAPITEST_SUCCESS on success, otherwise MAPITEST_ERROR

See Also
  mapitest_suite_init, mapitest_suite_register, mapitest_suite_add_test

References mapitest_test::description, mapitest_test::flags, mapitest_test::fn, mapitest_test::name, mapitest_suite::name, mapitest_test::next, and mapitest_suite::tests.

Referenced by mapitest_suite_add_test().

struct mapitest_suite* mapitest_suite_find | ( | struct mapitest * | mt,
|  | const char * | name
| ) |  |
| read

Find a suite given its name

Parameters

  mt | top-level mapitest structure
  name | the suite name to be searched

Returns
  Pointer on a suite on success, otherwise NULL

References mapitest::mapi_suite, mapitest_suite::name, and mapitest_suite::next.

struct mapitest_suite* mapitest_suite_init | ( | struct mapitest * | mt,
|  | const char * | name,
|  | const char * | description,
|  | bool | online
| ) |  |
| read

Initialize a mapitest suite

Parameters

  mt | the top-level mapitest structure
  name | the suite name
  description | the suite description
  online | whether this suite requires online (server) access

Returns
  An allocated mapitest_suite pointer, otherwise NULL.

References mapitest_suite::description, mapitest_stat_init(), mapitest::mem_ctx, mapitest_suite::name, mapitest_suite::online, mapitest_suite::stat, and mapitest_suite::tests.

uint32_t mapitest_suite_register | ( | struct mapitest * | mt,
|  | struct mapitest_suite * | suite
| ) |  |

Register a mapitest suite

Parameters

  mt | the top-level mapitest structure
  suite | the mapitest suite we want to add

Returns
  MAPITEST_SUCCESS on success, otherwise MAPITEST_ERROR

See Also
  mapitest_suite_init

References mapitest::mapi_suite, mapitest::mem_ctx, mapitest_suite::name, and mapitest_suite::next.

bool mapitest_suite_run_test | ( | struct mapitest * | mt,
|  | struct mapitest_suite * | suite,
|  | const char * | name
| ) |  |

run a test from a suite given its name

Parameters

  mt | pointer on the top-level mapitest structure
  suite | pointer on the mapitest suite
  name | the name of the test to be run

Returns
  true on success, otherwise false

References mapitest_test::name, mapitest_test::next, and mapitest_suite::tests.

Referenced by mapitest_run_test().

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