Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-good
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-good
Commits
14305e4f
Commit
14305e4f
authored
May 14, 2010
by
Tim-Philipp Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: fix leak in souphttpsrc unit test
Unref server objects when done. Fixes check-valgrind.
parent
035aead2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
tests/check/elements/souphttpsrc.c
tests/check/elements/souphttpsrc.c
+20
-2
No files found.
tests/check/elements/souphttpsrc.c
View file @
14305e4f
...
...
@@ -52,7 +52,7 @@ static const char *basic_auth_path = "/basic_auth";
static
const
char
*
digest_auth_path
=
"/digest_auth"
;
static
int
run_server
(
guint
*
http_port
,
guint
*
https_port
);
static
void
stop_server
(
void
);
static
void
handoff_cb
(
GstElement
*
fakesink
,
GstBuffer
*
buf
,
GstPad
*
pad
,
...
...
@@ -451,6 +451,7 @@ souphttpsrc_suite (void)
suite_add_tcase
(
s
,
tc_chain
);
run_server
(
&
http_port
,
&
https_port
);
g_atexit
(
stop_server
);
tcase_add_test
(
tc_chain
,
test_first_buffer_has_offset
);
tcase_add_test
(
tc_chain
,
test_redirect_yes
);
tcase_add_test
(
tc_chain
,
test_redirect_no
);
...
...
@@ -559,10 +560,12 @@ server_callback (SoupServer * server, SoupMessage * msg,
GST_DEBUG
(
" -> %d %s"
,
msg
->
status_code
,
msg
->
reason_phrase
);
}
static
SoupServer
*
server
;
/* NULL */
static
SoupServer
*
ssl_server
;
/* NULL */
int
run_server
(
guint
*
http_port
,
guint
*
https_port
)
{
SoupServer
*
server
,
*
ssl_server
;
guint
port
=
SOUP_ADDRESS_ANY_PORT
;
guint
ssl_port
=
SOUP_ADDRESS_ANY_PORT
;
const
char
*
ssl_cert_file
=
GST_TEST_FILES_PATH
"/test-cert.pem"
;
...
...
@@ -614,3 +617,18 @@ run_server (guint * http_port, guint * https_port)
return
0
;
}
static
void
stop_server
(
void
)
{
GST_INFO
(
"cleaning up"
);
if
(
server
)
{
g_object_unref
(
server
);
server
=
NULL
;
}
if
(
ssl_server
)
{
g_object_unref
(
ssl_server
);
ssl_server
=
NULL
;
}
}
Write
Preview
Markdown
is supported
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