gtk.cfg: Fix/enhance Gtk library configuration (g_abort and others) (#2558)

test/CMakeLists.txt: Fix missing INCONCLUSIVE for Gtk configuration test
This commit is contained in:
Sebastian 2020-02-27 13:16:43 +01:00 committed by GitHub
parent 4e5a8fac4a
commit f0e3f9e79a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 3 deletions

View File

@ -873,6 +873,10 @@
<function name="g_exit">
<noreturn>true</noreturn>
</function>
<!-- void g_abort (void) -->
<function name="g_abort">
<noreturn>true</noreturn>
</function>
<!-- gboolean g_hash_table_insert (GHashTable *hash_table, gpointer key, gpointer value); -->
<function name="g_hash_table_insert">
<noreturn>false</noreturn>
@ -5862,9 +5866,16 @@
<leak-ignore/>
<noreturn>false</noreturn>
</function>
<!-- void g_option_context_add_group (GOptionContext *context, GOptionGroup *group); -->
<function name="g_option_context_add_group">
<leak-ignore/>
<noreturn>false</noreturn>
<returnValue type="void"/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
</function>
<function name="g_option_context_add_main_entries">
<leak-ignore/>
@ -5906,9 +5917,16 @@
<leak-ignore/>
<noreturn>false</noreturn>
</function>
<!-- void g_option_context_set_main_group (GOptionContext *context, GOptionGroup *group); -->
<function name="g_option_context_set_main_group">
<leak-ignore/>
<noreturn>false</noreturn>
<returnValue type="void"/>
<arg nr="1">
<not-uninit/>
</arg>
<arg nr="2">
<not-uninit/>
</arg>
</function>
<function name="g_option_context_set_summary">
<leak-ignore/>

View File

@ -123,7 +123,7 @@ if (BUILD_TESTS)
add_cfg(bsd.c)
add_cfg(gnu.c LIBRARY posix gnu)
add_cfg(googletest.cpp)
add_cfg(gtk.c)
add_cfg(gtk.c INCONCLUSIVE)
add_cfg(libcurl.c)
add_cfg(lua.c)
add_cfg(openmp.c)

View File

@ -7,6 +7,7 @@
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
//
#include <stdlib.h>
#include <gtk/gtk.h>
#include <glib.h>
@ -421,3 +422,10 @@ void g_strchug_g_strchomp_test(gchar * str1)
// cppcheck-suppress uninitvar
g_strchomp(str3);
}
void g_abort_test()
{
g_abort();
//cppcheck-suppress unreachableCode
printf("Never reached");
}