PipeWire: test/pwtest.h File Reference

PipeWire 0.3.61

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
pwtest.h File Reference
Test Suite

`pipewire/test/pwtest.h` More...

Go to the source code of this file.

## Data Structures
struct | pwtest_spa_plugin

## Macros
#define | pwtest_fail() _pwtest_fail_condition(PWTEST_FAIL, __FILE__, __LINE__, __func__, "aborting", "")
| Fail the current test. More...
#define | pwtest_fail_if_reached() _pwtest_fail_condition(PWTEST_FAIL, __FILE__, __LINE__, __func__, "This line is supposed to be unreachable", "")
| Same as above but more expressive in the code. More...
#define | pwtest_fail_with_msg(...)
| Fail the current test with the given message. More...
#define | pwtest_error_with_msg(...)
| Error out of the current test with the given message. More...
#define | pwtest_errno_ok(r_) pwtest_errno_check(r_, 0);
| Assert r is not -1 and if it is, print the errno. More...
#define | pwtest_errno(r_, errno_) pwtest_errno_check(r_, errno_);
| Assert r is -1 and the errno is the given one. More...
#define | pwtest_neg_errno_ok(r_) pwtest_neg_errno_check(r_, 0);
| Assert r is not < 0 and if it is assume it's a negative errno. More...
#define | pwtest_neg_errno(r_, errno_) pwtest_neg_errno_check(r_, errno_);
| Assert r is < 0 and the given negative errno. More...
#define | pwtest_bool_eq(a_, b_) pwtest_comparison_bool_(a_, ==, b_)
| Assert boolean (a == b) More...
#define | pwtest_bool_ne(a_, b_) pwtest_comparison_bool_(a_, !=, b_)
| Assert boolean (a != b) More...
#define | pwtest_bool_true(cond_) pwtest_comparison_bool_(cond_, ==, true)
| Assert cond to be true. More...
#define | pwtest_bool_false(cond_) pwtest_comparison_bool_(cond_, ==, false)
| Assert cond to be false. More...
#define | pwtest_int_eq(a_, b_) pwtest_comparison_int_(a_, ==, b_)
| Assert a == b More...
#define | pwtest_int_ne(a_, b_) pwtest_comparison_int_(a_, !=, b_)
| Assert a != b More...
#define | pwtest_int_lt(a_, b_) pwtest_comparison_int_(a_, <, b_)
| Assert a < b More...
#define | pwtest_int_le(a_, b_) pwtest_comparison_int_(a_, <=, b_)
| Assert a <= b More...
#define | pwtest_int_ge(a_, b_) pwtest_comparison_int_(a_, >=, b_)
| Assert a >= b More...
#define | pwtest_int_gt(a_, b_) pwtest_comparison_int_(a_, >, b_)
| Assert a > b More...
#define | pwtest_ptr_eq(a_, b_) pwtest_comparison_ptr_(a_, ==, b_)
| Assert ptr1 == ptr2 More...
#define | pwtest_ptr_ne(a_, b_) pwtest_comparison_ptr_(a_, !=, b_)
| Assert ptr1 != ptr2 More...
#define | pwtest_ptr_null(a_) pwtest_comparison_ptr_(a_, ==, NULL)
| Assert ptr == NULL More...
#define | pwtest_ptr_notnull(a_) pwtest_comparison_ptr_(a_, !=, NULL)
| Assert ptr != NULL More...
#define | pwtest_double_eq(a_, b_) pwtest_comparison_double_((a_), ==, (b_))
| Assert a == b for a (hardcoded) epsilon. More...
#define | pwtest_double_ne(a_, b_) pwtest_comparison_double_((a_), !=, (b_))
| Assert a != b for a (hardcoded) epsilon. More...
#define | pwtest_double_lt(a_, b_) pwtest_comparison_double_((a_), <, (b_))
| Assert a < b for a (hardcoded) epsilon. More...
#define | pwtest_double_le(a_, b_) pwtest_comparison_double_((a_), <=, (b_))
| Assert a <= b for a (hardcoded) epsilon. More...
#define | pwtest_double_ge(a_, b_) pwtest_comparison_double_((a_), >=, (b_))
| Assert a >= b for a (hardcoded) epsilon. More...
#define | pwtest_double_gt(a_, b_) pwtest_comparison_double_((a_), >, (b_))
| Assert a > b for a (hardcoded) epsilon. More...
#define | pwtest_int(a_, op_, b_) pwtest_comparison_int_(a_, op_, b_)
#define | pwtest_str_eq(a_, b_)
| Assert str1 is equal to str2. More...
#define | pwtest_str_eq_n(a_, b_, l_)
| Assert str1 is equal to str2 for l characters. More...
#define | pwtest_str_ne(a_, b_)
| Assert str1 is not equal to str2. More...
#define | pwtest_str_ne_n(a_, b_, l_)
| Assert str1 is not equal to str2 for l characters. More...
#define | pwtest_str_contains(haystack_, needle_)
| Assert haystack contains needle. More...
#define | pwtest_add(func_, ...) _pwtest_add(ctx, suite, #func_, func_, __VA_ARGS__, NULL)
| Add function func_ to the current test suite. More...
#define | PWTEST(tname) static enum pwtest_result tname(struct pwtest_test *current_test)
| Declare a test case. More...
#define | PWTEST_SUITE(cname)
| Initialize a test suite. More...
#define | PWTEST_PLUGIN_MAX 32

## Enumerations
enum | pwtest_result { PWTEST_PASS = 75 , PWTEST_FAIL = 76 , PWTEST_SKIP = 77 , PWTEST_TIMEOUT = 78 , PWTEST_SYSTEM_ERROR = 79 }
| Result returned from tests or suites. More...
enum | pwtest_arg { PWTEST_NOARG = 0 , PWTEST_ARG_SIGNAL , PWTEST_ARG_RANGE , PWTEST_ARG_PROP , PWTEST_ARG_ENV , PWTEST_ARG_DAEMON }

## Functions
int | pwtest_get_iteration (struct pwtest_test *t)
| If the test was added with a range (see PWTEST_ARG_RANGE), this function returns the current iteration within that range. More...
struct pw_properties * | pwtest_get_props (struct pwtest_test *t)
| If the test had properties set (see PWTEST_ARG_PROP), this function returns the Properties. More...
struct pwtest_context * | pwtest_get_context (struct pwtest_test *t)
struct pwtest_spa_plugin * | pwtest_spa_plugin_new (void)
void | pwtest_spa_plugin_destroy (struct pwtest_spa_plugin *plugin)
void * | pwtest_spa_plugin_load_interface (struct pwtest_spa_plugin *plugin, const char *libname, const char *factory_name, const char *interface_name, const struct spa_dict *info)
| Identical to pwtest_spa_plugin_try_load_interface() but returns the interface and fails if the interface is NULL. More...
int | pwtest_spa_plugin_try_load_interface (struct pwtest_spa_plugin *plugin, void **iface_return, const char *libname, const char *factory_name, const char *interface_name, const struct spa_dict *info)
| Load interface_name from the factory in libname. More...
void | pwtest_mkstemp (char path[PATH_MAX])
| Create a temporary file and copy its full path to path. More...
int | pwtest_spawn (const char *file, char *const argv[])
| Run a command and wait for it to return. More...

## Detailed Description

`pipewire/test/pwtest.h`

## Macro Definition Documentation

## ◆ PWTEST_PLUGIN_MAX

#define PWTEST_PLUGIN_MAX 32