From d745dcc0eb45e4a20d6c1748ff72452368cdd535 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 25 Jun 2019 19:19:10 +0200 Subject: [PATCH] gtk.cfg: Add g_error_*() functions (#1922) --- cfg/gtk.cfg | 75 ++++++++++++++++++++++++++++++++++++++++++++++++-- test/cfg/gtk.c | 19 +++++++++++++ 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/cfg/gtk.cfg b/cfg/gtk.cfg index e2fe36394..d9173308a 100644 --- a/cfg/gtk.cfg +++ b/cfg/gtk.cfg @@ -3928,9 +3928,80 @@ false - - + + false + + + + + + + + + false + + + + + + + + false + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + diff --git a/test/cfg/gtk.c b/test/cfg/gtk.c index 295d8ed61..78cfc3716 100644 --- a/test/cfg/gtk.c +++ b/test/cfg/gtk.c @@ -50,6 +50,9 @@ void validCode(int argInt) gchar * pGchar1 = g_strconcat("a", "b", NULL); printf("%s", pGchar1); g_free(pGchar1); + + GError * pGerror = g_error_new(1, -2, "a %d", 1); + g_error_free(pGerror); } void g_malloc_test() @@ -121,3 +124,19 @@ void g_try_new0_test() printf("%p", pNew2); // cppcheck-suppress memleak } + +void g_error_new_test() +{ + // valid + GError * pNew1 = g_error_new(1, -2, "a %d", 1); + printf("%p", pNew1); + g_error_free(pNew1); + + // cppcheck-suppress ignoredReturnValue + // cppcheck-suppress leakReturnValNotUsed + g_error_new(1, -2, "a %d", 1); + + GError * pNew2 = g_error_new(1, -2, "a %d", 1); + printf("%p", pNew2); + // cppcheck-suppress memleak +}