[vala/0.36: 45/212] tests: Fix test delegates/bug659778.vala



commit de11702874db9d3075ab89d29773e90bb6c8b37e
Author: Alistair Thomas <astavale yahoo co uk>
Date:   Tue Aug 22 20:50:58 2017 +0100

    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

 tests/delegates/bug659778.vala |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/tests/delegates/bug659778.vala b/tests/delegates/bug659778.vala
index e73e3c1..79fa86e 100644
--- a/tests/delegates/bug659778.vala
+++ b/tests/delegates/bug659778.vala
@@ -2,10 +2,10 @@ delegate G DoSomething<G>(G g);
 
 void do_something<G> (DoSomething<G> f) {}
 
-enum TE {
+enum TestEnum {
        T;
        public void f() {
-               do_something<TE> ((x) => {
+               do_something<TestEnum> ((x) => {
                        switch (this) {
                        case T:
                                return T;
@@ -15,7 +15,7 @@ enum TE {
         });
        }
        public void g(int i) {
-               do_something<TE> ((x) => {
+               do_something<TestEnum> ((x) => {
                        switch (this) {
                        case T:
                                i++;
@@ -29,11 +29,11 @@ enum TE {
 
 class Test {
        public void f() {
-               do_something<TE> (g);
+               do_something<TestEnum> (g);
                do_something<int> (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 ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]