Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wireplumber
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
wireplumber
Commits
20da8a94
Commit
20da8a94
authored
4 years ago
by
George Kiagiadakis
Browse files
Options
Downloads
Patches
Plain Diff
tests: endpoint: re-enable the params unit test
parent
3d032cc2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/wp/endpoint.c
+200
-145
200 additions, 145 deletions
tests/wp/endpoint.c
with
200 additions
and
145 deletions
tests/wp/endpoint.c
+
200
−
145
View file @
20da8a94
...
...
@@ -268,15 +268,15 @@ test_endpoint_session_bound (WpObject * session, GAsyncResult * res,
g_main_loop_quit
(
fixture
->
base
.
loop
);
}
//
static void
//
test_endpoint_p
rop
_changed (WpP
roxy
* proxy,
//
const gchar * id_name
, TestEndpointFixture *fixture)
//
{
//
wp_debug_object (proxy, "p
rop
changed: %
s
", id
_name
);
static
void
test_endpoint_p
arams
_changed
(
WpP
ipewireObject
*
proxy
,
guint32
id
,
TestEndpointFixture
*
fixture
)
{
wp_debug_object
(
proxy
,
"p
arams
changed: %
u
"
,
id
);
//
if (++fixture->n_events == 3)
//
g_main_loop_quit (fixture->base.loop);
//
}
if
(
++
fixture
->
n_events
==
3
)
g_main_loop_quit
(
fixture
->
base
.
loop
);
}
static
void
test_endpoint_notify_properties
(
WpEndpoint
*
endpoint
,
GParamSpec
*
param
,
...
...
@@ -419,7 +419,6 @@ test_endpoint_no_props (TestEndpointFixture *fixture, gconstpointer data)
g_assert_null
(
fixture
->
proxy_endpoint
);
}
#if 0
static
void
test_endpoint_with_props
(
TestEndpointFixture
*
fixture
,
gconstpointer
data
)
{
...
...
@@ -459,12 +458,12 @@ test_endpoint_with_props (TestEndpointFixture *fixture, gconstpointer data)
/* create session */
session
=
wp_impl_session_new
(
fixture
->
base
.
core
);
wp_object_activate (WP_
PROXY
(session), WP_PROXY_FEATURE_BOUND, NULL,
wp_object_activate
(
WP_
OBJECT
(
session
),
WP_PROXY_FEATURE_BOUND
,
NULL
,
(
GAsyncReadyCallback
)
test_endpoint_session_bound
,
fixture
);
/* run until session is bound */
g_main_loop_run
(
fixture
->
base
.
loop
);
g_assert_cmpint (wp_object_get_active_features (WP_
PROXY
(session)), &,
g_assert_cmpint
(
wp_object_get_active_features
(
WP_
OBJECT
(
session
)),
&
,
WP_PROXY_FEATURE_BOUND
);
g_assert_cmpint
(
wp_proxy_get_bound_id
(
WP_PROXY
(
session
)),
>
,
0
);
...
...
@@ -482,12 +481,13 @@ test_endpoint_with_props (TestEndpointFixture *fixture, gconstpointer data)
"node.name"
,
"audiotestsrc.adapter"
,
NULL
));
g_assert_nonnull
(
endpoint
->
node
);
wp_object_activate (WP_PROXY (endpoint->node), WP_PROXY_FEATURES_STANDARD, NULL,
wp_object_activate
(
WP_OBJECT
(
endpoint
->
node
),
WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL
,
NULL
,
(
GAsyncReadyCallback
)
test_object_activate_finish_cb
,
fixture
);
g_main_loop_run
(
fixture
->
base
.
loop
);
g_assert_cmpint (wp_object_get_active_features (WP_
PROXY
(endpoint->node)),
==,
WP_PROXY
_FEATURES_
STANDARD
);
g_assert_cmpint
(
wp_object_get_active_features
(
WP_
OBJECT
(
endpoint
->
node
)),
==
,
WP_PIPEWIRE_OBJECT
_FEATURES_
MINIMAL
);
/* activate & export the endpoint */
wp_session_item_activate
(
WP_SESSION_ITEM
(
endpoint
),
...
...
@@ -505,43 +505,50 @@ test_endpoint_with_props (TestEndpointFixture *fixture, gconstpointer data)
g_assert_nonnull
(
fixture
->
proxy_endpoint
);
/* verify features; the endpoint must have also augmented the node */
g_assert_cmpint (wp_object_get_active_features (WP_PROXY (endpoint->node)), ==,
WP_PROXY_FEATURES_STANDARD | WP_PROXY_FEATURE_PROPS);
g_assert_cmphex (wp_object_get_active_features (fixture->proxy_endpoint), ==,
WP_PROXY_FEATURES_STANDARD | WP_PROXY_FEATURE_PROPS);
g_assert_cmpint
(
wp_object_get_active_features
(
WP_OBJECT
(
endpoint
->
node
)),
&
,
WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL
|
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROPS
);
g_assert_cmphex
(
wp_object_get_active_features
(
WP_OBJECT
(
fixture
->
proxy_endpoint
)),
&
,
WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL
|
WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROPS
);
/* verify props */
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->proxy_endpoint, "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
g_assert_cmpfloat_with_epsilon (float_value, 1.0f, 0.001);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->proxy_endpoint, "mute");
gboolean
boolean_value
=
TRUE
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
fixture
->
proxy_endpoint
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
1
.
0
f
,
0
.
001
);
g_assert_cmpint
(
boolean_value
,
==
,
FALSE
);
}
/* setup change signals */
g_signal_connect (fixture->proxy_endpoint, "p
rop
-changed",
(GCallback) test_endpoint_p
rop
_changed, fixture);
g_signal_connect (fixture->impl_endpoint, "p
rop
-changed",
(GCallback) test_endpoint_p
rop
_changed, fixture);
g_signal_connect (endpoint->node, "p
rop
-changed",
(GCallback) test_endpoint_p
rop
_changed, fixture);
g_signal_connect
(
fixture
->
proxy_endpoint
,
"p
arams
-changed"
,
(
GCallback
)
test_endpoint_p
arams
_changed
,
fixture
);
g_signal_connect
(
fixture
->
impl_endpoint
,
"p
arams
-changed"
,
(
GCallback
)
test_endpoint_p
arams
_changed
,
fixture
);
g_signal_connect
(
endpoint
->
node
,
"p
arams
-changed"
,
(
GCallback
)
test_endpoint_p
arams
_changed
,
fixture
);
/* change control on the proxy */
fixture
->
n_events
=
0
;
wp_proxy_set_prop (fixture->proxy_endpoint, "volume",
wp_spa_pod_new_float (0.7f));
wp_pipewire_object_set_param
(
WP_PIPEWIRE_OBJECT
(
fixture
->
proxy_endpoint
),
"Props"
,
0
,
wp_spa_pod_new_object
(
"Props"
,
"Props"
,
"volume"
,
"f"
,
0
.
7
f
,
NULL
));
/* run until the change is on all sides */
g_main_loop_run
(
fixture
->
base
.
loop
);
...
...
@@ -549,58 +556,75 @@ test_endpoint_with_props (TestEndpointFixture *fixture, gconstpointer data)
/* verify the value change on all sides */
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->proxy_endpoint, "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
g_assert_cmpfloat_with_epsilon (float_value, 0.7f, 0.001);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->proxy_endpoint, "mute");
gboolean
boolean_value
=
TRUE
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
fixture
->
proxy_endpoint
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
7
f
,
0
.
001
);
g_assert_cmpint
(
boolean_value
,
==
,
FALSE
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->impl_endpoint, "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
g_assert_cmpfloat_with_epsilon (float_value, 0.7f, 0.001);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->impl_endpoint, "mute");
gboolean
boolean_value
=
TRUE
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
fixture
->
impl_endpoint
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
7
f
,
0
.
001
);
g_assert_cmpint
(
boolean_value
,
==
,
FALSE
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (WP_PROXY (endpoint->node), "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
g_assert_cmpfloat_with_epsilon (float_value, 0.7f, 0.001);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (WP_PROXY (endpoint->node), "mute");
gboolean
boolean_value
=
TRUE
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
endpoint
->
node
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
7
f
,
0
.
001
);
g_assert_cmpint
(
boolean_value
,
==
,
FALSE
);
}
/* change control on the impl */
fixture
->
n_events
=
0
;
wp_proxy_set_prop (fixture->impl_endpoint, "mute",
wp_spa_pod_new_boolean (TRUE));
wp_pipewire_object_set_param
(
WP_PIPEWIRE_OBJECT
(
fixture
->
impl_endpoint
),
"Props"
,
0
,
wp_spa_pod_new_object
(
"Props"
,
"Props"
,
"mute"
,
"b"
,
TRUE
,
NULL
));
/* run until the change is on all sides */
g_main_loop_run
(
fixture
->
base
.
loop
);
...
...
@@ -608,58 +632,75 @@ test_endpoint_with_props (TestEndpointFixture *fixture, gconstpointer data)
/* verify the value change on all sides */
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->proxy_endpoint, "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
gboolean
boolean_value
=
TRUE
;
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
fixture
->
proxy_endpoint
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
7
f
,
0
.
001
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->proxy_endpoint, "mute");
gboolean boolean_value = FALSE;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
g_assert_cmpint
(
boolean_value
,
==
,
TRUE
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->impl_endpoint, "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
gboolean
boolean_value
=
TRUE
;
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
fixture
->
impl_endpoint
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
7
f
,
0
.
001
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->impl_endpoint, "mute");
gboolean boolean_value = FALSE;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
g_assert_cmpint
(
boolean_value
,
==
,
TRUE
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (WP_PROXY (endpoint->node), "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
gboolean
boolean_value
=
TRUE
;
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
endpoint
->
node
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
7
f
,
0
.
001
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (WP_PROXY (endpoint->node), "mute");
gboolean boolean_value = FALSE;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
g_assert_cmpint
(
boolean_value
,
==
,
TRUE
);
}
/* change control on the node */
fixture
->
n_events
=
0
;
wp_proxy_set_prop (WP_PROXY (endpoint->node), "volume",
wp_spa_pod_new_float (0.2f));
wp_pipewire_object_set_param
(
WP_PIPEWIRE_OBJECT
(
endpoint
->
node
),
"Props"
,
0
,
wp_spa_pod_new_object
(
"Props"
,
"Props"
,
"volume"
,
"f"
,
0
.
2
f
,
NULL
));
/* run until the change is on all sides */
g_main_loop_run
(
fixture
->
base
.
loop
);
...
...
@@ -667,51 +708,66 @@ test_endpoint_with_props (TestEndpointFixture *fixture, gconstpointer data)
/* verify the value change on all sides */
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->proxy_endpoint, "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
gboolean
boolean_value
=
TRUE
;
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
fixture
->
proxy_endpoint
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
2
f
,
0
.
001
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->proxy_endpoint, "mute");
gboolean boolean_value = FALSE;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
g_assert_cmpint
(
boolean_value
,
==
,
TRUE
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->impl_endpoint, "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
gboolean
boolean_value
=
TRUE
;
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
fixture
->
impl_endpoint
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
2
f
,
0
.
001
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (fixture->impl_endpoint, "mute");
gboolean boolean_value = FALSE;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
g_assert_cmpint
(
boolean_value
,
==
,
TRUE
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (WP_PROXY (endpoint->node), "volume");
g_autoptr
(
WpIterator
)
iterator
=
NULL
;
g_auto
(
GValue
)
item
=
G_VALUE_INIT
;
g_autoptr
(
WpSpaPod
)
pod
=
NULL
;
gfloat
float_value
=
0
.
0
f
;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_float (pod, &float_value));
gboolean
boolean_value
=
TRUE
;
iterator
=
wp_pipewire_object_enum_params_sync
(
WP_PIPEWIRE_OBJECT
(
endpoint
->
node
),
"Props"
,
NULL
);
g_assert_nonnull
(
iterator
);
g_assert_true
(
wp_iterator_next
(
iterator
,
&
item
));
g_assert_nonnull
((
pod
=
g_value_dup_boxed
(
&
item
)));
g_assert_true
(
wp_spa_pod_get_object
(
pod
,
"Props"
,
NULL
,
"volume"
,
"f"
,
&
float_value
,
"mute"
,
"b"
,
&
boolean_value
,
NULL
));
g_assert_cmpfloat_with_epsilon
(
float_value
,
0
.
2
f
,
0
.
001
);
}
{
g_autoptr (WpSpaPod) pod =
wp_proxy_get_prop (WP_PROXY (endpoint->node), "mute");
gboolean boolean_value = FALSE;
g_assert_nonnull (pod);
g_assert_true (wp_spa_pod_get_boolean (pod, &boolean_value));
g_assert_cmpint
(
boolean_value
,
==
,
TRUE
);
}
...
...
@@ -726,7 +782,6 @@ test_endpoint_with_props (TestEndpointFixture *fixture, gconstpointer data)
g_assert_null
(
fixture
->
impl_endpoint
);
g_assert_null
(
fixture
->
proxy_endpoint
);
}
#endif
gint
main
(
gint
argc
,
gchar
*
argv
[])
...
...
@@ -736,8 +791,8 @@ main (gint argc, gchar *argv[])
g_test_add
(
"/wp/endpoint/no-props"
,
TestEndpointFixture
,
NULL
,
test_endpoint_setup
,
test_endpoint_no_props
,
test_endpoint_teardown
);
//
g_test_add ("/wp/endpoint/with-props", TestEndpointFixture, NULL,
//
test_endpoint_setup, test_endpoint_with_props, test_endpoint_teardown);
g_test_add
(
"/wp/endpoint/with-props"
,
TestEndpointFixture
,
NULL
,
test_endpoint_setup
,
test_endpoint_with_props
,
test_endpoint_teardown
);
return
g_test_run
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment