mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
tests: Add inconsistent init/deinit test case
This commit is contained in:
parent
41597dfdfd
commit
12d8448cf8
3 changed files with 75 additions and 0 deletions
|
@ -55,6 +55,7 @@ check_PROGRAMS = \
|
|||
ges/project\
|
||||
ges/track\
|
||||
ges/tempochange \
|
||||
ges/negative\
|
||||
nle/simple \
|
||||
nle/complex \
|
||||
nle/nleoperation \
|
||||
|
|
73
tests/check/ges/negative.c
Normal file
73
tests/check/ges/negative.c
Normal file
|
@ -0,0 +1,73 @@
|
|||
/* GStreamer Editing Services
|
||||
* Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <ges/ges.h>
|
||||
#include <gst/check/gstcheck.h>
|
||||
#include <signal.h>
|
||||
|
||||
static void
|
||||
sigabrt_handler (int signum)
|
||||
{
|
||||
/* expected abort */
|
||||
exit (0);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
deinit_thread_func (gpointer user_data)
|
||||
{
|
||||
signal (SIGABRT, sigabrt_handler);
|
||||
ges_deinit ();
|
||||
|
||||
/* shouldn't be reached */
|
||||
exit (1);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GST_START_TEST (test_inconsistent_init_deinit_thread)
|
||||
{
|
||||
GThread *thread;
|
||||
|
||||
fail_unless (ges_init ());
|
||||
|
||||
/* test assertion, when trying to call ges_deinit() in a thread different
|
||||
* from that of ges_init() called.
|
||||
*/
|
||||
thread = g_thread_new ("test-ges-deinit-thread",
|
||||
(GThreadFunc) deinit_thread_func, NULL);
|
||||
|
||||
g_thread_join (thread);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
static Suite *
|
||||
ges_suite (void)
|
||||
{
|
||||
Suite *s = suite_create ("ges-negative");
|
||||
TCase *tc_chain = tcase_create ("negative");
|
||||
|
||||
suite_add_tcase (s, tc_chain);
|
||||
|
||||
tcase_add_test (tc_chain, test_inconsistent_init_deinit_thread);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
GST_CHECK_MAIN (ges);
|
|
@ -16,6 +16,7 @@ ges_tests = [
|
|||
['ges/project'],
|
||||
['ges/track'],
|
||||
['ges/tempochange'],
|
||||
['ges/negative'],
|
||||
['nle/simple'],
|
||||
['nle/complex'],
|
||||
['nle/nleoperation'],
|
||||
|
|
Loading…
Reference in a new issue