After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786652 - Fix test case delegates/bug659778.vala
Fix test case delegates/bug659778.vala
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-22 20:38 UTC by Al Thomas
Modified: 2017-08-23 06:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change identifier for enum to be greater than two characters (1.35 KB, patch)
2017-08-22 20:38 UTC, Al Thomas
none Details | Review
Correct type name to GLib convention (1.34 KB, patch)
2017-08-22 21:33 UTC, Al Thomas
committed Details | Review

Description Al Thomas 2017-08-22 20:38:18 UTC
Created attachment 358181 [details] [review]
Change identifier for enum to be greater than two characters

GObject type names must be atleast three characters long (https://developer.gnome.org/gobject/stable/gtype-conventions.html). The test for delegates/bug659778.vala uses an enum name of TE, which is too short and when compiled produces the runtime errors:

GLib-GObject-WARNING **: type name 'TE' is too short
GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

and the test program does not terminate.

This has been hidden by the current test framework, testrunner.sh, because that script adds a namespace around each test. With this test, testrunner.sh, takes the original test code and creates a new Vala program called delegates.bug659778.vala. The script has added namespace delegates.bug659778 {} around the original code. This means TE is now longer than the three or more characters required. This is, however, a bad practise and has come to light in both the valadate branch and with someone attempting to use CMake for building Vala.

This patch corrects the short name in the test so any future Vala test framework will not encounter a problem with this particular test.
Comment 1 Rico Tzschichholz 2017-08-22 21:09:51 UTC
Better use a camel-cased name for the enum as usual.
Comment 2 Al Thomas 2017-08-22 21:33:01 UTC
Created attachment 358182 [details] [review]
Correct type name to GLib convention