[wasm] Fix debugger tests source format (#40725)
authorThays Grazia <thaystg@gmail.com>
Wed, 12 Aug 2020 18:55:11 +0000 (15:55 -0300)
committerGitHub <noreply@github.com>
Wed, 12 Aug 2020 18:55:11 +0000 (15:55 -0300)
* Fix format using dotnet format tool

* Fix wasm debugger source format using dotnet-format tool.

17 files changed:
src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/CallFunctionOnTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/DelegateTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/PointerTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/Support.cs
src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs
src/mono/wasm/debugger/tests/debugger-array-test.cs
src/mono/wasm/debugger/tests/debugger-cfo-test.cs
src/mono/wasm/debugger/tests/debugger-datetime-test.cs
src/mono/wasm/debugger/tests/debugger-evaluate-test.cs
src/mono/wasm/debugger/tests/debugger-exception-test.cs
src/mono/wasm/debugger/tests/debugger-pointers-test.cs
src/mono/wasm/debugger/tests/debugger-test.cs
src/mono/wasm/debugger/tests/debugger-test2.cs
src/mono/wasm/debugger/tests/debugger-valuetypes-test.cs
src/mono/wasm/debugger/tests/dependency.cs

index 343b3be..6e5e4a9 100644 (file)
@@ -614,14 +614,14 @@ namespace DebuggerTests
                var c_obj_id = c_obj["value"]?["objectId"]?.Value<string>();
                Assert.NotNull(c_obj_id);
 
-                // Invalid format
-                await GetProperties("dotnet:array:4123", expect_ok: false);
+               // Invalid format
+               await GetProperties("dotnet:array:4123", expect_ok: false);
 
-                // Invalid object id
-                await GetProperties("dotnet:array:{ \"arrayId\": 234980 }", expect_ok: false);
+               // Invalid object id
+               await GetProperties("dotnet:array:{ \"arrayId\": 234980 }", expect_ok: false);
 
-                // Trying to access object as an array
-                if (!DotnetObjectId.TryParse(c_obj_id, out var id) || id.Scheme != "object")
+               // Trying to access object as an array
+               if (!DotnetObjectId.TryParse(c_obj_id, out var id) || id.Scheme != "object")
                    Assert.True(false, "Unexpected object id format. Maybe this test is out of sync with the object id format in library_mono.js?");
 
                if (!int.TryParse(id.Value, out var idNum))
@@ -653,8 +653,8 @@ namespace DebuggerTests
                Assert.True(id_args["arrayId"] != null, "ObjectId format for array seems to have changed. Expected to find 'arrayId' in the value. Update this test");
                Assert.True(id_args != null, "Expected to get a json as the value part of {id}");
 
-                // Try one valid query, to confirm that the id format hasn't changed!
-                id_args["arrayIdx"] = 0;
+               // Try one valid query, to confirm that the id format hasn't changed!
+               id_args["arrayIdx"] = 0;
                await GetProperties($"dotnet:valuetype:{id_args.ToString(Newtonsoft.Json.Formatting.None)}", expect_ok: true);
 
                id_args["arrayIdx"] = 12399;
@@ -685,8 +685,8 @@ namespace DebuggerTests
                var invalid_accessors = new object[] { "NonExistant", "10000", "-2", 10000, -2, null, String.Empty };
                foreach (var invalid_accessor in invalid_accessors)
                {
-                    // var res = await InvokeGetter (JObject.FromObject (new { value = new { objectId = obj_id } }), invalid_accessor, expect_ok: true);
-                    var res = await InvokeGetter(pf_arr, invalid_accessor, expect_ok: true);
+                   // var res = await InvokeGetter (JObject.FromObject (new { value = new { objectId = obj_id } }), invalid_accessor, expect_ok: true);
+                   var res = await InvokeGetter(pf_arr, invalid_accessor, expect_ok: true);
                    AssertEqual("undefined", res.Value["result"]?["type"]?.ToString(), "Expected to get undefined result for non-existant accessor");
                }
            });
index a655851..d616910 100644 (file)
@@ -41,9 +41,9 @@ namespace DebuggerTests
                    else
                        AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
 
-                    // Check for a __proto__ object
-                    // isOwn = true, accessorPropertiesOnly = false
-                    var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+                   // Check for a __proto__ object
+                   // isOwn = true, accessorPropertiesOnly = false
+                   var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                    {
                        objectId = result.Value["result"]["objectId"].Value<string>(),
                        accessorPropertiesOnly = false,
@@ -53,8 +53,8 @@ namespace DebuggerTests
                    await CheckProps(obj_own.Value["result"], new
                    {
                        length = TNumber(len),
-                        // __proto__ = TArray (type, 0) // Is this one really required?
-                    }, $"obj_own", num_fields: is_js ? 2 : 1);
+                       // __proto__ = TArray (type, 0) // Is this one really required?
+                   }, $"obj_own", num_fields: is_js ? 2 : 1);
 
                });
         }
@@ -89,8 +89,8 @@ namespace DebuggerTests
 
                    var is_js = bp_loc.EndsWith(".js", StringComparison.Ordinal);
 
-                    // isOwn = false, accessorPropertiesOnly = true
-                    var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+                   // isOwn = false, accessorPropertiesOnly = true
+                   var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                    {
                        objectId = result.Value["result"]["objectId"].Value<string>(),
                        accessorPropertiesOnly = true,
@@ -101,10 +101,10 @@ namespace DebuggerTests
                    else
                        AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
 
-                    // Ignoring the __proto__ property
+                   // Ignoring the __proto__ property
 
-                    // isOwn = true, accessorPropertiesOnly = false
-                    var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+                   // isOwn = true, accessorPropertiesOnly = false
+                   var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                    {
                        objectId = result.Value["result"]["objectId"].Value<string>(),
                        accessorPropertiesOnly = false,
@@ -141,8 +141,8 @@ namespace DebuggerTests
                {
                    var is_js = bp_loc.EndsWith(".js", StringComparison.Ordinal);
 
-                    // getProperties (isOwn = false, accessorPropertiesOnly = true)
-                    var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+                   // getProperties (isOwn = false, accessorPropertiesOnly = true)
+                   var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                    {
                        objectId = result.Value["result"]["objectId"].Value<string>(),
                        accessorPropertiesOnly = true,
@@ -153,8 +153,8 @@ namespace DebuggerTests
                    else
                        AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
 
-                    // getProperties (isOwn = true, accessorPropertiesOnly = false)
-                    var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+                   // getProperties (isOwn = true, accessorPropertiesOnly = false)
+                   var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                    {
                        objectId = result.Value["result"]["objectId"].Value<string>(),
                        accessorPropertiesOnly = false,
@@ -164,8 +164,8 @@ namespace DebuggerTests
                    await CheckProps(obj_own.Value["result"], new
                    {
                        length = TNumber(ret_len),
-                        // __proto__ returned by js
-                    }, $"obj_own", num_fields: is_js ? 2 : 1);
+                       // __proto__ returned by js
+                   }, $"obj_own", num_fields: is_js ? 2 : 1);
                });
         }
 
@@ -187,8 +187,8 @@ namespace DebuggerTests
                {
                    var is_js = bp_loc.EndsWith(".js");
 
-                    // getProperties (own=false)
-                    var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+                   // getProperties (own=false)
+                   var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                    {
                        objectId = result.Value["result"]["objectId"].Value<string>(),
                        accessorPropertiesOnly = true,
@@ -200,23 +200,23 @@ namespace DebuggerTests
                    else
                        AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
 
-                    // getProperties (own=true)
-                    // isOwn = true, accessorPropertiesOnly = false
-                    var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+                   // getProperties (own=true)
+                   // isOwn = true, accessorPropertiesOnly = false
+                   var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                    {
                        objectId = result.Value["result"]["objectId"].Value<string>(),
                        accessorPropertiesOnly = false,
                        ownProperties = true
                    }), ctx.token);
 
-                    // AssertEqual (2, obj_own.Value ["result"].Count (), $"{label}-obj_own.count");
+                   // AssertEqual (2, obj_own.Value ["result"].Count (), $"{label}-obj_own.count");
 
-                    var obj_own_val = obj_own.Value["result"];
+                   var obj_own_val = obj_own.Value["result"];
                    await CheckProps(obj_own_val, new
                    {
                        length = TNumber(ret_len),
-                        // __proto__ returned by JS
-                    }, $"obj_own", num_fields: (is_js ? ret_len + 2 : ret_len + 1));
+                       // __proto__ returned by JS
+                   }, $"obj_own", num_fields: (is_js ? ret_len + 2 : ret_len + 1));
 
                    for (int i = 0; i < ret_len; i++)
                        CheckNumber(obj_own_val, i.ToString(), i * 2 + 1000);
@@ -238,8 +238,8 @@ namespace DebuggerTests
            {
                var ret_len = 5;
 
-                // getProperties (own=false)
-                var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+               // getProperties (own=false)
+               var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                {
                    objectId = result.Value["result"]["objectId"].Value<string>(),
                    accessorPropertiesOnly = true,
@@ -248,9 +248,9 @@ namespace DebuggerTests
 
                AssertEqual(0, obj_accessors.Value["result"]?.Count(), "obj_accessors-count");
 
-                // getProperties (own=true)
-                // isOwn = true, accessorPropertiesOnly = false
-                var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+               // getProperties (own=true)
+               // isOwn = true, accessorPropertiesOnly = false
+               var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                {
                    objectId = result.Value["result"]["objectId"].Value<string>(),
                    accessorPropertiesOnly = false,
@@ -261,15 +261,15 @@ namespace DebuggerTests
                await CheckProps(obj_own_val, new
                {
                    length = TNumber(ret_len),
-                    // __proto__ returned by JS
-                }, "obj_own", num_fields: ret_len + 1);
+                   // __proto__ returned by JS
+               }, "obj_own", num_fields: ret_len + 1);
 
                for (int i = 0; i < ret_len; i++)
                {
                    var act_i = CheckValueType(obj_own_val, i.ToString(), "Math.SimpleStruct");
 
-                    // Valuetypes can get sent as part of the container's getProperties, so ensure that we can access it
-                    var act_i_props = await GetProperties(act_i["value"]["objectId"]?.Value<string>());
+                   // Valuetypes can get sent as part of the container's getProperties, so ensure that we can access it
+                   var act_i_props = await GetProperties(act_i["value"]["objectId"]?.Value<string>());
                    await CheckProps(act_i_props, new
                    {
                        dt = TValueType("System.DateTime", new DateTime(2020 + (i * 2), 1, 2, 3, 4, 5).ToString()),
@@ -298,8 +298,8 @@ namespace DebuggerTests
             test_fn: async (result) =>
            {
 
-                // getProperties (own=false)
-                var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+               // getProperties (own=false)
+               var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                {
                    objectId = result.Value["result"]["objectId"].Value<string>(),
                    accessorPropertiesOnly = true,
@@ -307,9 +307,9 @@ namespace DebuggerTests
                }), ctx.token);
                AssertEqual(0, obj_accessors.Value["result"].Count(), "obj_accessors-count");
 
-                // getProperties (own=true)
-                // isOwn = true, accessorPropertiesOnly = false
-                var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+               // getProperties (own=true)
+               // isOwn = true, accessorPropertiesOnly = false
+               var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                {
                    objectId = result.Value["result"]["objectId"].Value<string>(),
                    accessorPropertiesOnly = false,
@@ -346,8 +346,8 @@ namespace DebuggerTests
             test_fn: async (result) =>
            {
 
-                // getProperties (own=false)
-                var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+               // getProperties (own=false)
+               var obj_accessors = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                {
                    objectId = result.Value["result"]["objectId"].Value<string>(),
                    accessorPropertiesOnly = true,
@@ -356,9 +356,9 @@ namespace DebuggerTests
 
                await CheckProps(obj_accessors.Value["result"], new { __proto__ = TIgnore() }, "obj_accessors");
 
-                // getProperties (own=true)
-                // isOwn = true, accessorPropertiesOnly = false
-                var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
+               // getProperties (own=true)
+               // isOwn = true, accessorPropertiesOnly = false
+               var obj_own = await ctx.cli.SendCommand("Runtime.getProperties", JObject.FromObject(new
                {
                    objectId = result.Value["result"]["objectId"].Value<string>(),
                    accessorPropertiesOnly = false,
@@ -386,8 +386,8 @@ namespace DebuggerTests
                 "big", bp_loc, line, col, returnByValue: true, roundtrip: roundtrip,
                 test_fn: async (result) =>
                {
-                    // Check cfo result
-                    AssertEqual(JTokenType.Object, result.Value["result"].Type, "cfo-result-jsontype");
+                   // Check cfo result
+                   AssertEqual(JTokenType.Object, result.Value["result"].Type, "cfo-result-jsontype");
                    AssertEqual("object", result.Value["result"]["type"]?.Value<string>(), "cfo-res-type");
 
                    AssertEqual(JTokenType.Array, result.Value["result"]["value"].Type, "cfo-res-value-jsontype");
@@ -421,8 +421,8 @@ namespace DebuggerTests
             roundtrip: roundtrip,
             test_fn: async (result) =>
            {
-                // Check cfo result
-                AssertEqual("object", result.Value["result"]["type"]?.Value<string>(), "cfo-res-type");
+               // Check cfo result
+               AssertEqual("object", result.Value["result"]["type"]?.Value<string>(), "cfo-res-type");
 
                var exp = new JArray();
                for (int i = 0; i < 10; i++)
@@ -647,21 +647,21 @@ namespace DebuggerTests
                    DTArray = TGetter("DTArray"),
                    StringField = TString(null),
 
-                    // Auto properties show w/o getters, because they have
-                    // a backing field
-                    DTAutoProperty = TValueType("System.DateTime", dt.ToString())
+                   // Auto properties show w/o getters, because they have
+                   // a backing field
+                   DTAutoProperty = TValueType("System.DateTime", dt.ToString())
                }, local_name);
 
-                // Automatic properties don't have invokable getters, because we can get their
-                // value from the backing field directly
-                {
+               // Automatic properties don't have invokable getters, because we can get their
+               // value from the backing field directly
+               {
                    var dt_auto_props = await GetObjectOnLocals(obj_props, "DTAutoProperty");
                    await CheckDateTime(obj_props, "DTAutoProperty", dt);
                }
 
-                // Invoke getters, and check values
+               // Invoke getters, and check values
 
-                dt = new DateTime(3, 4, 5, 6, 7, 8);
+               dt = new DateTime(3, 4, 5, 6, 7, 8);
                var res = await InvokeGetter(obj, get_args_fn(new[] { "Int" }), cfo_fn);
                await CheckValue(res.Value["result"], JObject.FromObject(new { type = "number", value = (0xDEADBEEF + (uint)dt.Month) }), $"{local_name}.Int");
 
@@ -672,9 +672,9 @@ namespace DebuggerTests
                await CheckValue(res.Value["result"], TValueType("System.DateTime", dt.ToString()), $"{local_name}.DT");
                await CheckDateTimeValue(res.Value["result"], dt);
 
-                // Check arrays through getters
+               // Check arrays through getters
 
-                res = await InvokeGetter(obj, get_args_fn(new[] { "IntArray" }), cfo_fn);
+               res = await InvokeGetter(obj, get_args_fn(new[] { "IntArray" }), cfo_fn);
                await CheckValue(res.Value["result"], TArray("int[]", 2), $"{local_name}.IntArray");
                {
                    var arr_elems = await GetProperties(res.Value["result"]?["objectId"]?.Value<string>());
@@ -725,9 +725,9 @@ namespace DebuggerTests
 
                    var is_js = bp_loc.EndsWith(".js");
 
-                    // Check with `accessorPropertiesOnly=true`
+                   // Check with `accessorPropertiesOnly=true`
 
-                    var id = result.Value?["result"]?["objectId"]?.Value<string>();
+                   var id = result.Value?["result"]?["objectId"]?.Value<string>();
                    var get_prop_req = JObject.FromObject(new
                    {
                        objectId = id,
@@ -735,16 +735,16 @@ namespace DebuggerTests
                    });
 
                    var res = await GetPropertiesAndCheckAccessors(get_prop_req, is_js ? 6 : 5); // js returns extra `__proto__` member also
-                    Assert.False(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField shouldn't be returned for `accessorPropertiesOnly`");
+                   Assert.False(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField shouldn't be returned for `accessorPropertiesOnly`");
 
-                    // Check with `accessorPropertiesOnly` unset, == false
-                    get_prop_req = JObject.FromObject(new
+                   // Check with `accessorPropertiesOnly` unset, == false
+                   get_prop_req = JObject.FromObject(new
                    {
                        objectId = id,
                    });
 
                    res = await GetPropertiesAndCheckAccessors(get_prop_req, is_js ? 8 : 7); // js returns a `__proto__` member also
-                    Assert.True(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField should be returned for `accessorPropertiesOnly=false`");
+                   Assert.True(res.Value["result"].Any(jt => jt["name"]?.Value<string>() == "StringField"), "StringField should be returned for `accessorPropertiesOnly=false`");
                });
 
             async Task<Result> GetPropertiesAndCheckAccessors(JObject get_prop_req, int num_fields)
@@ -875,10 +875,10 @@ namespace DebuggerTests
                    var res = await InvokeGetter(ptd, "StringField", returnByValue: returnByValue);
                    if (is_js)
                    {
-                        // In js case, it doesn't know the className, so the result looks slightly different
-                        Assert.True(
-                           JObject.DeepEquals(res.Value["result"], null_value_json),
-                           $"[StringField#returnByValue = {returnByValue}] Json didn't match. Actual: {res.Value["result"]} vs {null_value_json}");
+                       // In js case, it doesn't know the className, so the result looks slightly different
+                       Assert.True(
+                          JObject.DeepEquals(res.Value["result"], null_value_json),
+                          $"[StringField#returnByValue = {returnByValue}] Json didn't match. Actual: {res.Value["result"]} vs {null_value_json}");
                    }
                    else
                    {
index a2daecd..2fc0fb5 100644 (file)
@@ -37,8 +37,8 @@ namespace DebuggerTests
                        fn_del_null = TObject("Math.IsMathNull", is_null: true),
                        fn_del_arr = TArray("Math.IsMathNull[]", 1),
 
-                        // Unused locals
-                        fn_func_unused = TDelegate("System.Func<Math, bool>", "bool <DelegatesTest>|(Math)"),
+                       // Unused locals
+                       fn_func_unused = TDelegate("System.Func<Math, bool>", "bool <DelegatesTest>|(Math)"),
                        fn_func_null_unused = TObject("System.Func<Math, bool>", is_null: true),
                        fn_func_arr_unused = TArray("System.Func<Math, bool>[]", 1),
 
index 079c9c8..dad28df 100644 (file)
@@ -104,8 +104,8 @@ namespace DebuggerTests
                {
                    var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
 
-                    // sc_arg
-                    {
+                   // sc_arg
+                   {
                        var sc_arg = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "sc_arg");
                        await CheckValue(sc_arg, TObject("DebuggerTests.SimpleClass"), "sc_arg#1");
 
@@ -120,8 +120,8 @@ namespace DebuggerTests
                        }, "sc_arg_props#1");
                    }
 
-                    // local_gs
-                    {
+                   // local_gs
+                   {
                        var local_gs = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "local_gs");
                        await CheckValue(local_gs, TValueType("DebuggerTests.SimpleGenericStruct<int>"), "local_gs#1");
 
@@ -134,8 +134,8 @@ namespace DebuggerTests
                        }, "local_gs_props#1");
                    }
 
-                    // step, check local_gs
-                    pause_location = await StepAndCheck(StepKind.Over, bp_loc, line + 1, col, function_name);
+                   // step, check local_gs
+                   pause_location = await StepAndCheck(StepKind.Over, bp_loc, line + 1, col, function_name);
                    {
                        var local_gs = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "local_gs");
                        await CheckValue(local_gs, TValueType("DebuggerTests.SimpleGenericStruct<int>"), "local_gs#2");
@@ -149,8 +149,8 @@ namespace DebuggerTests
                        }, "local_gs_props#2");
                    }
 
-                    // step check sc_arg.Id
-                    pause_location = await StepAndCheck(StepKind.Over, bp_loc, line + 2, col, function_name);
+                   // step check sc_arg.Id
+                   pause_location = await StepAndCheck(StepKind.Over, bp_loc, line + 2, col, function_name);
                    {
                        var sc_arg = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "sc_arg");
                        await CheckValue(sc_arg, TObject("DebuggerTests.SimpleClass"), "sc_arg#2");
@@ -161,7 +161,7 @@ namespace DebuggerTests
                            X = TNumber(10),
                            Y = TNumber(45),
                            Id = TString("sc_arg#Id"), // <------- This changed
-                            Color = TEnum("DebuggerTests.RGB", "Blue"),
+                           Color = TEnum("DebuggerTests.RGB", "Blue"),
                            PointWithCustomGetter = TGetter("PointWithCustomGetter")
                        }, "sc_arg_props#2");
                    }
@@ -205,10 +205,10 @@ namespace DebuggerTests
                evaluate = await EvaluateOnCallFrame(pause_location["callFrames"][0]["callFrameId"].Value<string>(), "this.c");
                CheckContentValue(evaluate, "3");
 
-                // FIXME: not supported yet
-                // evaluate = await EvaluateOnCallFrame (pause_location ["callFrames"][0] ["callFrameId"].Value<string> (), "this.dt");
-                // await CheckDateTimeValue (evaluate, new DateTime (2000, 5, 4, 3, 2, 1));
-            });
+               // FIXME: not supported yet
+               // evaluate = await EvaluateOnCallFrame (pause_location ["callFrames"][0] ["callFrameId"].Value<string> (), "this.dt");
+               // await CheckDateTimeValue (evaluate, new DateTime (2000, 5, 4, 3, 2, 1));
+           });
     }
 
 }
index 26b5406..d18f054 100644 (file)
@@ -63,8 +63,8 @@ namespace DebuggerTests
                    await CheckPointerValue(ipp_props, "*ipp_null", TPointer("int*", is_null: true));
                }
 
-                // *cp
-                props = await GetObjectOnLocals(locals, "cp");
+               // *cp
+               props = await GetObjectOnLocals(locals, "cp");
                await CheckPointerValue(props, "*cp", TSymbol("113 'q'"));
            });
 
@@ -165,8 +165,8 @@ namespace DebuggerTests
 
                await CheckDateTime(locals, "dt", dt);
 
-                // *dtp
-                var props = await GetObjectOnLocals(locals, "dtp");
+               // *dtp
+               var props = await GetObjectOnLocals(locals, "dtp");
                await CheckDateTime(props, "*dtp", dt);
 
                var gsp_props = await GetObjectOnLocals(locals, "gsp");
@@ -191,8 +191,8 @@ namespace DebuggerTests
                    }
                }
 
-                // gsp_null
-                var gsp_w_n_props = await GetObjectOnLocals(locals, "gsp_null");
+               // gsp_null
+               var gsp_w_n_props = await GetObjectOnLocals(locals, "gsp_null");
                await CheckPointerValue(gsp_w_n_props, "*gsp_null", TValueType("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>"), "locals#gsp");
 
                {
@@ -228,9 +228,9 @@ namespace DebuggerTests
                    dtpa = TArray("System.DateTime*[]", 2)
                }, "locals", num_fields: 26);
 
-                // dtpa
-                var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
-               {
+               // dtpa
+               var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
+              {
                     TPointer("System.DateTime*"),
                         TPointer("System.DateTime*", is_null : true)
                }));
@@ -261,9 +261,9 @@ namespace DebuggerTests
                    gspa = TArray("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*[]", 3),
                }, "locals", num_fields: 26);
 
-                // dtpa
-                var gspa_elems = await CompareObjectPropertiesFor(locals, "gspa", new[]
-               {
+               // dtpa
+               var gspa_elems = await CompareObjectPropertiesFor(locals, "gspa", new[]
+              {
                     TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*", is_null : true),
                         TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*"),
                         TPointer("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>*"),
@@ -277,8 +277,8 @@ namespace DebuggerTests
                         TValueType("DebuggerTests.GenericStructWithUnmanagedT<System.DateTime>")
                    });
 
-                    // *[1]
-                    {
+                   // *[1]
+                   {
                        var gsp_deref_props = await GetObjectOnLocals(actual_elems[1], "*[1]");
                        await CheckProps(gsp_deref_props, new
                        {
@@ -295,8 +295,8 @@ namespace DebuggerTests
                        }
                    }
 
-                    // *[2]
-                    {
+                   // *[2]
+                   {
                        var gsp_deref_props = await GetObjectOnLocals(actual_elems[2], "*[2]");
                        await CheckProps(gsp_deref_props, new
                        {
@@ -328,9 +328,9 @@ namespace DebuggerTests
                    dtppa = TArray("System.DateTime**[]", 3),
                }, "locals", num_fields: 26);
 
-                // DateTime**[] dtppa = new DateTime**[] { &dtp, &dtp_null, null };
-                var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
-               {
+               // DateTime**[] dtppa = new DateTime**[] { &dtp, &dtp_null, null };
+               var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
+              {
                     TPointer("System.DateTime**"),
                         TPointer("System.DateTime**"),
                         TPointer("System.DateTime**", is_null : true)
@@ -401,20 +401,20 @@ namespace DebuggerTests
                    ippa = TArray("int**[]", 5)
                }, "locals", num_fields: 8);
 
-                // ip
-                var props = await GetObjectOnLocals(locals, "ip");
+               // ip
+               var props = await GetObjectOnLocals(locals, "ip");
                await CheckPointerValue(props, "*ip", TNumber(5), "locals");
 
-                // ipp
-                var ipp_props = await GetObjectOnLocals(locals, "ipp");
+               // ipp
+               var ipp_props = await GetObjectOnLocals(locals, "ipp");
                await CheckPointerValue(ipp_props, "*ipp", TPointer("int*"));
 
                ipp_props = await GetObjectOnLocals(ipp_props, "*ipp");
                await CheckPointerValue(ipp_props, "**ipp", TNumber(5));
 
-                // ipa
-                var ipa_elems = await CompareObjectPropertiesFor(locals, "ipa", new[]
-               {
+               // ipa
+               var ipa_elems = await CompareObjectPropertiesFor(locals, "ipa", new[]
+              {
                     TPointer("int*"),
                         TPointer("int*"),
                         TPointer("int*", is_null : true)
@@ -427,9 +427,9 @@ namespace DebuggerTests
                         null
                });
 
-                // ippa
-                var ippa_elems = await CompareObjectPropertiesFor(locals, "ippa", new[]
-               {
+               // ippa
+               var ippa_elems = await CompareObjectPropertiesFor(locals, "ippa", new[]
+              {
                     TPointer("int**"),
                         TPointer("int**"),
                         TPointer("int**"),
@@ -474,20 +474,20 @@ namespace DebuggerTests
                    dtppa = TArray("System.DateTime**[]", 3)
                }, "locals", num_fields: 8);
 
-                // *dtp
-                var dtp_props = await GetObjectOnLocals(locals, "dtp");
+               // *dtp
+               var dtp_props = await GetObjectOnLocals(locals, "dtp");
                await CheckDateTime(dtp_props, "*dtp", dt);
 
-                // *dtpp
-                var dtpp_props = await GetObjectOnLocals(locals, "dtpp");
+               // *dtpp
+               var dtpp_props = await GetObjectOnLocals(locals, "dtpp");
                await CheckPointerValue(dtpp_props, "*dtpp", TPointer("System.DateTime*"), "locals");
 
                dtpp_props = await GetObjectOnLocals(dtpp_props, "*dtpp");
                await CheckDateTime(dtpp_props, "**dtpp", dt);
 
-                // dtpa
-                var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
-               {
+               // dtpa
+               var dtpa_elems = (await CompareObjectPropertiesFor(locals, "dtpa", new[]
+              {
                     TPointer("System.DateTime*"),
                         TPointer("System.DateTime*", is_null : true)
                }));
@@ -501,9 +501,9 @@ namespace DebuggerTests
                    await CheckDateTime(actual_elems[0], "*[0]", dt);
                }
 
-                // dtppa = new DateTime**[] { &dtp, &dtp_null, null };
-                var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
-               {
+               // dtppa = new DateTime**[] { &dtp, &dtp_null, null };
+               var dtppa_elems = (await CompareObjectPropertiesFor(locals, "dtppa", new[]
+              {
                     TPointer("System.DateTime**"),
                         TPointer("System.DateTime**"),
                         TPointer("System.DateTime**", is_null : true)
@@ -529,15 +529,15 @@ namespace DebuggerTests
             wait_for_event_fn: async (pause_location) =>
            {
 
-                // this will generate the object ids
-                var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
+               // this will generate the object ids
+               var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
                var complex = GetAndAssertObjectWithName(locals, "complex");
 
-                // try to deref the non-pointer object, as a pointer
-                await GetProperties(complex["value"]["objectId"].Value<string>().Replace(":object:", ":pointer:"), expect_ok: false);
+               // try to deref the non-pointer object, as a pointer
+               await GetProperties(complex["value"]["objectId"].Value<string>().Replace(":object:", ":pointer:"), expect_ok: false);
 
-                // try to deref an invalid pointer id
-                await GetProperties("dotnet:pointer:123897", expect_ok: false);
+               // try to deref an invalid pointer id
+               await GetProperties("dotnet:pointer:123897", expect_ok: false);
            });
 
         async Task<JToken[]> CheckArrayElements(JToken array, JToken[] exp_elems)
index 67f9c5d..d7df335 100644 (file)
@@ -214,9 +214,9 @@ namespace DebuggerTests
                     function_name,
                     wait_for_event_fn: async (pause_location) =>
                    {
-                        //make sure we're on the right bp
+                       //make sure we're on the right bp
 
-                        Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
+                       Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
 
                        var top_frame = pause_location["callFrames"][0];
 
index 75bedf7..422b2ce 100644 (file)
@@ -410,16 +410,16 @@ namespace DebuggerTests
                     "DelegatesTest",
                     wait_for_event_fn: async (pause_location) =>
                    {
-                        //make sure we're on the right bp
-                        Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
+                       //make sure we're on the right bp
+                       Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>());
 
                        var top_frame = pause_location["callFrames"][0];
 
                        var scope = top_frame["scopeChain"][0];
                        Assert.Equal("dotnet:scope:0", scope["object"]["objectId"]);
 
-                        // Try to get an invalid scope!
-                        var get_prop_req = JObject.FromObject(new
+                       // Try to get an invalid scope!
+                       var get_prop_req = JObject.FromObject(new
                        {
                            objectId = "dotnet:scope:23490871",
                        });
@@ -862,11 +862,11 @@ namespace DebuggerTests
                 ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
                 var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
 
-                await SetBreakpoint(debugger_test_loc, 22, 8);
+                await SetBreakpoint(debugger_test_loc, 24, 8);
 
                 var pause_location = await EvaluateAndCheck(
                     "window.setTimeout(function() { invoke_method_with_structs(); }, 1);",
-                    debugger_test_loc, 22, 8, "MethodWithLocalStructs");
+                    debugger_test_loc, 24, 8, "MethodWithLocalStructs");
 
                 var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
                 await CheckProps(locals, new
@@ -965,11 +965,11 @@ namespace DebuggerTests
                 ctx.UseCallFunctionOnBeforeGetProperties = use_cfo;
                 var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
 
-                await SetBreakpoint(debugger_test_loc, 34, 12);
+                await SetBreakpoint(debugger_test_loc, 36, 12);
 
                 var pause_location = await EvaluateAndCheck(
                     "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.ValueTypesTest:TestStructsAsMethodArgs'); }, 1);",
-                    debugger_test_loc, 34, 12, "MethodWithStructArgs");
+                    debugger_test_loc, 36, 12, "MethodWithStructArgs");
                 var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
                 {
                     Assert.Equal(3, locals.Count());
@@ -1009,7 +1009,7 @@ namespace DebuggerTests
                     await CompareObjectPropertiesFor(ss_arg_props, "gs", ss_local_gs);
                 }
 
-                pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 38, 8, "MethodWithStructArgs", times: 4,
+                pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 40, 8, "MethodWithStructArgs", times: 4,
                     locals_fn: (l) => { /* non-null to make sure that locals get fetched */ });
                 locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
                 {
@@ -1063,7 +1063,7 @@ namespace DebuggerTests
 
                 // ----------- Step back to the caller ---------
 
-                pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 28, 12, "TestStructsAsMethodArgs",
+                pause_location = await StepAndCheck(StepKind.Over, debugger_test_loc, 30, 12, "TestStructsAsMethodArgs",
                     times: 2, locals_fn: (l) => { /* non-null to make sure that locals get fetched */ });
                 locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>());
                 await CheckProps(locals, new
@@ -1098,7 +1098,7 @@ namespace DebuggerTests
                 ctx = new DebugTestContext(cli, insp, token, scripts);
                 var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
 
-                var lines = new[] { 203, 206 };
+                var lines = new[] { 205, 208 };
                 await SetBreakpoint(debugger_test_loc, lines[0], 12);
                 await SetBreakpoint(debugger_test_loc, lines[1], 12);
 
@@ -1157,7 +1157,7 @@ namespace DebuggerTests
                 ctx = new DebugTestContext(cli, insp, token, scripts);
                 var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
 
-                var lines = new[] { 212, 214 };
+                var lines = new[] { 214, 216 };
                 await SetBreakpoint(debugger_test_loc, lines[0], 12);
                 await SetBreakpoint(debugger_test_loc, lines[1], 12);
 
@@ -1190,7 +1190,7 @@ namespace DebuggerTests
                 ctx = new DebugTestContext(cli, insp, token, scripts);
                 var debugger_test_loc = "dotnet://debugger-test.dll/debugger-valuetypes-test.cs";
 
-                var lines = new[] { 223, 225 };
+                var lines = new[] { 225, 227 };
                 await SetBreakpoint(debugger_test_loc, lines[0], 12);
                 await SetBreakpoint(debugger_test_loc, lines[1], 12);
 
@@ -1302,10 +1302,10 @@ namespace DebuggerTests
         }
 
         [Theory]
-        [InlineData(135, 12, "MethodWithLocalsForToStringTest", false, false)]
-        [InlineData(145, 12, "MethodWithArgumentsForToStringTest", true, false)]
-        [InlineData(190, 12, "MethodWithArgumentsForToStringTestAsync", true, true)]
-        [InlineData(180, 12, "MethodWithArgumentsForToStringTestAsync", false, true)]
+        [InlineData(137, 12, "MethodWithLocalsForToStringTest", false, false)]
+        [InlineData(147, 12, "MethodWithArgumentsForToStringTest", true, false)]
+        [InlineData(192, 12, "MethodWithArgumentsForToStringTestAsync", true, true)]
+        [InlineData(182, 12, "MethodWithArgumentsForToStringTestAsync", false, true)]
         public async Task InspectLocalsForToStringDescriptions(int line, int col, string method_name, bool call_other, bool invoke_async)
         {
             var insp = new Inspector();
index 95e2fb1..282db74 100644 (file)
@@ -158,7 +158,7 @@ namespace DebuggerTests
             return true;
         }
 
-        public async Task < (T, Point[]) > InstanceMethodValueTypeLocalsAsync<T>(T t1)
+        public async Task<(T, Point[])> InstanceMethodValueTypeLocalsAsync<T>(T t1)
         {
             var point_arr = new Point[]
             {
@@ -305,4 +305,4 @@ namespace DebuggerTests
             new Point { X = 90, Y = -4, Id = "point#Id", Color = RGB.Green }.GenericInstanceMethod(sc);
         }
     }
-}
\ No newline at end of file
+}
index 6e88564..66a964a 100644 (file)
@@ -33,13 +33,13 @@ namespace DebuggerTests
 
         public static async System.Threading.Tasks.Task PropertyGettersTestAsync()
         {
-            var ptd = new ClassWithProperties { DTAutoProperty = new DateTime (4, 5, 6, 7, 8, 9), V = 0xDEADBEEF };
-            var swp = new StructWithProperties { DTAutoProperty = new DateTime (4, 5, 6, 7, 8, 9), V = 0xDEADBEEF };
+            var ptd = new ClassWithProperties { DTAutoProperty = new DateTime(4, 5, 6, 7, 8, 9), V = 0xDEADBEEF };
+            var swp = new StructWithProperties { DTAutoProperty = new DateTime(4, 5, 6, 7, 8, 9), V = 0xDEADBEEF };
             System.Console.WriteLine("break here");
             await System.Threading.Tasks.Task.CompletedTask;
         }
 
-        public static void MethodForNegativeTests (string value = null)
+        public static void MethodForNegativeTests(string value = null)
         {
             var ptd = new ClassWithProperties { StringField = value };
             var swp = new StructWithProperties { StringField = value };
@@ -72,4 +72,4 @@ namespace DebuggerTests
         public DateTime DTAutoProperty { get; set; }
         public string StringField;
     }
-}
\ No newline at end of file
+}
index 8ea2650..62890a7 100644 (file)
@@ -26,4 +26,4 @@ namespace DebuggerTests
             return dt_str;
         }
     }
-}
\ No newline at end of file
+}
index 4d958cd..ffb6fad 100644 (file)
@@ -105,4 +105,4 @@ namespace DebuggerTests
             c = c + 3;
         }
     }
-}
\ No newline at end of file
+}
index 3eb2535..86904ca 100644 (file)
@@ -9,11 +9,11 @@ namespace DebuggerTests
     {
         public class TestCaughtException
         {
-            public void run() 
+            public void run()
             {
                 try
                 {
-                    throw new CustomException ("not implemented caught");
+                    throw new CustomException("not implemented caught");
                 }
                 catch
                 {
@@ -26,7 +26,7 @@ namespace DebuggerTests
         {
             public void run()
             {
-                throw new CustomException ("not implemented uncaught");
+                throw new CustomException("not implemented uncaught");
             }
         }
 
@@ -46,10 +46,10 @@ namespace DebuggerTests
         // Using this name to match with what js has.
         // helps with the tests
         public string message;
-        public CustomException (string message)
-            : base (message)
+        public CustomException(string message)
+            : base(message)
         {
             this.message = message;
         }
     }
-}
\ No newline at end of file
+}
index 122a080..a82973e 100644 (file)
@@ -48,7 +48,7 @@ namespace DebuggerTests
             PointersAsArgsTest(ip, ipp, ipa, ippa, &dt, &dtp, dtpa, dtppa);
         }
 
-        static unsafe void  PointersAsArgsTest(int* ip, int** ipp, int*[] ipa, int**[] ippa,
+        static unsafe void PointersAsArgsTest(int* ip, int** ipp, int*[] ipa, int**[] ippa,
                             DateTime* dtp, DateTime** dtpp, DateTime*[] dtpa, DateTime**[] dtppa)
         {
             Console.WriteLine($"break here!");
@@ -109,4 +109,4 @@ namespace DebuggerTests
     {
         public unsafe T* Ptr;
     }
-}
\ No newline at end of file
+}
index 55a13d5..9b53cea 100644 (file)
@@ -161,7 +161,7 @@ public partial class Math
         Func<Math, GenericStruct<GenericStruct<int[]>>, GenericStruct<bool[]>> fn_func = (m, gs) => new GenericStruct<bool[]>();
         Func<Math, GenericStruct<GenericStruct<int[]>>, GenericStruct<bool[]>> fn_func_del = GenericStruct<int>.DelegateTargetForSignatureTest;
         Func<Math, GenericStruct<GenericStruct<int[]>>, GenericStruct<bool[]>> fn_func_null = null;
-        Func<bool> fn_func_only_ret = () => { Console.WriteLine ($"hello"); return true; };
+        Func<bool> fn_func_only_ret = () => { Console.WriteLine($"hello"); return true; };
         var fn_func_arr = new Func<Math, GenericStruct<GenericStruct<int[]>>, GenericStruct<bool[]>>[] {
                 (m, gs) => new GenericStruct<bool[]> () };
 
@@ -322,4 +322,4 @@ public class DebuggerTest
     }
 
     static void locals_inner() { }
-}
\ No newline at end of file
+}
index 26817a2..7275bf4 100644 (file)
@@ -25,14 +25,14 @@ public class Fancy
     public static void Types()
     {
         double dPI = System.Math.PI;
-        float fPI = (float) System.Math.PI;
+        float fPI = (float)System.Math.PI;
 
         int iMax = int.MaxValue;
         int iMin = int.MinValue;
         uint uiMax = uint.MaxValue;
         uint uiMin = uint.MinValue;
 
-        long l = uiMax * (long) 2;
+        long l = uiMax * (long)2;
         long lMax = long.MaxValue; // cannot be represented as double
         long lMin = long.MinValue; // cannot be represented as double
 
@@ -48,4 +48,4 @@ public class Fancy
 
         var d = usMin + usMax;
     }
-}
\ No newline at end of file
+}
index 7c37287..0c5cc90 100644 (file)
@@ -17,7 +17,9 @@ namespace DebuggerTests
             {
                 StringField = "string#0",
                 SimpleStructField = new SimpleStruct("SimpleStructField#string#0", 5, DateTimeKind.Local),
-                SimpleStructProperty = new SimpleStruct("SimpleStructProperty#string#0", 2, DateTimeKind.Utc), DT = new DateTime(2020, 1, 2, 3, 4, 5), RGB = RGB.Blue
+                SimpleStructProperty = new SimpleStruct("SimpleStructProperty#string#0", 2, DateTimeKind.Utc),
+                DT = new DateTime(2020, 1, 2, 3, 4, 5),
+                RGB = RGB.Blue
             };
             Console.WriteLine($"Using the struct: {ss_local.gs.StringField}, gs: {gs_local.StringField}, {vt_local.StringField}");
         }
@@ -217,7 +219,7 @@ namespace DebuggerTests
 
         public static void MethodUpdatingVTArrayMembers()
         {
-            var ssta = new []
+            var ssta = new[]
             {
                 new StructForToStringTests { DT = new DateTime(1, 2, 3, 4, 5, 6) }
             };
@@ -262,4 +264,4 @@ namespace DebuggerTests
 
         All = Option1 | Option3
     }
-}
\ No newline at end of file
+}
index 3581a5a..05925f7 100644 (file)
@@ -41,4 +41,4 @@ namespace Simple
             return x;
         }
     }
-}
\ No newline at end of file
+}