Beispiel #1
0
 public static void init()
 {
     if (!st)
     {
         SprExport.Spr_set_se_translator(); st = true;
     }
     er = er ?? new ExceptionRaiser();
 }
Beispiel #2
0
        public static void Throw()
        {
            ExceptionRaiser exceptionBuilder1 = null;
            ExceptionRaiser exceptionBuilder2 = null;

            AaaSpec.When("the property is called two times", () =>
            {
                Act(() =>
                {
                    exceptionBuilder1 = Host.Throw;
                    exceptionBuilder2 = Host.Throw;
                });

                Should($"return the single instance of the {nameof(ExceptionRaiser)}", () =>
                {
                    Assert.That(exceptionBuilder1, Is.EqualTo(exceptionBuilder2));
                });
            });
        }
Beispiel #3
0
        static string brk = "n";        // set "y" if run under debugger

        static void Main(string[] args)
        {
            var dllDirectory = @"..\..\..\..\..\..\..\libs\bin\win64";
            var dllPath      = Environment.GetEnvironmentVariable("PATH") + ";" + dllDirectory;

            Environment.SetEnvironmentVariable("PATH", dllPath);

            ExceptionRaiser er = new ExceptionRaiser();

            try {
                if (inc.Equals("A"))
                {
                    inc = def;
                }
#if SprCSTest
                if (check_test("C"))
                {
                    test_constructor();
                }
#endif
                if (check_test("i"))
                {
                    test_intrinsic();
                }
                if (check_test("t"))
                {
                    test_tostring();
                }
                if (check_test("v"))
                {
                    test_vector();
                }
                if (check_test("a"))
                {
                    test_array();
                }
                if (check_test("c"))
                {
                    test_type_conv();
                }
                if (check_test("f"))
                {
                    test_func_args();
                }
                if (check_test("r"))
                {
                    test_func_return();
                }
                if (check_test("o"))
                {
                    test_operator();
                }
                if (check_test("F"))
                {
                    test_func_call();
                }
                if (check_test("s"))
                {
                    test_simulation();
                }
            }
            catch (System.Exception e) {
                System.Console.WriteLine(SEH_Exception.what(e));
            }
            CSlog.Print("Test End");
        }
Beispiel #4
0
        static string brk = "n";        // set "y" if run under debugger

        static void Main(string[] args)
        {
            ExceptionRaiser er = new ExceptionRaiser();

            try {
                if (inc.Equals("A"))
                {
                    inc = def;
                }
#if SprCSTest
                if (check_test("C"))
                {
                    test_constructor();
                }
#endif
                if (check_test("i"))
                {
                    test_intrinsic();
                }
                if (check_test("t"))
                {
                    test_tostring();
                }
                if (check_test("v"))
                {
                    test_vector();
                }
                if (check_test("a"))
                {
                    test_array();
                }
                if (check_test("c"))
                {
                    test_type_conv();
                }
                if (check_test("f"))
                {
                    test_func_args();
                }
                if (check_test("r"))
                {
                    test_func_return();
                }
                if (check_test("o"))
                {
                    test_operator();
                }
                if (check_test("F"))
                {
                    test_func_call();
                }
                if (check_test("s"))
                {
                    test_simulation();
                }
            }
            catch (System.Exception e) {
                System.Console.WriteLine(SEH_Exception.what(e));
            }
            CSlog.Print("Test End");
        }
Beispiel #5
0
 public static void init(ExceptionCallbackDelegate func)
 {
     ExceptionRaiser.SetCallback(func);
     init();
 }