From: Alistair Thomas Date: Tue, 22 Aug 2017 19:50:58 +0000 (+0100) Subject: tests: Fix test delegates/bug659778.vala X-Git-Tag: 0.37.91~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c78d70fc5c3bc7740be209261d40513954acad1f;p=thirdparty%2Fvala.git tests: Fix test delegates/bug659778.vala 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. https://bugzilla.gnome.org/show_bug.cgi?id=786652 --- diff --git a/tests/delegates/bug659778.vala b/tests/delegates/bug659778.vala index e73e3c1e4..79fa86eff 100644 --- a/tests/delegates/bug659778.vala +++ b/tests/delegates/bug659778.vala @@ -2,10 +2,10 @@ delegate G DoSomething(G g); void do_something (DoSomething f) {} -enum TE { +enum TestEnum { T; public void f() { - do_something ((x) => { + do_something ((x) => { switch (this) { case T: return T; @@ -15,7 +15,7 @@ enum TE { }); } public void g(int i) { - do_something ((x) => { + do_something ((x) => { switch (this) { case T: i++; @@ -29,11 +29,11 @@ enum TE { class Test { public void f() { - do_something (g); + do_something (g); do_something (h); } [CCode (instance_pos = -1)] - private TE g(TE i) { + private TestEnum g(TestEnum i) { return i; } [CCode (instance_pos = -1)] @@ -43,7 +43,7 @@ class Test { } int main() { - TE t = TE.T; + TestEnum t = TestEnum.T; t.f (); t.g (0); Test t2 = new Test ();