Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julian Bouzas
WirePlumber
Commits
7f83bcfc
Commit
7f83bcfc
authored
Apr 28, 2021
by
George Kiagiadakis
Committed by
Julian Bouzas
May 13, 2021
Browse files
tests: proxy: add a test for enum_params errors
parent
63239bdf
Pipeline
#318693
passed with stages
in 1 minute
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/wp/proxy.c
View file @
7f83bcfc
...
...
@@ -230,6 +230,53 @@ test_link_error (TestFixture *f, gconstpointer data)
g_main_loop_run
(
f
->
base
.
loop
);
}
static
void
enum_params_error_cb
(
WpPipewireObject
*
object
,
GAsyncResult
*
res
,
WpBaseTestFixture
*
f
)
{
g_autoptr
(
GError
)
error
=
NULL
;
g_autoptr
(
WpIterator
)
it
=
wp_pipewire_object_enum_params_finish
(
object
,
res
,
&
error
);
g_assert_error
(
error
,
WP_DOMAIN_LIBRARY
,
WP_LIBRARY_ERROR_OPERATION_FAILED
);
g_assert_null
(
it
);
g_main_loop_quit
(
f
->
loop
);
}
static
void
test_enum_params_error
(
TestFixture
*
f
,
gconstpointer
data
)
{
g_autoptr
(
WpNode
)
node
=
NULL
;
/* load audiotestsrc on the server side */
{
g_autoptr
(
WpTestServerLocker
)
lock
=
wp_test_server_locker_new
(
&
f
->
base
.
server
);
g_assert_cmpint
(
pw_context_add_spa_lib
(
f
->
base
.
server
.
context
,
"fake*"
,
"test/libspa-test"
),
==
,
0
);
g_assert_nonnull
(
pw_context_load_module
(
f
->
base
.
server
.
context
,
"libpipewire-module-spa-node-factory"
,
NULL
,
NULL
));
}
node
=
wp_node_new_from_factory
(
f
->
base
.
core
,
"spa-node-factory"
,
wp_properties_new
(
"factory.name"
,
"fakesink"
,
"node.name"
,
"Fakesink"
,
NULL
));
g_assert_nonnull
(
node
);
wp_object_activate
(
WP_OBJECT
(
node
),
WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL
,
NULL
,
(
GAsyncReadyCallback
)
test_object_activate_finish_cb
,
f
);
g_main_loop_run
(
f
->
base
.
loop
);
/* EnumRoute doesn't exist on fakesink, obviously */
wp_pipewire_object_enum_params
(
WP_PIPEWIRE_OBJECT
(
node
),
"EnumRoute"
,
NULL
,
NULL
,
(
GAsyncReadyCallback
)
enum_params_error_cb
,
f
);
g_main_loop_run
(
f
->
base
.
loop
);
}
gint
main
(
gint
argc
,
gchar
*
argv
[])
{
...
...
@@ -242,6 +289,8 @@ main (gint argc, gchar *argv[])
test_proxy_setup
,
test_node
,
test_proxy_teardown
);
g_test_add
(
"/wp/proxy/link_error"
,
TestFixture
,
NULL
,
test_proxy_setup
,
test_link_error
,
test_proxy_teardown
);
g_test_add
(
"/wp/proxy/enum_params_error"
,
TestFixture
,
NULL
,
test_proxy_setup
,
test_enum_params_error
,
test_proxy_teardown
);
return
g_test_run
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment