summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/Errors.cs
blob: 6c9b21731367597b59a88104e4a7694df0d584cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;

namespace TestSuite
{

class TestEinaError
{
    public static void basic_test()
    {
        eina.Error.Clear();
        Test.AssertNotRaises<efl.EflException>(eina.Error.RaiseIfOcurred);
        eina.Error.Set(eina.Error.ENOENT);
        Test.AssertRaises<efl.EflException>(eina.Error.RaiseIfOcurred);
    }
}

class TestEolianError
{

    public static void global_eina_error()
    {
        test.Testing obj = new test.TestingConcrete();
        Test.AssertRaises<efl.EflException>(() => obj.raises_eina_error());
    }

    class Child : test.TestingInherit {
    }

    public static void global_eina_error_inherited()
    {
        test.Testing obj = new Child();
        Test.AssertRaises<efl.EflException>(() => obj.raises_eina_error());
    }

    class CustomException : Exception {
        public CustomException(string msg): base(msg) {}
    }

    class Overrider : test.TestingInherit {
        public override void children_raise_error() {
            throw (new CustomException("Children error"));
        }
    }

    public static void exception_raised_from_inherited_virtual()
    {
        test.Testing obj = new Overrider();

        Test.AssertRaises<efl.EflException>(obj.call_children_raise_error);
    }

    // return eina_error
    // events
    // virtual callbacks
}
}