X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/7200c42b4183887f9952871909446352a984170a..edbed51570922b674286769255e3ac2b949e1ba7:/tests/general.at diff --git a/tests/general.at b/tests/general.at index 624af5a..49fd6a2 100644 --- a/tests/general.at +++ b/tests/general.at @@ -1,4 +1,4 @@ -dnl Copyright © 2019-2021 Nick Bowler +dnl Copyright © 2019-2022 Nick Bowler dnl License GPLv2+: GNU General Public License version 2 or any later version. dnl This is free software: you are free to change and redistribute it. dnl There is NO WARRANTY, to the extent permitted by law. @@ -27,17 +27,18 @@ AT_DATA([main.c], int main(void) { - g_type_init (); - - int the_answer = 42; + Str *test_good, *test_bad; char *stupid_pointer = "ug"; + int the_answer = 42; + + g_type_init (); /* This works fine. */ - Str *test_good = (Str *) (str_new ("%d", the_answer)); + test_good = (Str *) (str_new ("%d", the_answer)); test_good = test_good; /* This gets a warning thanks to our function attribute. */ - Str *test_bad = (Str *) (str_new ("%d", stupid_pointer)); + test_bad = (Str *) (str_new ("%d", stupid_pointer)); test_bad = test_bad; return 0; @@ -51,19 +52,19 @@ TEST_COMPILE_GOBJECT([str.c], [0], [], [stderr]) mv stderr str_stderr # Check for correct diagnostic messages on the target lines... -AT_CHECK([awk '/want a string/ { print NR }' "$str_gob" >str_lines]) +AT_CHECK([$AWK '/want a string/ { print NR }' "$str_gob" >str_lines]) total=0 exec 3 int main(void) { - GObject *go = g_object_new(test_get_type(), NULL); + GObject *go; + + g_type_init(); + go = g_object_new(test_get_type(), NULL); printf("%d\n", test_get_x(go)); printf("%d\n", (test_set_x(go, 123), test_get_x(go))); @@ -280,6 +287,7 @@ int main(void) { GObject *go; + g_type_init(); g_type_module_use(g_object_new(test_mod_get_type(), NULL)); go = g_object_new(test_get_type(), NULL);