test-utils

test-utils — Utility routines for libexchange test programs

Synopsis




void        test_main                       (int argc,
                                             char **argv);
void        test_quit                       (void);
void        test_abort_if_http_error        (E2kHTTPStatus status);

const char* test_get_password               (const char *user,
                                             const char *host);
E2kContext* test_get_context                (const char *uri);
E2kGlobalCatalog* test_get_gc               (const char *server);

Description

Details

test_main ()

void        test_main                       (int argc,
                                             char **argv);

test-utils.o includes a main() function that calls various initialization routines, starts the main loop, and then calls test_main(). So test_main() is the entry point for a test-utils-using program.

argc : argc
argv : argv

test_quit ()

void        test_quit                       (void);

Cleanly quits a test program.


test_abort_if_http_error ()

void        test_abort_if_http_error        (E2kHTTPStatus status);

Checks if status is an HTTP or libsoup error, and if so, prints the error message and exits.

status : an HTTP status code

test_get_password ()

const char* test_get_password               (const char *user,
                                             const char *host);

Tries to get a password for user on host, by looking it up in the Evolution password database or by prompting the user.

user : username to get the password for
host : Exchange (or global catalog) server name
Returns : the password, or NULL if it could not be determined.

test_get_context ()

E2kContext* test_get_context                (const char *uri);

Creates an E2kContext based on uri. If uri does not contain a username, the user's local username will be used. If it does not contain a password, test_get_password() will be called to get one.

uri : an Exchange HTTP/HTTPS URI
Returns : the new E2kContext (always; if an error occurs, test_get_context() will exit the program).

test_get_gc ()

E2kGlobalCatalog* test_get_gc               (const char *server);

Creates an E2kGlobalCatalog for the server server. test_get_password() will be called to get a password.

server : the global catalog server to contact
Returns : the new E2kGlobalCatalog (always; if an error occurs, test_get_gc() will exit the program).