-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathProgram.cs
1674 lines (1402 loc) · 102 KB
/
Program.cs
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.IO;
using System.Collections.Generic;
using NetcoreDbgTest;
using NetcoreDbgTest.VSCode;
using NetcoreDbgTest.Script;
using Newtonsoft.Json;
namespace NetcoreDbgTest.Script
{
class Context
{
public void PrepareStart(string caller_trace)
{
InitializeRequest initializeRequest = new InitializeRequest();
initializeRequest.arguments.clientID = "vscode";
initializeRequest.arguments.clientName = "Visual Studio Code";
initializeRequest.arguments.adapterID = "coreclr";
initializeRequest.arguments.pathFormat = "path";
initializeRequest.arguments.linesStartAt1 = true;
initializeRequest.arguments.columnsStartAt1 = true;
initializeRequest.arguments.supportsVariableType = true;
initializeRequest.arguments.supportsVariablePaging = true;
initializeRequest.arguments.supportsRunInTerminalRequest = true;
initializeRequest.arguments.locale = "en-us";
Assert.True(VSCodeDebugger.Request(initializeRequest).Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
LaunchRequest launchRequest = new LaunchRequest();
launchRequest.arguments.name = ".NET Core Launch (console) with pipeline";
launchRequest.arguments.type = "coreclr";
launchRequest.arguments.preLaunchTask = "build";
launchRequest.arguments.program = ControlInfo.TargetAssemblyPath;
launchRequest.arguments.cwd = "";
launchRequest.arguments.console = "internalConsole";
launchRequest.arguments.stopAtEntry = true;
launchRequest.arguments.internalConsoleOptions = "openOnSessionStart";
launchRequest.arguments.__sessionId = Guid.NewGuid().ToString();
Assert.True(VSCodeDebugger.Request(launchRequest).Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void PrepareEnd(string caller_trace)
{
ConfigurationDoneRequest configurationDoneRequest = new ConfigurationDoneRequest();
Assert.True(VSCodeDebugger.Request(configurationDoneRequest).Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void WasEntryPointHit(string caller_trace)
{
Func<string, bool> filter = (resJSON) => {
if (VSCodeDebugger.isResponseContainProperty(resJSON, "event", "stopped")
&& VSCodeDebugger.isResponseContainProperty(resJSON, "reason", "entry")) {
threadId = Convert.ToInt32(VSCodeDebugger.GetResponsePropertyValue(resJSON, "threadId"));
return true;
}
return false;
};
Assert.True(VSCodeDebugger.IsEventReceived(filter), @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void WasExit(string caller_trace)
{
bool wasExited = false;
int ?exitCode = null;
bool wasTerminated = false;
Func<string, bool> filter = (resJSON) => {
if (VSCodeDebugger.isResponseContainProperty(resJSON, "event", "exited")) {
wasExited = true;
ExitedEvent exitedEvent = JsonConvert.DeserializeObject<ExitedEvent>(resJSON);
exitCode = exitedEvent.body.exitCode;
}
if (VSCodeDebugger.isResponseContainProperty(resJSON, "event", "terminated")) {
wasTerminated = true;
}
if (wasExited && exitCode == 0 && wasTerminated)
return true;
return false;
};
Assert.True(VSCodeDebugger.IsEventReceived(filter), @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void DebuggerExit(string caller_trace)
{
DisconnectRequest disconnectRequest = new DisconnectRequest();
disconnectRequest.arguments = new DisconnectArguments();
disconnectRequest.arguments.restart = false;
Assert.True(VSCodeDebugger.Request(disconnectRequest).Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void AddBreakpoint(string caller_trace, string bpName, string Condition = null)
{
Breakpoint bp = ControlInfo.Breakpoints[bpName];
Assert.Equal(BreakpointType.Line, bp.Type, @"__FILE__:__LINE__"+"\n"+caller_trace);
var lbp = (LineBreakpoint)bp;
BreakpointSourceName = lbp.FileName;
BreakpointList.Add(new SourceBreakpoint(lbp.NumLine, Condition));
BreakpointLines.Add(lbp.NumLine);
}
public void SetBreakpoints(string caller_trace)
{
SetBreakpointsRequest setBreakpointsRequest = new SetBreakpointsRequest();
setBreakpointsRequest.arguments.source.name = BreakpointSourceName;
// NOTE this code works only with one source file
setBreakpointsRequest.arguments.source.path = ControlInfo.SourceFilesPath;
setBreakpointsRequest.arguments.lines.AddRange(BreakpointLines);
setBreakpointsRequest.arguments.breakpoints.AddRange(BreakpointList);
setBreakpointsRequest.arguments.sourceModified = false;
Assert.True(VSCodeDebugger.Request(setBreakpointsRequest).Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void WasBreakpointHit(string caller_trace, string bpName)
{
Func<string, bool> filter = (resJSON) => {
if (VSCodeDebugger.isResponseContainProperty(resJSON, "event", "stopped")
&& VSCodeDebugger.isResponseContainProperty(resJSON, "reason", "breakpoint")) {
threadId = Convert.ToInt32(VSCodeDebugger.GetResponsePropertyValue(resJSON, "threadId"));
return true;
}
return false;
};
Assert.True(VSCodeDebugger.IsEventReceived(filter), @"__FILE__:__LINE__"+"\n"+caller_trace);
StackTraceRequest stackTraceRequest = new StackTraceRequest();
stackTraceRequest.arguments.threadId = threadId;
stackTraceRequest.arguments.startFrame = 0;
stackTraceRequest.arguments.levels = 20;
var ret = VSCodeDebugger.Request(stackTraceRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
Breakpoint breakpoint = ControlInfo.Breakpoints[bpName];
Assert.Equal(BreakpointType.Line, breakpoint.Type, @"__FILE__:__LINE__"+"\n"+caller_trace);
var lbp = (LineBreakpoint)breakpoint;
StackTraceResponse stackTraceResponse =
JsonConvert.DeserializeObject<StackTraceResponse>(ret.ResponseStr);
if (stackTraceResponse.body.stackFrames[0].line == lbp.NumLine
&& stackTraceResponse.body.stackFrames[0].source.name == lbp.FileName
// NOTE this code works only with one source file
&& stackTraceResponse.body.stackFrames[0].source.path == ControlInfo.SourceFilesPath)
return;
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void Continue(string caller_trace)
{
ContinueRequest continueRequest = new ContinueRequest();
continueRequest.arguments.threadId = threadId;
Assert.True(VSCodeDebugger.Request(continueRequest).Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public Int64 DetectFrameId(string caller_trace, string bpName)
{
StackTraceRequest stackTraceRequest = new StackTraceRequest();
stackTraceRequest.arguments.threadId = threadId;
stackTraceRequest.arguments.startFrame = 0;
stackTraceRequest.arguments.levels = 20;
var ret = VSCodeDebugger.Request(stackTraceRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
Breakpoint breakpoint = ControlInfo.Breakpoints[bpName];
Assert.Equal(BreakpointType.Line, breakpoint.Type, @"__FILE__:__LINE__"+"\n"+caller_trace);
var lbp = (LineBreakpoint)breakpoint;
StackTraceResponse stackTraceResponse =
JsonConvert.DeserializeObject<StackTraceResponse>(ret.ResponseStr);
if (stackTraceResponse.body.stackFrames[0].line == lbp.NumLine
&& stackTraceResponse.body.stackFrames[0].source.name == lbp.FileName
// NOTE this code works only with one source file
&& stackTraceResponse.body.stackFrames[0].source.path == ControlInfo.SourceFilesPath)
return stackTraceResponse.body.stackFrames[0].id;
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void GetAndCheckValue(string caller_trace, Int64 frameId, string ExpectedResult, string ExpectedType, string Expression)
{
EvaluateRequest evaluateRequest = new EvaluateRequest();
evaluateRequest.arguments.expression = Expression;
evaluateRequest.arguments.frameId = frameId;
var ret = VSCodeDebugger.Request(evaluateRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
EvaluateResponse evaluateResponse =
JsonConvert.DeserializeObject<EvaluateResponse>(ret.ResponseStr);
Assert.Equal(ExpectedResult, evaluateResponse.body.result, @"__FILE__:__LINE__"+"\n"+caller_trace);
Assert.Equal(ExpectedType, evaluateResponse.body.type, @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void GetAndCheckValue(string caller_trace, Int64 frameId, string ExpectedResult1, string ExpectedResult2, string ExpectedType, string Expression)
{
EvaluateRequest evaluateRequest = new EvaluateRequest();
evaluateRequest.arguments.expression = Expression;
evaluateRequest.arguments.frameId = frameId;
var ret = VSCodeDebugger.Request(evaluateRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
EvaluateResponse evaluateResponse =
JsonConvert.DeserializeObject<EvaluateResponse>(ret.ResponseStr);
Assert.True(ExpectedResult1 == evaluateResponse.body.result ||
ExpectedResult2 == evaluateResponse.body.result, @"__FILE__:__LINE__"+"\n"+caller_trace);
Assert.Equal(ExpectedType, evaluateResponse.body.type, @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void CheckErrorAtRequest(string caller_trace, Int64 frameId, string Expression, string errMsgStart)
{
EvaluateRequest evaluateRequest = new EvaluateRequest();
evaluateRequest.arguments.expression = Expression;
evaluateRequest.arguments.frameId = frameId;
var ret = VSCodeDebugger.Request(evaluateRequest);
Assert.False(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
EvaluateResponse evaluateResponse =
JsonConvert.DeserializeObject<EvaluateResponse>(ret.ResponseStr);
Assert.True(evaluateResponse.message.StartsWith(errMsgStart), @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void AddExceptionBreakpointFilterAllWithOptions(string options)
{
ExceptionFilterAllOptions = new ExceptionFilterOptions();
ExceptionFilterAllOptions.filterId = "all";
ExceptionFilterAllOptions.condition = options;
}
public void SetExceptionBreakpoints(string caller_trace)
{
SetExceptionBreakpointsRequest setExceptionBreakpointsRequest = new SetExceptionBreakpointsRequest();
if (ExceptionFilterAll)
setExceptionBreakpointsRequest.arguments.filters.Add("all");
if (ExceptionFilterUserUnhandled)
setExceptionBreakpointsRequest.arguments.filters.Add("user-unhandled");
if (ExceptionFilterAllOptions != null || ExceptionFilterUserUnhandledOptions != null)
setExceptionBreakpointsRequest.arguments.filterOptions = new List<ExceptionFilterOptions>();
if (ExceptionFilterAllOptions != null)
setExceptionBreakpointsRequest.arguments.filterOptions.Add(ExceptionFilterAllOptions);
if (ExceptionFilterUserUnhandledOptions != null)
setExceptionBreakpointsRequest.arguments.filterOptions.Add(ExceptionFilterUserUnhandledOptions);
Assert.True(VSCodeDebugger.Request(setExceptionBreakpointsRequest).Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void TestExceptionInfo(string caller_trace, string excCategory, string excMode, string excName)
{
ExceptionInfoRequest exceptionInfoRequest = new ExceptionInfoRequest();
exceptionInfoRequest.arguments.threadId = threadId;
var ret = VSCodeDebugger.Request(exceptionInfoRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
ExceptionInfoResponse exceptionInfoResponse =
JsonConvert.DeserializeObject<ExceptionInfoResponse>(ret.ResponseStr);
if (exceptionInfoResponse.body.breakMode == excMode
&& exceptionInfoResponse.body.exceptionId == excCategory + "/" + excName
&& exceptionInfoResponse.body.details.fullTypeName == excName)
return;
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);
}
public void WasExceptionBreakpointHit(string caller_trace, string bpName, string excCategory, string excMode, string excName)
{
Func<string, bool> filter = (resJSON) => {
if (VSCodeDebugger.isResponseContainProperty(resJSON, "event", "stopped")
&& VSCodeDebugger.isResponseContainProperty(resJSON, "reason", "exception")) {
threadId = Convert.ToInt32(VSCodeDebugger.GetResponsePropertyValue(resJSON, "threadId"));
return true;
}
return false;
};
Assert.True(VSCodeDebugger.IsEventReceived(filter), @"__FILE__:__LINE__"+"\n"+caller_trace);
StackTraceRequest stackTraceRequest = new StackTraceRequest();
stackTraceRequest.arguments.threadId = threadId;
stackTraceRequest.arguments.startFrame = 0;
stackTraceRequest.arguments.levels = 20;
var ret = VSCodeDebugger.Request(stackTraceRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
Breakpoint breakpoint = ControlInfo.Breakpoints[bpName];
Assert.Equal(BreakpointType.Line, breakpoint.Type, @"__FILE__:__LINE__"+"\n"+caller_trace);
var lbp = (LineBreakpoint)breakpoint;
StackTraceResponse stackTraceResponse =
JsonConvert.DeserializeObject<StackTraceResponse>(ret.ResponseStr);
if (stackTraceResponse.body.stackFrames[0].line == lbp.NumLine
&& stackTraceResponse.body.stackFrames[0].source.name == lbp.FileName
// NOTE this code works only with one source file
&& stackTraceResponse.body.stackFrames[0].source.path == ControlInfo.SourceFilesPath)
{
TestExceptionInfo(@"__FILE__:__LINE__"+"\n"+caller_trace, excCategory, excMode, excName);
return;
}
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);
}
public int GetVariablesReference(string caller_trace, Int64 frameId, string ScopeName)
{
ScopesRequest scopesRequest = new ScopesRequest();
scopesRequest.arguments.frameId = frameId;
var ret = VSCodeDebugger.Request(scopesRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
ScopesResponse scopesResponse =
JsonConvert.DeserializeObject<ScopesResponse>(ret.ResponseStr);
foreach (var Scope in scopesResponse.body.scopes) {
if (Scope.name == ScopeName) {
return Scope.variablesReference == null ? 0 : (int)Scope.variablesReference;
}
}
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);
}
public int GetChildVariablesReference(string caller_trace, int VariablesReference, string VariableName)
{
VariablesRequest variablesRequest = new VariablesRequest();
variablesRequest.arguments.variablesReference = VariablesReference;
var ret = VSCodeDebugger.Request(variablesRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
VariablesResponse variablesResponse =
JsonConvert.DeserializeObject<VariablesResponse>(ret.ResponseStr);
foreach (var Variable in variablesResponse.body.variables) {
if (Variable.name == VariableName)
return Variable.variablesReference;
}
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);
}
public bool EvalVariable(string caller_trace, int variablesReference, string ExpectedResult, string ExpectedType, string VariableName)
{
VariablesRequest variablesRequest = new VariablesRequest();
variablesRequest.arguments.variablesReference = variablesReference;
var ret = VSCodeDebugger.Request(variablesRequest);
Assert.True(ret.Success, @"__FILE__:__LINE__"+"\n"+caller_trace);
VariablesResponse variablesResponse =
JsonConvert.DeserializeObject<VariablesResponse>(ret.ResponseStr);
foreach (var Variable in variablesResponse.body.variables) {
if (Variable.name == VariableName) {
Assert.Equal(ExpectedType, Variable.type, @"__FILE__:__LINE__"+"\n"+caller_trace);
Assert.Equal(ExpectedResult, Variable.value, @"__FILE__:__LINE__"+"\n"+caller_trace);
return true;
}
}
return false;
}
public void GetAndCheckChildValue(string caller_trace, Int64 frameId, string ExpectedResult, string ExpectedType, string VariableName, string ChildName)
{
int refLocals = GetVariablesReference(@"__FILE__:__LINE__"+"\n"+caller_trace, frameId, "Locals");
int refVar = GetChildVariablesReference(@"__FILE__:__LINE__"+"\n"+caller_trace, refLocals, VariableName);
if (EvalVariable(@"__FILE__:__LINE__"+"\n"+caller_trace, refVar, ExpectedResult, ExpectedType, ChildName))
return;
int refVarStatic = GetChildVariablesReference(@"__FILE__:__LINE__"+"\n"+caller_trace, refVar, "Static members");
if (EvalVariable(@"__FILE__:__LINE__"+"\n"+caller_trace, refVarStatic, ExpectedResult, ExpectedType, ChildName))
return;
throw new ResultNotSuccessException(@"__FILE__:__LINE__"+"\n"+caller_trace);
}
public Context(ControlInfo controlInfo, NetcoreDbgTestCore.DebuggerClient debuggerClient)
{
ControlInfo = controlInfo;
VSCodeDebugger = new VSCodeDebugger(debuggerClient);
}
ControlInfo ControlInfo;
VSCodeDebugger VSCodeDebugger;
int threadId = -1;
string BreakpointSourceName;
List<SourceBreakpoint> BreakpointList = new List<SourceBreakpoint>();
List<int> BreakpointLines = new List<int>();
bool ExceptionFilterAll = false;
bool ExceptionFilterUserUnhandled = false;
ExceptionFilterOptions ExceptionFilterAllOptions = null;
ExceptionFilterOptions ExceptionFilterUserUnhandledOptions = null;
}
}
namespace VSCodeTestEvaluate
{
public struct test_struct1_t
{
public test_struct1_t(int x)
{
field_i1 = x;
}
public int field_i1;
}
public class test_class1_t
{
public double field_d1 = 7.1;
}
public class test_static_class1_t
{
~test_static_class1_t()
{
// must be never called in this test!
throw new System.Exception("test_static_class1_t finalizer called!");
}
public int field_i1;
public test_struct1_t st2 = new test_struct1_t(9);
public static test_struct1_t st = new test_struct1_t(8);
public static test_class1_t cl = new test_class1_t();
public static int static_field_i1 = 5;
public static int static_property_i2
{ get { return static_field_i1 + 2; }}
}
public struct test_static_struct1_t
{
public static int static_field_i1 = 4;
public static float static_field_f1 = 3.0f;
public int field_i1;
public static int static_property_i2
{ get { return static_field_i1 + 2; }}
}
public class test_this_t
{
static int Calc1()
{
return 15;
}
int Calc2()
{
return 16;
}
void TestVoidReturn()
{
Console.WriteLine("test void return");
}
public int this_i = 1;
public string this_static_str = "2str";
public static int this_static_i = 3;
public void func(int arg_test)
{
int this_i = 4;
int break_line4 = 1; Label.Breakpoint("BREAK4");
Label.Checkpoint("this_test", "nested_test", (Object context) => {
Context Context = (Context)context;
Context.WasBreakpointHit(@"__FILE__:__LINE__", "BREAK4");
Int64 frameId = Context.DetectFrameId(@"__FILE__:__LINE__", "BREAK4");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "501", "int", "arg_test");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "{VSCodeTestEvaluate.test_this_t}", "VSCodeTestEvaluate.test_this_t", "this");
Context.GetAndCheckChildValue(@"__FILE__:__LINE__", frameId, "1", "int", "this", "this_i");
Context.GetAndCheckChildValue(@"__FILE__:__LINE__", frameId, "\"2str\"", "string", "this", "this_static_str");
Context.GetAndCheckChildValue(@"__FILE__:__LINE__", frameId, "3", "int", "this", "this_static_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "4", "int", "this_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"2str\"", "string", "this_static_str");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "3", "int", "this_static_i");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "VSCodeTestEvaluate.test_this_t.this_i", "error:"); // error, cannot be accessed in this way
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "VSCodeTestEvaluate.test_this_t.this_static_str", "error:"); // error, cannot be accessed in this way
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "3", "int", "VSCodeTestEvaluate.test_this_t.this_static_i");
// Test method calls.
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "15", "int", "Calc1()");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "15", "int", "test_this_t.Calc1()");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "this.Calc1()", "error:");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "16", "int", "Calc2()");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "16", "int", "this.Calc2()");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "test_this_t.Calc2()", "error:");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"VSCodeTestEvaluate.test_this_t\"", "string", "ToString()");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"VSCodeTestEvaluate.test_this_t\"", "string", "this.ToString()");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "Expression has been evaluated and has no value", "void", "TestVoidReturn()");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "TestVoidReturn() + 1", "error CS0019");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1 + TestVoidReturn()", "error CS0019");
Context.Continue(@"__FILE__:__LINE__");
});
}
}
public class test_nested
{
public static int nested_static_i = 53;
public int nested_i = 55;
public class test_nested_1
{
// class without members
public class test_nested_2
{
public static int nested_static_i = 253;
public int nested_i = 255;
public void func()
{
int break_line5 = 1; Label.Breakpoint("BREAK5");
Label.Checkpoint("nested_test", "base_class_test", (Object context) => {
Context Context = (Context)context;
Context.WasBreakpointHit(@"__FILE__:__LINE__", "BREAK5");
Int64 frameId = Context.DetectFrameId(@"__FILE__:__LINE__", "BREAK5");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "5", "int", "VSCodeTestEvaluate.test_static_class1_t.static_field_i1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "4", "int", "VSCodeTestEvaluate.test_static_struct1_t.static_field_i1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "53", "int", "VSCodeTestEvaluate.test_nested.nested_static_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "253", "int", "VSCodeTestEvaluate.test_nested.test_nested_1.test_nested_2.nested_static_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "353", "int", "VSCodeTestEvaluate.test_nested.test_nested_1.test_nested_3.nested_static_i");
// nested tests:
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "253", "int", "nested_static_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "5", "int", "test_static_class1_t.static_field_i1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "4", "int", "test_static_struct1_t.static_field_i1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "53", "int", "test_nested.nested_static_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "253", "int", "test_nested.test_nested_1.test_nested_2.nested_static_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "253", "int", "test_nested_1.test_nested_2.nested_static_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "253", "int", "test_nested_2.nested_static_i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "353", "int", "test_nested_3.nested_static_i");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "test_nested.nested_i", "error:"); // error, cannot be accessed
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "test_nested.test_nested_1.test_nested_2.nested_i", "error:"); // error, cannot be accessed
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "test_nested_1.test_nested_2.nested_i", "error:"); // error, cannot be accessed
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "test_nested_2.nested_i", "error:"); // error, cannot be accessed
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "test_nested_3.nested_i", "error:"); // error, cannot be accessed
Context.Continue(@"__FILE__:__LINE__");
});
}
}
public class test_nested_3
{
public static int nested_static_i = 353;
}
}
}
abstract public class test_static_parent
{
static public int static_i_f_parent = 301;
static public int static_i_p_parent
{ get { return 302; }}
public abstract void test();
}
public class test_static_child : test_static_parent
{
static public int static_i_f_child = 401;
static public int static_i_p_child
{ get { return 402; }}
public override void test()
{
int break_line5 = 1; Label.Breakpoint("BREAK7");
}
}
public class test_parent
{
public int i_parent = 302;
public virtual int GetNumber()
{
return 10;
}
}
public class test_child : test_parent
{
public int i_child = 402;
public override int GetNumber()
{
return 11;
}
}
public class conditional_access1
{
public int i = 555;
public int index = 1;
}
public class conditional_access2
{
public conditional_access1 member = new conditional_access1();
}
public class conditional_access3
{
public conditional_access1 member;
}
public class object_with_array
{
public int[] array = new int[] { 551, 552, 553 };
}
public struct test_array
{
public int i;
}
delegate void Lambda(string argVar);
public class MethodCallTest1
{
public static int Calc1()
{
return 5;
}
public int Calc2()
{
return 6;
}
}
public class coalesce_test_A
{
public string A = "A";
}
public class coalesce_test_B
{
public string B = "B";
}
public class MethodCallTest2
{
public static MethodCallTest1 member1 = new MethodCallTest1();
public MethodCallTest1 nullMember;
}
public class MethodCallTest3
{
public int Calc1(int i)
{
return i + 1;
}
public decimal Calc1(decimal d)
{
return d + 1;
}
public float Calc2(float f1, float f2, float f3)
{
return f1 * 100 + f2 * 10 + f3;
}
public int Calc2(int i1, int i2, int i3)
{
return i1 * 100 + i2 * 10 + i3;
}
public int Calc2(int i1, int i2, float f3)
{
return i1 * 100 + i2 * 10 + (int)f3;
}
}
enum enumUnary_t
{
ONE,
TWO
};
public class TestOperators1
{
public int data;
public TestOperators1(int data_)
{
data = data_;
}
public static implicit operator TestOperators1(int value) => new TestOperators1(value);
public static int operator +(TestOperators1 d1, int d2) => 55;
public static int operator +(int d1, TestOperators1 d2) => 66;
public static int operator ~(TestOperators1 d1) => ~d1.data;
public static bool operator !(TestOperators1 d1) => true;
public static int operator +(TestOperators1 d1, TestOperators1 d2) => d1.data + d2.data;
public static int operator -(TestOperators1 d1, TestOperators1 d2) => d1.data - d2.data;
public static int operator *(TestOperators1 d1, TestOperators1 d2) => d1.data * d2.data;
public static int operator /(TestOperators1 d1, TestOperators1 d2) => d1.data / d2.data;
public static int operator %(TestOperators1 d1, TestOperators1 d2) => d1.data % d2.data;
public static int operator ^(TestOperators1 d1, TestOperators1 d2) => d1.data ^ d2.data;
public static int operator &(TestOperators1 d1, TestOperators1 d2) => d1.data & d2.data;
public static int operator |(TestOperators1 d1, TestOperators1 d2) => d1.data | d2.data;
public static int operator >>(TestOperators1 d1, int d2) => d1.data >> d2;
public static int operator <<(TestOperators1 d1, int d2) => d1.data << d2;
public static bool operator ==(TestOperators1 d1, TestOperators1 d2) => d1.data == d2.data;
public static bool operator !=(TestOperators1 d1, TestOperators1 d2) => d1.data != d2.data;
public static bool operator <(TestOperators1 d1, TestOperators1 d2) => d1.data < d2.data;
public static bool operator <=(TestOperators1 d1, TestOperators1 d2) => d1.data <= d2.data;
public static bool operator >(TestOperators1 d1, TestOperators1 d2) => d1.data > d2.data;
public static bool operator >=(TestOperators1 d1, TestOperators1 d2) => d1.data >= d2.data;
}
public struct TestOperators2
{
public int data;
public TestOperators2(int data_)
{
data = data_;
}
public static implicit operator TestOperators2(int value) => new TestOperators2(value);
public static int operator +(TestOperators2 d1, int d2) => 55;
public static int operator +(int d1, TestOperators2 d2) => 66;
public static int operator ~(TestOperators2 d1) => ~d1.data;
public static bool operator !(TestOperators2 d1) => true;
public static int operator +(TestOperators2 d1, TestOperators2 d2) => d1.data + d2.data;
public static int operator -(TestOperators2 d1, TestOperators2 d2) => d1.data - d2.data;
public static int operator *(TestOperators2 d1, TestOperators2 d2) => d1.data * d2.data;
public static int operator /(TestOperators2 d1, TestOperators2 d2) => d1.data / d2.data;
public static int operator %(TestOperators2 d1, TestOperators2 d2) => d1.data % d2.data;
public static int operator ^(TestOperators2 d1, TestOperators2 d2) => d1.data ^ d2.data;
public static int operator &(TestOperators2 d1, TestOperators2 d2) => d1.data & d2.data;
public static int operator |(TestOperators2 d1, TestOperators2 d2) => d1.data | d2.data;
public static int operator >>(TestOperators2 d1, int d2) => d1.data >> d2;
public static int operator <<(TestOperators2 d1, int d2) => d1.data << d2;
public static bool operator ==(TestOperators2 d1, TestOperators2 d2) => d1.data == d2.data;
public static bool operator !=(TestOperators2 d1, TestOperators2 d2) => d1.data != d2.data;
public static bool operator <(TestOperators2 d1, TestOperators2 d2) => d1.data < d2.data;
public static bool operator <=(TestOperators2 d1, TestOperators2 d2) => d1.data <= d2.data;
public static bool operator >(TestOperators2 d1, TestOperators2 d2) => d1.data > d2.data;
public static bool operator >=(TestOperators2 d1, TestOperators2 d2) => d1.data >= d2.data;
}
public struct TestOperators3
{
public int data;
public TestOperators3(int data_)
{
data = data_;
}
// Note, in order to test that was used proper operator, we use fixed return here.
public static implicit operator int(TestOperators3 value) => 777;
public static int operator +(TestOperators3 d1, int d2) => 555;
public static int operator +(int d1, TestOperators3 d2) => 666;
public static int operator >>(TestOperators3 d1, int d2) => 777;
public static int operator <<(TestOperators3 d1, int d2) => 888;
}
class Program
{
int int_i = 505;
static test_nested test_nested_static_instance;
static int stGetInt()
{
return 111;
}
static int stGetInt(int x)
{
return x * 2;
}
int getInt()
{
return 222;
}
static int TestTimeOut()
{
System.Threading.Thread.Sleep(10000);
return 5;
}
static int TestArrayArg(int[] arrayArg, int i)
{
return arrayArg[0] + i;
}
static int TestArrayArg(test_array[] arrayT, int i)
{
return i;
}
static int TestArrayArg2(short[] arrayArg, int i)
{
return arrayArg[0] + i;
}
static int TestArray2Arg(int[,] multiArray2, int i)
{
return multiArray2[0,0] + i;
}
static int TestArray2Arg2(short[,] multiArray2, int i)
{
return multiArray2[0,0] + i;
}
static void Main(string[] args)
{
Label.Checkpoint("init", "values_test", (Object context) => {
Context Context = (Context)context;
Context.PrepareStart(@"__FILE__:__LINE__");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK1");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK2");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK3");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK4");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK5");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK6");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK7");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK8");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK9");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK10");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK11");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK12");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK13");
Context.AddBreakpoint(@"__FILE__:__LINE__", "BREAK14");
Context.SetBreakpoints(@"__FILE__:__LINE__");
Context.PrepareEnd(@"__FILE__:__LINE__");
Context.WasEntryPointHit(@"__FILE__:__LINE__");
Context.Continue(@"__FILE__:__LINE__");
});
decimal dec = 12345678901234567890123456m;
decimal long_zero_dec = 0.00000000000000000017M;
decimal short_zero_dec = 0.17M;
int[] array1 = new int[] { 10, 20, 30, 40, 50 };
int[,] multi_array2 = { { 101, 102, 103 }, { 104, 105, 106 } };
test_array[] array2 = new test_array[4];
array2[0] = new test_array();
array2[0].i = 201;
array2[2] = new test_array();
array2[2].i = 401;
int i1 = 0;
int i2 = 2;
int i3 = 4;
int i4 = 1;
int break_line1 = 1; Label.Breakpoint("BREAK1");
Label.Checkpoint("values_test", "expression_test", (Object context) => {
Context Context = (Context)context;
Context.WasBreakpointHit(@"__FILE__:__LINE__", "BREAK1");
Int64 frameId = Context.DetectFrameId(@"__FILE__:__LINE__", "BREAK1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "12345678901234567890123456", "decimal", "dec");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "0.00000000000000000017", "decimal", "long_zero_dec");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "0.17", "decimal", "short_zero_dec");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "{int[5]}", "int[]", "array1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "10", "int", "array1[0]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "30", "int", "array1[2]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "50", "int", "array1[4]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "10", "int", "array1[i1]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "30", "int", "array1[i2]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "50", "int", "array1[i3]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "10", "int", "array1[ 0]"); // check spaces
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "30", "int", "array1[2 ]"); // check spaces
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "50", "int", "array1 [ 4 ]"); // check spaces
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "15", "int", "TestArrayArg(array1, 5)");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "11", "int", "TestArrayArg(array2, 11)");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "TestArrayArg2(array1, 5)", "error:");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "{int[2, 3]}", "int[,]", "multi_array2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "101", "int", "multi_array2[0,0]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "105", "int", "multi_array2[1,1]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "104", "int", "multi_array2[1,0]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "102", "int", "multi_array2[0,1]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "104", "int", "multi_array2[i4,i1]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "102", "int", "multi_array2[i1,i4]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "101", "int", "multi_array2[ 0 , 0 ]"); // check spaces
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "105", "int", "multi_array2 [ 1,1 ]"); // check spaces
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "106", "int", "TestArray2Arg(multi_array2, 5)");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "TestArray2Arg2(multi_array2, 5)", "error:");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "{VSCodeTestEvaluate.test_array[4]}", "VSCodeTestEvaluate.test_array[]", "array2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "{VSCodeTestEvaluate.test_array}", "VSCodeTestEvaluate.test_array", "array2[0]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "201", "int", "array2[i1].i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "201", "int", "array2[0].i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "201", "int", "array2 [ 0 ] . i"); // check spaces
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "{VSCodeTestEvaluate.test_array}", "VSCodeTestEvaluate.test_array", "array2[2]");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "401", "int", "array2[i2].i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "401", "int", "array2[2].i");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "401", "int", "array2 [ 2 ] . i"); // check spaces
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "this.int_i", "error:"); // error, Main is static method that don't have "this"
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "int_i", "error:"); // error, don't have "this" (no object of type "Program" was created)
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "not_declared", "error:"); // error, no such variable
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "array1[]", "error CS1519:"); // error, no such variable
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "multi_array2[]", "error CS1519:"); // error, no such variable
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "multi_array2[,]", "error CS1519:"); // error, no such variable
Context.Continue(@"__FILE__:__LINE__");
});
// Test expression calculation.
TestOperators1 testClass = new TestOperators1(12);
TestOperators2 testStruct;
TestOperators3 testStruct2;
testStruct.data = 5;
string testString1 = null;
string testString2 = "test";
int break_line2 = 1; Label.Breakpoint("BREAK2");
Label.Checkpoint("expression_test", "static_test", (Object context) => {
Context Context = (Context)context;
Context.WasBreakpointHit(@"__FILE__:__LINE__", "BREAK2");
Int64 frameId = Context.DetectFrameId(@"__FILE__:__LINE__", "BREAK2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "2", "int", "1 + 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "2", "float", "1u + 1f");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "2", "long", "1u + 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "2", "decimal", "1m + 1m");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "2", "decimal", "1m + 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "2", "decimal", "1 + 1m");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "66", "int", "1 + testClass");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "55", "int", "testClass + 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "66", "int", "1 + testStruct");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "55", "int", "testStruct + 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "666", "int", "1 + testStruct2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "555", "int", "testStruct2 + 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"stringC\"", "string", "\"string\" + 'C'");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"test\"", "string", "testString1 + testString2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"test\"", "string", "testString2 + testString1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"\"", "string", "testString1 + testString1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"testtest\"", "string", "testString2 + testString2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"test\"", "string", "\"\" + \"test\"");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"test\"", "string", "\"test\" + \"\"");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"\"", "string", "\"\" + \"\"");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "\"testtest\"", "string", "\"test\" + \"test\"");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1UL + 1", "error");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "true + 1", "error");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1 + not_var", "error");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1u + testClass", "error CS0019");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "testClass + 1u", "error CS0019");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1u + testStruct", "error CS0019");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "testStruct + 1u", "error CS0019");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "testClass + testStruct", "error CS0019");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "testStruct + testClass", "error CS0019");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "2", "int", "3 - 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "2", "decimal", "3m - 1m");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "true - 1", "error");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1 - not_var", "error");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "-11", "int", "1 - testClass");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "11", "int", "testClass - 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "-4", "int", "1 - testStruct");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "4", "int", "testStruct - 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "-776", "int", "1 - testStruct2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "776", "int", "testStruct2 - 1");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "4", "int", "2 * 2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "4", "decimal", "2m * 2m");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "true * 2", "error");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1 * not_var", "error");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "1", "int", "2 / 2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "1", "decimal", "2m / 2m");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "true / 2", "error");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1 / not_var", "error");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "0", "int", "2 % 2");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "0", "decimal", "2m % 2m");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "true % 2", "error");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1 % not_var", "error");
Context.GetAndCheckValue(@"__FILE__:__LINE__", frameId, "4", "int", "1 << 2");
Context.CheckErrorAtRequest(@"__FILE__:__LINE__", frameId, "1m << 2m", "error CS0019");