bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=66824da950c044bec80060ab33ec58e1bed03b60
commit 66824da950c044bec80060ab33ec58e1bed03b60 Author: Marcel Hollerbach <m...@marcel-hollerbach.de> Date: Mon Jan 7 18:31:54 2019 +0100 efl_mono: move Eina.Error.Init() to a static constructor this removes the need for the calling a Init function. Reviewed-by: Felipe Magno de Almeida <fel...@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D7556 --- src/bindings/mono/eina_mono/eina_config.cs | 3 --- src/bindings/mono/eina_mono/eina_error.cs | 2 +- src/tests/efl_mono/Errors.cs | 4 ++++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bindings/mono/eina_mono/eina_config.cs b/src/bindings/mono/eina_mono/eina_config.cs index 87cedaf8d9..ee0bb5bd0e 100644 --- a/src/bindings/mono/eina_mono/eina_config.cs +++ b/src/bindings/mono/eina_mono/eina_config.cs @@ -12,9 +12,6 @@ public class Config { public static void Init() { if (eina_init() == 0) throw (new Efl.EflException("Failed to initialize Eina")); - - // Initialize the submodules here - Eina.Error.Init(); } public static int Shutdown() { diff --git a/src/bindings/mono/eina_mono/eina_error.cs b/src/bindings/mono/eina_mono/eina_error.cs index c2027aea04..07760fd395 100644 --- a/src/bindings/mono/eina_mono/eina_error.cs +++ b/src/bindings/mono/eina_mono/eina_error.cs @@ -39,7 +39,7 @@ public struct Error : IComparable<Error> return "Eina.Error(" + code + ")"; } - internal static void Init() + static Error() { UNHANDLED_EXCEPTION = eina_error_msg_register("Unhandled C# exception occurred."); } diff --git a/src/tests/efl_mono/Errors.cs b/src/tests/efl_mono/Errors.cs index 36b119025e..802ac337c0 100644 --- a/src/tests/efl_mono/Errors.cs +++ b/src/tests/efl_mono/Errors.cs @@ -5,6 +5,10 @@ namespace TestSuite class TestEinaError { + public static void basic_efl_error_available() + { + Test.AssertEquals(Eina.Error.UNHANDLED_EXCEPTION.Message, "Unhandled C# exception occurred."); + } public static void basic_test() { Eina.Error.Clear(); --