1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-08 17:25:59 +02:00

Initial checkin

This commit is contained in:
Brian Fiete 2019-08-23 11:56:54 -07:00
parent c74712dad9
commit 078564ac9e
3242 changed files with 1616395 additions and 0 deletions

View file

@ -0,0 +1,8 @@
FileVersion = 1
[Project]
Name = "IDETest"
StartupObject = "IDETest.Program"
[Configs.Debug.Win64]
BeefLibType = "DynamicDebug"

View file

@ -0,0 +1,12 @@
FileVersion = 1
Projects = {IDETest = {Path = "."}}
Unlocked = ["corlib"]
[Workspace]
StartupProject = "IDETest"
[Configs.Debug.Win64]
IntermediateType = "ObjectAndIRCode"
[Configs.Debug.Win32]
IntermediateType = "ObjectAndIRCode"

View file

@ -0,0 +1,29 @@
# We're testing that we can set a breakpoint on a specific assembly instruction
# and that when we re-run, we also stop at that instruction
#Leak()
#Sleep(5000)
ShowFile("src/Assembly.bf")
GotoText("//AssemblyTester_Test")
ToggleBreakpoint()
RunWithCompiling()
StepInto()
ShowDisassemblyAtStack()
GotoTextSkip("call", 1)
AdjustCursor(0, 1)
ToggleBreakpoint()
CloseCurrentDocument()
Continue()
AssertEvalEquals("a", "2")
StopRunning()
CloseCurrentDocument()
# Make sure when we re-run that we're still stopping after the second IncVal call
RunWithCompiling()
Continue()
AssertEvalEquals("a", "2")

View file

@ -0,0 +1,31 @@
# This tests that we can manually break a long-executing method and then step in the
# correct thread
ShowFile("src/Break.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
ImmediateEvaluate("Infinite()")
nowait Sleep(1000)
nowait Break()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("a", "2")
StopRunning()
# The next section uses assembly and it only works in Og+
if (platform != "Win64") Stop()
RunWithCompiling()
ShowDisassemblyAtStack()
ImmediateEvaluate("Infinite()")
nowait Sleep(1000)
nowait Break()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("a", "2")

View file

@ -0,0 +1,48 @@
ShowFile("src/Breakpoints.bf")
GotoText("//BreakpointTester_Test")
ToggleBreakpoint()
GotoText("//BreakpointTester_LoopA")
ToggleBreakpoint()
BreakpointSetHitCountTarget(3, "MultipleOf")
BreakpointSetCondition("++b < 10")
GotoText("//BreakpointTester_Recurse")
ToggleBreakpoint()
GotoText("//Recurse_C")
ToggleBreakpoint()
BreakpointSetCondition("a == 3")
RunWithCompiling()
Continue()
AssertEvalEquals("a", "2")
AssertEvalEquals("b", "3")
Continue()
AssertEvalEquals("a", "5")
AssertEvalEquals("b", "6")
Continue()
Continue()
AssertLineContains("Recurse(0)")
StepInto()
AssertLineContains("int b = 234")
StepOver()
AssertLineContains("int c = 345")
StepOver()
AssertLineContains("a == 10")
AssertEvalEquals("a", "0")
StepOver()
StepOver()
AssertLineContains("int c = 345")
AssertEvalEquals("a", "3")
StepOver()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("d", "103")

View file

@ -0,0 +1,28 @@
# This tests for a bug where stepping onto a breakpoint and then continuing (F5)
# would cause us to immediately hit the breakpoint we were already at
ShowFile("src/Breakpoints02.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
GotoText("//MethodA_1")
ToggleBreakpoint()
GotoText("//MethodA_2")
ToggleBreakpoint()
RunWithCompiling()
Continue()
AssertEvalEquals("a", "1")
StepOver()
AssertEvalEquals("a", "2")
Continue()
AssertEvalEquals("a", "5")
# The next section uses assembly and it only works in Og+
if (platform != "Win64") Stop()
ShowDisassemblyAtStack()
StepOver()
AssertEvalEquals("a", "6")
Continue()
AssertEvalEquals("a", "9")

View file

@ -0,0 +1,9 @@
# This tests for a bug where 'b' wasn't visible on the very last line of the method
ShowFile("src/bugs/Bug001.bf")
GotoText("//Bug001_DoTest")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
AssertEvalEquals("a", "123")
AssertEvalEquals("b", "234")

View file

@ -0,0 +1,19 @@
# This tests that loop over an array correctly steps over the array accessor
ShowFile("src/bugs/Bug002.bf")
GotoText("//Bug002_DoTest")
ToggleBreakpoint()
RunWithCompiling()
StepInto()
StepOver()
AssertEvalEquals("val, na", "\"aaa\"")
StepOver()
StepOver()
AssertEvalEquals("val, na", "\"bbb\"")
StepOver()
StepOver()
AssertEvalEquals("val, na", "\"ccc\"")
StepOver()
StepOver()
StepOver()
AssertEvalEquals("val2", "999")

View file

@ -0,0 +1,9 @@
ShowFile("src/Enums.bf")
GotoText("//EnumTester_Test")
ToggleBreakpoint()
RunWithCompiling()
AssertEvalEquals("ea", ".B(b:1.2)")
AssertEvalEquals("z", "(aa:123, bb:345)")
AssertEvalEquals("q", "(a:234, 567, c:999)")
AssertEvalEquals("qRef = (4, 5, 6)", "(a:4, 5, c:6)")

View file

@ -0,0 +1,53 @@
ShowFile("src/HotSwap_BaseChange.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
ToggleCommentAt("ClassC_0")
ToggleCommentAt("DoTest0_Body")
Compile()
# DoTest0
StepInto()
StepOver()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("a0", "100")
AssertEvalEquals("a1", "101")
AssertEvalEquals("c0", "300")
StepOut()
# DoTest1
ToggleCommentAt("ClassC_0")
ToggleCommentAt("ClassC_1")
ToggleCommentAt("DoTest0_Body")
ToggleCommentAt("DoTest1_Body")
ToggleCommentAt("DoTest2_Decl")
Compile()
StepInto()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("b0", "200")
AssertEvalEquals("c0", "300")
# DoTest1
ToggleCommentAt("ClassB_MethodB1")
ToggleCommentAt("ClassC_1")
ToggleCommentAt("ClassC_2")
ToggleCommentAt("DoTest2_Body")
Compile()
StepOver()
StepOver()
AssertEvalEquals("b0", "200")
AssertEvalEquals("c0", "1300")
StepInto()
StepOver()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("b0", "200")
AssertEvalEquals("b1", "201")
AssertEvalEquals("c0", "1300")
AssertEvalEquals("c1", "1301")

View file

@ -0,0 +1,13 @@
ShowFile("src/HotSwap_BaseChange.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
ToggleCommentAt("ClassC_3")
ToggleCommentAt("DoTest3_Body")
SetExpectError("Too many arguments")
Compile()
ToggleCommentAt("ClassC_3")
ToggleCommentAt("ClassC_1")
Compile()

View file

@ -0,0 +1,20 @@
ShowFile("src/HotSwap.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
GotoText("//*HotTester_Test1")
AdjustCursor(0, 1)
InsertText("int a0 = 1;\n\t\t\tint b0 = 2;\n\t\t\tint c0 = 3;\n")
AdjustCursor(0, -2)
ToggleBreakpoint()
# We want to ensure that breakpoint didn't bind yet
StepOver()
StepOver()
AssertLineContains("ht.Test1()")
# ... but now it does
Compile()
Continue()
AssertLineContains("b0 = 2")

View file

@ -0,0 +1,19 @@
ShowFile("src/HotSwap_Data.bf")
GotoText("//Test_Test01")
ToggleBreakpoint()
RunWithCompiling()
StepInto()
ToggleCommentAt("StructA_mA2")
ToggleCommentAt("Test01_mA2")
SetExpectError("data changes")
Compile()
ExpectError()
StepOver()
StepOver()
Compile()
StepInto()
StepOver()
StepOver()
AssertEvalEquals("val", "101")
AssertEvalEquals("sc.mA2", "101")

View file

@ -0,0 +1,14 @@
ShowFile("src/HotSwap_Data.bf")
GotoText("//Test_Test02")
ToggleBreakpoint()
RunWithCompiling()
ToggleCommentAt("Test_funcPtr")
Compile()
ToggleCommentAt("Func")
ToggleCommentAt("Test_funcPtr")
Compile()
ToggleCommentAt("StructA_mA2")
SetExpectError("data changes")
Compile()
ExpectError()

View file

@ -0,0 +1,18 @@
ShowFile("src/HotSwap_Data.bf")
ToggleCommentAt("Test03_delegate")
GotoText("//Test_Test03")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
ToggleCommentAt("Test03_delegate")
Compile()
# We are rebuilding Func so this should be okay
ToggleCommentAt("StructA_mA2")
Compile()
ToggleCommentAt("Func")
ToggleCommentAt("StructA_mA3")
SetExpectError("data changes")
Compile()
ExpectError()

View file

@ -0,0 +1,23 @@
ShowFile("src/HotSwap_Data.bf")
GotoText("//Test_Test04")
ToggleBreakpoint()
RunWithCompiling()
# Both of these interface will have the same slot number
ToggleCommentAt("ClassC_IFaceB_WithComma")
SetExpectError("collision error")
Compile()
ExpectError()
# Switching interfaces can work if there are no allocations, but this StepInto DOES have an allocation
StepInto()
ToggleCommentAt("ClassC_IFaceA")
ToggleCommentAt("ClassC_IFaceB_WithComma")
ToggleCommentAt("ClassC_IFaceB_WithoutComma")
SetExpectError("data changes")
Compile()
ExpectError()
# But it should succeeed when were back out in Test() with no allocs
StepOut()
Compile()

View file

@ -0,0 +1,50 @@
ShowFile("src/HotSwap.bf")
GotoText("//HotStart_Funcs")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
StepOver()
StepOver()
StepOver()
# We're on TestFuncs_Compare now
GotoText("//HotTester_TestFuncs_Func_Return")
AdjustCursor(0, 1)
CursorToLineEnd()
AdjustCursor(-1, 0)
InsertText("4")
GotoText("//HotB_MethodA_Return")
AdjustCursor(0, 1)
CursorToLineEnd()
AdjustCursor(-1, 0)
InsertText("9")
Compile()
GotoText("//TestFuncs_Compare_Calls")
RunToCursor()
StepOver()
AssertEvalEquals("val", "209")
StepOver()
AssertEvalEquals("val", "1234")
StepOver()
AssertEvalEquals("val", "1234")
Stop()
StepOut()
StepOut()
ToggleCommentAt("HotTester_TestFuncs_Func2")
ToggleCommentAt("TestFuncs2_Body")
Compile()
StepInto()
StepOver()
ToggleCommentAt("TestFuncs2_Compare_Body")
Compile()
StepInto()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("val", "444")

View file

@ -0,0 +1,15 @@
ShowFile("src/HotSwap_GetUnused.bf")
GotoText("//Test")
ToggleBreakpoint()
Compile()
ToggleCommentAt("DoTest_MethodB")
Compile()
ToggleCommentAt("DoTest_MethodB")
RunWithCompiling()
ToggleCommentAt("DoTest_MethodB")
Compile()
StepInto()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("val", "123")

View file

@ -0,0 +1,34 @@
# This tests hot adding an unreified interface, hot adding interface methods,
# and calling hot-added methods
ShowFile("src/HotSwap.bf")
GotoText("//HotStart_Interfaces")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
AssertEvalEquals("hot.IHotA()", "ERROR:'Unable to find address for method, possibly due to compiler optimizations.'")
ToggleCommentAt("HotTester_TestIHotA")
Compile()
StepInto()
StepOver()
StepOver()
AssertEvalEquals("val", "15")
AssertEvalEquals("hot.IHotA()", "15")
ToggleCommentAt("IHot_IHotB")
ToggleCommentAt("HotTester_TestIHotB")
Compile()
# Steps out
StepOver()
# We need an extra step for Win32 for stack adjustment...
if (platform == "Win32") StepOver()
StepInto()
StepOver()
StepOver()
AssertEvalEquals("val", "16")
AssertEvalEquals("hot.IHotB()", "16")

View file

@ -0,0 +1,14 @@
ShowFile("src/HotSwap_Interfaces2.bf")
GotoText("//Test")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
AssertEvalEquals("v0", "11")
ToggleCommentAt("IFaceA_Method1")
ToggleCommentAt("ClassA_Method1")
ToggleCommentAt("Test1_Method1")
Compile()
StepInto()
StepOver()
AssertEvalEquals("v1", "22")

View file

@ -0,0 +1,30 @@
ShowFile("src/HotSwap_Reflection.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
StepOver()
AssertEvalEquals("field.mFieldData.mName, na", "\"mA\"")
StepOver()
StepOver()
AssertLineContains("GetMyType")
GotoText("//ClassA_mA")
AdjustCursor(-1, 0)
InsertText("1")
Compile()
StepOver()
StepOver()
AssertEvalEquals("field.mFieldData.mName, na", "\"mA1\"")
StepOver()
StepOver()
GotoText("//ClassA_mA")
AdjustCursor(-1, 0)
InsertText("2")
Compile()
StepOver()
StepOver()
AssertEvalEquals("field.mFieldData.mName, na", "\"mA12\"")
StepOver()
StepOver()

View file

@ -0,0 +1,37 @@
ShowFile("src/HotSwap_TLS.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
StepOver()
StepOver()
StepOver()
StepOver()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("val", "3")
AssertEvalEquals("ClassA.sTLS0", "3")
AssertEvalEquals("sThreadResult", "1")
StepOver()
StepOver()
StepOver()
AssertEvalEquals("sThreadResult", "2")
ToggleCommentAt("ClassA_TLS1")
ToggleCommentAt("Inc1_TLS1")
Compile()
AssertEvalEquals("ClassA.sTLS1", "0")
StepOver()
StepOver()
StepOver()
StepOver()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("val", "3")
AssertEvalEquals("ClassA.sTLS1", "3")
AssertEvalEquals("sThreadResult", "1")
StepOver()
StepOver()
StepOver()
AssertEvalEquals("sThreadResult", "2")

View file

@ -0,0 +1,64 @@
# Tests:
# Virtual methods being added during hot compiles
# Breakpoints being set in both old versions of methods and new versions
ShowFile("src/HotSwap.bf")
GotoText("//HotStart")
ToggleBreakpoint()
RunWithCompiling()
# MethodA
StepOver()
AssertEvalEquals("val", "20")
# MethodB
StepOver()
AssertEvalEquals("val", "11")
# Hot compile, adding in MethodB
ToggleCommentAt("HotB_MethodB")
Compile()
# MethodB - after hot compile
StepOver()
AssertEvalEquals("val", "21")
# Modify Test1 end so we can make sure break hits both val setting
GotoText("//HotTester_Test1_EndTest")
ToggleBreakpoint()
AdjustCursor(0, 1)
CursorToLineEnd()
AdjustCursor(-1, 0)
InsertText("6")
# Hot compile, adding in MethodC, but MethodC is not called yet
ToggleCommentAt("HotA_MethodC")
ToggleCommentAt("HotB_MethodC")
Compile()
# Hot compile in usage of MethodC
ToggleCommentAt("HotTester_Test2")
Compile()
# 'Test2' - calling MethodC after hot compile
StepInto()
StepOver()
AssertEvalEquals("val", "22")
# Continue to HotTester_Test1_EndTest
Continue
StepOver
AssertEvalEquals("val", "99")
# Continue to new HotTester_Test1_EndTest
Continue()
Continue()
StepOver()
AssertEvalEquals("val", "996")
# Test previously-unused MethodE
ToggleCommentAt("HotTester_Test3")
Compile()
StepInto()
StepOver()
AssertEvalEquals("val", "14")

View file

@ -0,0 +1,39 @@
# Tests that even when removing an old virtual method, adding a new one, and then
# adding back a method with the same name as the old one, we can call this new
# method using an old virtual call
ShowFile("src/HotSwap.bf")
GotoText("//HotStart_VirtualRemap")
ToggleBreakpoint()
RunWithCompiling()
# Turn off MethodB
ToggleCommentAt("HotA_MethodB")
ToggleCommentAt("HotTester_Test1")
ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall")
ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall_2")
Compile()
# Make sure we can call the old 'MethodB'
StepOver()
StepOver()
AssertEvalEquals("val", "11")
# Turn on MethodC
ShowCurrent()
ToggleCommentAt("HotA_MethodC")
ToggleCommentAt("HotTester_TestVirtualRemap2_MethodCCall")
Compile()
StepInto()
StepOver()
AssertEvalEquals("val", "12")
# Turn on MethodB (version 2)
ToggleCommentAt("HotA_MethodB_2")
ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall")
Compile()
StepOver()
StepOver()
# We are running an old version of TestVirtualRemap that used the old virtual slot
# number for the MethodB call, but the new MethodB should be mapped to that same
# slot because it mangles the same
AssertEvalEquals("val", "111")

View file

@ -0,0 +1,14 @@
ShowFile("src/Inline.bf")
GotoText("//InlineTester")
ToggleBreakpoint()
RunWithCompiling()
StepInto()
AssertEvalEquals("argA", "10")
AssertEvalEquals("argB", "2")
StepOver()
AssertEvalEquals("argA", "11")
StepOut()
AssertEvalEquals("c", "13")

View file

@ -0,0 +1,16 @@
ShowFile("src/Lambdas.bf")
GotoText("//LambdaTest_Test1")
ToggleBreakpoint()
RunWithCompiling()
StepInto()
AssertEvalEquals("argA1", "99")
AssertEvalEquals("outerVar", "88")
AssertEvalEquals("mA", "123")
AssertEvalEquals("mB", "234")
AssertEvalEquals("this,na", "{ mA=123 mB=234 }")
AssertDbgAutocomplete("outerVar")
AssertDbgAutocomplete("argA1")
AssertDbgAutocomplete("this")
AssertDbgAutocomplete("mA")

View file

@ -0,0 +1,12 @@
ShowFile("src/MemoryBreakpoints.bf")
GotoText("//MemoryBreakpointTester_Test")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
CreateMemoryBreakpoint("mbt")
Continue()
AssertEvalEquals("a", "0")
Continue()
AssertEvalEquals("a", "2")

View file

@ -0,0 +1,28 @@
ShowFile("src/Methods.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
AssertAutocompleteEquals("ClassA.TEST_", "TEST_StaticMethodA\nTEST_StaticMethodB")
AssertAutocompleteEquals("ca.TEST_", "TEST_MethodA\nTEST_MethodB")
NavigateBackwards()
AssertEvalEquals("ca.TEST_MethodA()", "200")
AssertEvalContains("ca.TEST_MethodB()", "Unable to find address for method")
AssertEvalEquals("ClassA.TEST_StaticMethodA()", "100")
AssertEvalContains("ClassA.TEST_StaticMethodB()", "Unable to find address for method")
AssertAutocompleteEquals("ClassA.TEST_", "TEST_StaticMethodA\nTEST_StaticMethodB")
AssertAutocompleteEquals("ca.TEST_", "TEST_MethodA\nTEST_MethodB")
NavigateBackwards()
ToggleCommentAt("ClassA_MethodC")
ToggleCommentAt("ClassA_StaticMethodC")
ToggleCommentAt("DoTest_Body")
Compile()
AssertEvalEquals("ca.TEST_MethodA()", "200")
AssertEvalEquals("ca.TEST_MethodB()", "201")
AssertEvalEquals("ca.TEST_MethodC()", "202")
AssertEvalEquals("ClassA.TEST_StaticMethodA()", "100")
AssertEvalEquals("ClassA.TEST_StaticMethodB()", "101")
AssertEvalEquals("ClassA.TEST_StaticMethodC()", "102")
AssertAutocompleteEquals("ClassA.TEST_", "TEST_StaticMethodA\nTEST_StaticMethodB\nTEST_StaticMethodC")
AssertAutocompleteEquals("ca.TEST_", "TEST_MethodA\nTEST_MethodB\nTEST_MethodC")

View file

@ -0,0 +1,28 @@
ShowFile("src/Mixins.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
StepOver()
StepOver()
AssertLineContains("a = 123")
StepOver()
StepInto()
StepOver()
StepOver()
AssertLineContains("b + 1000")
StepInto()
AssertLineContains("a + 10000")
StepInto()
AssertLineContains("b = a + 10")
StepOut()
# This isn't strictly required
AssertLineContains("a + 10000")
StepOver()
AssertLineContains("a + 20000")
StepOver()
AssertLineContains("a + 30000")

View file

@ -0,0 +1,93 @@
# This tests multithreaded stepping
# - Steps should stay in the same thread
# - Run To Cursor should stay on the same thread
# - Step Out should stay on the same thread
ShowFile("src/Multithread.bf")
GotoText("//MultithreadTester_Test")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
AssertEvalEquals("doTest = true", "true")
GotoText("//ThreadFunc")
ToggleBreakpoint()
Continue()
AssertEvalEquals("sLocalVal", "1")
Continue()
AssertEvalEquals("sLocalVal", "1")
Continue()
AssertEvalEquals("sLocalVal", "1")
# We now have all 3 threads running and we're the third one
# We now do a series of execution tests, concentrating on the "val++" line
# We test that "run to cursor" does a full iteration back to that
# same line, both from having stepped onto it using "StepOver" and
# having previously arrived there from another "RunToCursor"
AssertEvalEquals("threadNum", "2")
StepOver()
AssertEvalEquals("threadNum", "2")
StepOver()
AssertEvalEquals("threadNum", "2")
StepOver()
AssertEvalEquals("threadNum", "2")
StepOver()
AssertEvalEquals("threadNum", "2")
StepOver()
AssertEvalEquals("threadNum", "2")
StepOver()
AssertEvalEquals("i", "1")
RunToCursor()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "2")
RunToCursor()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "3")
# Pass 2
StepOver()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "4")
RunToCursor()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "5")
RunToCursor()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "6")
# Pass 3
StepOver()
StepOver()
StepOver()
StepOver()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "7")
RunToCursor()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "8")
RunToCursor()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "9")
# Set up the StepOut test
StepInto()
StepOver()
StepOver()
StepOver()
StepInto()
StepOver()
StepOver()
AssertEvalEquals("val", "2")
StepOut()
AssertEvalEquals("depth", "0")
AssertEvalEquals("val", "5")
StepOut()
AssertEvalEquals("threadNum", "2")
AssertEvalEquals("i", "9")

View file

@ -0,0 +1,32 @@
# This test ensure that other threads continue to execute while we execute a method in the debugger
# and it tests that we can execute methods on threads other than those which we had originally stopped on
ShowFile("src/Multithread02.bf")
GotoText("//Thread1_0")
ToggleBreakpoint()
GotoText("//Thread1_1")
ToggleBreakpoint()
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
AssertEvalEquals("doTest = true", "true")
Continue()
AssertEvalEquals("ca.mA", "100")
AssertEvalEquals("sVal0", "1")
AssertEvalEquals("ca.GetValWithWait()", "100")
AssertEvalEquals("sVal0", "2")
SelectThread("")
SelectCallStackWithStr(".DoTest()")
AssertEvalEquals("ca.mA", "9")
AssertEvalEquals("sVal1", "0")
AssertEvalEquals("ca.GetValWithWait()", "9")
AssertEvalEquals("sVal1", "1")
Continue()
SelectThread("")
SelectCallStackWithStr(".DoTest()")
AssertEvalEquals("sVal1", "1")
AssertEvalEquals("ca.GetValWithWait()", "9")
AssertEvalEquals("sVal1", "2")

View file

@ -0,0 +1,12 @@
ShowFile("src/Splats.bf")
GotoText("//SplatTester_SplatC_Call")
ToggleBreakpoint()
RunWithCompiling()
StepInto()
AssertEvalEquals("this", "{ mC='Z' mB=1.2 mA=123 }")
#This fails currently
#AssertEvalEquals("GetB()", "1.2")
StepOver()
AssertEvalEquals("sc.GetB()", "1.2")
AssertEvalEquals("GetC(sc)", "123")

View file

@ -0,0 +1,43 @@
# This tests various cases of hitting breakpoints on the closing brace of a method
# along with stepping onto a return, and stepping into scoped destructors.
ShowFile("src/Stepping_Scope.bf")
GotoText("//Stepping_Scope_Test_Start")
ToggleBreakpoint()
RunWithCompiling()
AssertLineContains("Test1(0)")
GotoText("//Stepping_Scope_Test1_Leave")
ToggleBreakpoint()
Continue()
AssertEvalEquals("a", "2")
StepInto()
AssertLineContains("b = 99")
StepOut()
StepOver()
AssertLineContains("Test1(1)")
StepOver()
AssertEvalEquals("a", "3")
StepInto()
AssertLineContains("b = 99")
StepOut()
StepOver()
AssertLineContains("Test2(0)")
StepInto()
StepOver()
StepOver()
AssertLineContains("scope::")
StepOver()
StepOver()
AssertLineContains("return")
StepOver()
AssertLineContains("}")
StepInto()
AssertLineContains("b = 99")
StepOut()
StepOver()
AssertLineContains("Test2(1)")

View file

@ -0,0 +1,27 @@
ShowFile("src/Unions.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
StepOver()
StepOver()
StepInto()
StepOver()
StepOver()
AssertEvalEquals("a", "12")
AssertEvalEquals("b", "23")
AssertEvalEquals("us.mInnerB.mInnerA.mInt0", "12")
AssertEvalEquals("us.mInnerB.mInnerA.mInt1", "23")
StepOut()
StepOver()
StepOver()
StepInto()
StepOver()
StepOver()
AssertEvalEquals("a2", "1432778632")
AssertEvalEquals("b2", "287454020")
AssertEvalEquals("us.mInnerB.mInnerA.mInt0", "1432778632")
AssertEvalEquals("us.mInnerB.mInnerA.mInt1", "287454020")

View file

@ -0,0 +1,22 @@
# This checks that virtual method calls work in the debugger,
# and also ensures that the virtual indicies properly remap
# after the interface slot count increases between compiles
ShowFile("src/Virtuals.bf")
GotoText("//Test_Start")
ToggleBreakpoint()
RunWithCompiling()
AssertEvalEquals("ca.GetA(9)", "2009")
AssertEvalEquals("cb.GetA(11)", "2011")
AssertEvalEquals("ca.Korf", "234")
AssertEvalEquals("cb.Korf", "234")
StopRunning()
ToggleCommentAt("ClassA_IFaces")
ToggleCommentAt("Test_IFaces")
RunWithCompiling()
AssertEvalEquals("ca.GetA(9)", "2009")
AssertEvalEquals("cb.GetA(11)", "2011")
AssertEvalEquals("ca.Korf", "234")
AssertEvalEquals("cb.Korf", "234")

View file

@ -0,0 +1,25 @@
#pragma warning disable 168
namespace IDETest
{
class Assembly
{
public static int IncVal(ref int val)
{
val++;
return val;
}
public static void Test1()
{
int a = 0;
int d = IncVal(ref a) + IncVal(ref a) + IncVal(ref a);
}
public static void Test()
{
//AssemblyTester_Test
Test1();
}
}
}

View file

@ -0,0 +1,26 @@
using System.Threading;
namespace IDETest
{
class Break
{
public static void Infinite()
{
while (true)
{
//Thread.Sleep(100);
}
}
public static void Test()
{
//Test_Start
int a = 0;
a++;
a++;
a++;
if (a == -1)
Infinite();
}
}
}

View file

@ -0,0 +1,36 @@
#pragma warning disable 168
namespace IDETest
{
class Breakpoints
{
public static void Recurse(int a)
{
int b = 234;
//Recurse_C
int c = 345;
if (a == 10)
return;
Recurse(a + 1);
int d = 100 + a;
}
public static void Test()
{
//BreakpointTester_Test
int a = 0;
int b = 0;
while (a < 20)
{
//BreakpointTester_LoopA
a++;
}
//BreakpointTester_Recurse
Recurse(0);
}
}
}

View file

@ -0,0 +1,27 @@
#pragma warning disable 168
namespace IDETest
{
class Breakpoints02
{
static void MethodA()
{
int a = 0;
for (int i < 3)
{
a++;
//MethodA_1
a++;
//MethodA_2
a++;
a++;
}
}
public static void Test()
{
//Test_Start
MethodA();
}
}
}

View file

@ -0,0 +1,34 @@
#pragma warning disable 168
namespace IDETest
{
enum EnumA
{
case A(int a);
case B(float b);
}
enum EnumB
{
case A;
case B;
case C;
}
class EnumTester
{
public static void Test()
{
EnumA ea = .B(1.2f);
let z = (aa:123, bb:345);
var q = (a:234, 567, c:999);
var qRef = ref q;
EnumB eb = .B;
//EnumTester_Test
}
}
}

View file

@ -0,0 +1,248 @@
using System.Diagnostics;
using System;
#pragma warning disable 168
namespace IDETest
{
interface IHot
{
int IHotA();
/*IHot_IHotB
int IHotB();
*/
}
class HotA : IHot
{
public virtual int MethodA()
{
return 10;
}
//*HotA_MethodB
public virtual int MethodB()
{
return 11;
}
/*@*/
/*HotA_MethodC
public virtual int MethodC()
{
return 12;
}
*/
// Note- this is purposely beneath MethodC
/*HotA_MethodB_2
public virtual int MethodB()
{
return 111;
}
*/
/*HotA_MethodD
public virtual int MethodD()
{
return 13;
}
*/
public virtual int MethodE()
{
return 14;
}
public int IHotA()
{
return 15;
}
public int IHotB()
{
return 16;
}
}
class HotB : HotA
{
public override int MethodA()
{
//HotB_MethodA_Return
return 20;
}
/*HotB_MethodB_Start
public override int MethodB()
{
return 21;
}
*/
/*HotB_MethodC_Start
public override int MethodC()
{
return 22;
}
*/
}
class HotTester
{
public void Test2(HotA hot)
{
/*HotTester_Test2
int val = hot.MethodC();
*/
}
public void Test3(HotA hot)
{
/*HotTester_Test3
int val = hot.MethodE();
*/
}
public void Test1()
{
//*HotTester_Test1
HotA hot = scope HotB();
//HotStart
int val = hot.MethodA();
val = hot.MethodB();
val = hot.MethodB();
Test2(hot);
//HotTester_Test1_EndTest
val = 99;
Test3(hot);
/*@*/
}
public void TestVirtualRemap2(HotA hot)
{
/*HotTester_TestVirtualRemap2_MethodCCall
int val = hot.MethodC();
*/
}
public void TestVirtualRemap()
{
//HotStart_VirtualRemap
HotA hot = scope HotB();
//*HotTester_TestVirtualRemap_MethodBCall
int val = hot.MethodB();
/*@*/
TestVirtualRemap2(hot);
//*HotTester_TestVirtualRemap_MethodBCall_2
val = hot.MethodB();
/*@*/
}
static public int TestFuncs_Func()
{
//HotTester_TestFuncs_Func_Return
return 123;
}
/*HotTester_TestFuncs_Func2
static public int TestFuncs_Func2()
{
//HotTester_TestFuncs_Func2_Return
return 444;
}
*/
public void TestFuncs_Compare(HotA hot, delegate int() dlgA0, delegate int() dlgT0, function int() funcT0)
{
delegate int() dlgA1 = scope => hot.MethodA;
delegate int() dlgT1 = scope => TestFuncs_Func;
function int() funcT1 = => TestFuncs_Func;
Debug.Assert(Delegate.Equals(dlgA0, dlgA1));
Debug.Assert(Delegate.Equals(dlgT0, dlgT1));
Debug.Assert(funcT0 == funcT1);
//TestFuncs_Compare_Calls
int val = dlgA0();
val = dlgT0();
val = funcT0();
}
public void TestFuncs()
{
//HotStart_Funcs
HotA hot = scope HotB();
//Debug.WriteLine("Result: {0}", hot);
delegate int() dlgA0 = scope => hot.MethodA;
delegate int() dlgT0 = scope => TestFuncs_Func;
function int() funcT0 = => TestFuncs_Func;
TestFuncs_Compare(hot, dlgA0, dlgT0, funcT0);
}
public void TestFuncs2_Compare(function int() funcT0)
{
/*TestFuncs2_Compare_Body
function int() funcT1 = => TestFuncs_Func2;
Debug.Assert(funcT1 == funcT0);
*/
int val = funcT0();
}
public void TestFuncs2()
{
/*TestFuncs2_Body
function int() funcT0 = => TestFuncs_Func2;
TestFuncs2_Compare(funcT0);
*/
}
public void TestIHotA(HotA hot)
{
/*HotTester_TestIHotA
IHot ihot = hot;
int val = ihot.IHotA();
*/
}
public void TestIHotB(HotA hot)
{
/*HotTester_TestIHotB
IHot ihot = hot;
int val = ihot.IHotB();
*/
}
public void TestInterfaces()
{
//HotStart_Interfaces
HotA hot = scope HotB();
TestIHotA(hot);
TestIHotB(hot);
}
public static void Test()
{
//Test_Start
HotTester ht = scope .();
ht.Test1();
ht.Test1();
ht.TestVirtualRemap();
ht.TestFuncs();
ht.TestFuncs2();
ht.TestInterfaces();
}
}
}

View file

@ -0,0 +1,143 @@
#pragma warning disable 168
namespace IDETest
{
class HotSwap_BaseChange
{
class ClassA
{
public virtual int MethodA0()
{
return 100;
}
public virtual int MethodA1()
{
return 101;
}
}
class ClassB
{
public virtual int MethodB0()
{
return 200;
}
/*ClassB_MethodB1
public virtual int MethodB1()
{
return 201;
}
*/
}
/*ClassC_0
class ClassC : ClassA
{
public virtual int MethodC0()
{
return 300;
}
}
*/
/*ClassC_1
class ClassC : ClassB
{
public virtual int MethodC0()
{
return 300;
}
}
*/
/*ClassC_2
class ClassC : ClassB
{
public virtual int MethodC0()
{
return 1300;
}
public virtual int MethodC1()
{
return 1301;
}
}
*/
/*ClassC_3
class ClassC : ClassA
{
// FAILS
public this() : base(123)
{
}
public virtual int MethodC0()
{
return 300;
}
}
*/
static void DoTest0()
{
/*DoTest0_Body
ClassC cc = scope .();
int a0 = cc.MethodA0();
int a1 = cc.MethodA1();
int c0 = cc.MethodC0();
*/
}
static void DoTest1()
{
/*DoTest1_Body
ClassC cc = scope .();
int b0 = cc.MethodB0();
int c0 = cc.MethodC0();
b0 = cc.MethodB0();
c0 = cc.MethodC0();
DoTest2(cc);
*/
}
/*DoTest2_Decl
static void DoTest2(ClassC cc)
{
/*DoTest2_Body
int b0 = cc.MethodB0();
int b1 = cc.MethodB1();
int c0 = cc.MethodC0();
int c1 = cc.MethodC1();
*/
}
*/
static void DoTest3()
{
/*DoTest3_Body
ClassC cc = scope .();
*/
}
public static void Test()
{
// Reify these methods and types
ClassA ca = scope .();
ca.MethodA0();
ca.MethodA1();
ClassB cb = scope .();
cb.MethodB0();
int a = 0;
//Test_Start
DoTest0();
DoTest1();
DoTest3();
}
}
}

View file

@ -0,0 +1,137 @@
#pragma warning disable 168
using System;
using System.Diagnostics;
namespace IDETest
{
class HotSwap_Data
{
struct StructA
{
public int mA = 100;
/*StructA_mA2
public int mA2 = 101;
*/
/*StructA_mA3
public int mA3 = 102;
*/
}
struct StructB
{
public int mB;
}
struct StructC : StructA
{
public StructB mSB;
public int mC;
}
interface IFaceA
{
void IMethodA();
}
interface IFaceB
{
void IMethodB();
}
class ClassA : IFaceA
{
public void IMethodA()
{
}
}
class ClassB : IFaceB
{
public void IMethodB()
{
}
}
class ClassC :
//*ClassC_IFaceA
IFaceA
/*@*/
/*ClassC_IFaceB_WithoutComma
IFaceB
*/
/*ClassC_IFaceB_WithComma
, IFaceB
*/
{
public void IMethodA()
{
}
public void IMethodB()
{
}
}
static void Test01()
{
StructC sc = .();
/*Test01_mA2
int val = sc.mA2;
*/
}
//*Func
[AlwaysInclude]
static void Func()
{
StructA sa = .();
}
/*@*/
static void Test02()
{
}
static void Test03()
{
/*Test03_delegate
delegate void() funcPtr = new => Func;
Console.WriteLine("Delegate: {0}", funcPtr);
*/
}
static void Test04()
{
ClassA ca = scope .();
IFaceA ia = ca;
ia.IMethodA();
ClassB cb = scope .();
IFaceB ib = cb;
ib.IMethodB();
ClassC cc = scope .();
}
public static void Test()
{
/*Test_funcPtr
function void() funcPtr = => Func;
*/
int a = 0;
//Test_Test01
Test01();
Test01();
//Test_Test02
Test02();
//Test_Test03
Test03();
Test03();
//Test_Test04
Test04();
}
}
}

View file

@ -0,0 +1,36 @@
#pragma warning disable 168
namespace IDETest
{
class HotSwap_GetUnusued
{
class ClassA
{
public void MethodA()
{
}
public int MethodB()
{
return 123;
}
}
public static void DoTest()
{
ClassA ca = scope .();
ca.MethodA();
/*DoTest_MethodB
int val = ca.MethodB();
*/
}
public static void Test()
{
int a = 123;
//Test
DoTest();
}
}
}

View file

@ -0,0 +1,46 @@
#pragma warning disable 168
namespace IDETest
{
class HotSwap_Interfaces2
{
interface IFaceA
{
int Method0();
/*IFaceA_Method1
int Method1();
*/
}
class ClassA : IFaceA
{
public int Method0()
{
return 11;
}
/*ClassA_Method1
public int Method1()
{
return 22;
}
*/
}
static void Test1(IFaceA ia)
{
/*Test1_Method1
int v1 = ia.Method1();
*/
}
public static void Test()
{
ClassA ca = scope .();
IFaceA ia = ca;
//Test_Start
int v0 = ia.Method0();
Test1(ia);
}
}
}

View file

@ -0,0 +1,37 @@
#pragma warning disable 168
using System;
namespace IDETest
{
class HotSwap_Reflection
{
[Reflect]
class ClassA
{
int mA;//ClassA_mA
public static Type GetMyType()
{
return typeof(ClassA);
}
}
public static void Test()
{
//Test_Start
let t0 = ClassA.GetMyType();
for (let field in t0.GetFields())
{
}
let t1 = ClassA.GetMyType();
for (let field in t1.GetFields())
{
}
let t2 = ClassA.GetMyType();
for (let field in t2.GetFields())
{
}
}
}
}

View file

@ -0,0 +1,95 @@
#pragma warning disable 168
using System;
using System.Threading;
using System.Diagnostics;
namespace IDETest
{
class HotSwap_TLS
{
class ClassA
{
[ThreadStatic]
public static int sTLS0;
/*ClassA_TLS1
[ThreadStatic]
public static int sTLS1;
*/
}
static Monitor sMonitor = new .() ~ delete _;
static WaitEvent sEvent = new .() ~ delete _;
static WaitEvent sDoneEvent = new .() ~ delete _;
static int sThreadResult;
public static int Inc0()
{
return ++ClassA.sTLS0;
}
public static int Inc1()
{
/*Inc1_TLS1
return ++ClassA.sTLS1;
*/
#unwarn
return -1;
}
public static void Thread0()
{
sEvent.WaitFor();
sThreadResult = Inc0();
sDoneEvent.Set();
sEvent.WaitFor();
sThreadResult = Inc0();
sDoneEvent.Set();
sEvent.WaitFor();
sThreadResult = Inc1();
sDoneEvent.Set();
sEvent.WaitFor();
sThreadResult = Inc1();
sDoneEvent.Set();
}
public static void Test()
{
//Test_Start
let thread = scope Thread(new => Thread0);
thread.Start(false);
int val = Inc0();
val = Inc0();
val = Inc0();
Debug.Assert(val == 3);
sEvent.Set();
sDoneEvent.WaitFor();
Debug.Assert(sThreadResult == 1);
sEvent.Set();
sDoneEvent.WaitFor();
Debug.Assert(sThreadResult == 2);
val = Inc1();
val = Inc1();
val = Inc1();
NOP!();//Debug.Assert(val == 3);
sEvent.Set();
sDoneEvent.WaitFor();
NOP!();//Debug.Assert(sThreadResult == 1);
sEvent.Set();
sDoneEvent.WaitFor();
NOP!();//Debug.Assert(sThreadResult == 2);
thread.Join();
}
}
}

View file

@ -0,0 +1,60 @@
#pragma warning disable 168
using System;
namespace IDETest
{
class InlineTester
{
[Inline]
public static int TimesTwo(int a)
{
return a * 2;
}
[Inline]
public static int Add(int a, int b)
{
int retVal = TimesTwo(a);
retVal += TimesTwo(b);
return retVal;
}
public static int PlusOne(int a)
{
return a + 1;
}
public static mixin MixB(var argC)
{
argC = PlusOne(argC);
argC
}
public static mixin MixA(var argA, var argB)
{
int z = MixB!(argA);
argA + argB
}
public static void TestInlines()
{
int a = 123;
int b = 234;
int d = Add(a, b);
}
public static void Test()
{
int a = 10;
int b = 2;
//InlineTester
int c = MixA!(a, b);
TestInlines();
}
}
}

View file

@ -0,0 +1,31 @@
#pragma warning disable 168
namespace IDETest
{
class LambdaTester
{
public int mA = 123;
public int mB = 234;
public void Test1()
{
int outerVar = 88;
delegate int(int argA0) dlg = scope (argA1) =>
{
int a = mA;
int b = outerVar;
return 222;
};
//LambdaTest_Test1
dlg(99);
}
public static void Test()
{
LambdaTester lt = scope .();
lt.Test1();
}
}
}

View file

@ -0,0 +1,23 @@
#pragma warning disable 168
namespace IDETest
{
class MemoryBreakpointTester
{
int mA;
public static void Test()
{
//MemoryBreakpointTester_Test
MemoryBreakpointTester mbt = scope .();
int a = 0;
mbt.mA++;
a++;
a++;
mbt.mA++;
a++;
a++;
}
}
}

View file

@ -0,0 +1,62 @@
namespace IDETest
{
class Methods
{
class ClassA
{
public int TEST_MethodA()
{
return 200;
}
public int TEST_MethodB()
{
return 201;
}
/*ClassA_MethodC
public int TEST_MethodC()
{
return 202;
}
*/
public static int TEST_StaticMethodA()
{
return 100;
}
public static int TEST_StaticMethodB()
{
return 101;
}
/*ClassA_StaticMethodC
public static int TEST_StaticMethodC()
{
return 102;
}
*/
}
public static void DoTest()
{
/*DoTest_Body
ClassA ca = scope .();
ca.TEST_MethodB();
ca.TEST_MethodC();
ClassA.TEST_StaticMethodB();
ClassA.TEST_StaticMethodC();
*/
}
public static void Test()
{
//Test_Start
ClassA ca = scope .();
ca.TEST_MethodA();
ClassA.TEST_StaticMethodA();
DoTest();
}
}
}

View file

@ -0,0 +1,45 @@
using System;
#pragma warning disable 168
namespace IDETest
{
class Mixins
{
class ClassA
{
public String mStr;
}
public static mixin MixA(int a)
{
int b = a + 10;
b + 100
}
public static mixin MixB(int a)
{
int c = MixA!(a + 10000);
int d = MixA!(a + 20000);
int e = MixA!(a + 30000);
}
public static mixin MixC(int a)
{
int b = 100;
MixB!(b);
MixB!(b + 1000);
}
public static void Test()
{
//Test_Start
ClassA ca = scope .();
ca.mStr = new String("Boof");
DeleteAndNullify!(ca.mStr);
int a = 123;
MixC!(1);
}
}
}

View file

@ -0,0 +1,79 @@
#pragma warning disable 168
using System.Threading;
using System;
namespace IDETest
{
class Multithread
{
public bool mDone;
public WaitEvent mStartedProc = new WaitEvent() ~ delete _;
//TODO: Doesn't work with anything other than 0
[ThreadStatic]
public static int sLocalVal = 0;
public void DoRecurse(int depth, ref int val)
{
Thread.Sleep(1);
++val;
if (val < 5)
{
DoRecurse(depth + 1, ref val);
}
}
public void ThreadFunc(Object obj)
{
int threadNum = (int)obj;
sLocalVal++;
String threadName = scope .();
Thread.CurrentThread.GetName(threadName);
mStartedProc.Set();
//ThreadFunc
int val = 0;
for (int i < 200)
{
val = 0; DoRecurse(0, ref val);
Thread.Sleep(1);
}
}
public static void Test()
{
//MultithreadTester_Test
bool doTest = false;
if (!doTest)
{
return;
}
Multithread mt = scope Multithread();
Thread threadA = scope .(new => mt.ThreadFunc);
threadA.SetName("ThreadA");
threadA.Start(0, false);
mt.mStartedProc.WaitFor();
Thread threadB = scope .(new => mt.ThreadFunc);
threadB.SetName("ThreadB");
threadB.Start(1, false);
mt.mStartedProc.WaitFor();
Thread threadC = scope .(new => mt.ThreadFunc);
threadC.SetName("ThreadC");
threadC.Start(2, false);
mt.mStartedProc.WaitFor();
threadA.Join();
threadB.Join();
threadC.Join();
int a = 99;
}
}
}

View file

@ -0,0 +1,71 @@
#pragma warning disable 168
using System.Threading;
using System;
namespace IDETest
{
class Multithread02
{
public static WaitEvent sEvent0 = new WaitEvent() ~ delete _;
public static WaitEvent sEvent1 = new WaitEvent() ~ delete _;
public static int sVal0;
public static int sVal1;
class ClassA
{
public int mA;
[AlwaysInclude]
public int GetValWithWait()
{
Thread.Sleep(1000);
return mA;
}
}
public static void Thread1()
{
Thread.CurrentThread.SetName("Test_Thread1");
ClassA ca = scope .();
ca.mA = 100;
Thread.Sleep(100);
//Thread1_0
sEvent0.Set();
Interlocked.Increment(ref sVal1);
sEvent1.WaitFor();
//Thread1_1
Interlocked.Increment(ref sVal1);
}
public static void DoTest()
{
ClassA ca = scope .();
ca.mA = 9;
Thread thread1 = scope .(new => Thread1);
thread1.Start(false);
Interlocked.Increment(ref sVal0);
Thread.Sleep(500);
Interlocked.Increment(ref sVal0);
sEvent0.WaitFor();
sEvent1.Set();
thread1.Join();
}
public static void Test()
{
//Test_Start
bool doTest = false;
if (doTest)
{
DoTest();
}
}
}
}

View file

@ -0,0 +1,35 @@
namespace IDETest
{
class Program
{
static void Main()
{
Assembly.Test();
Break.Test();
Breakpoints.Test();
Breakpoints02.Test();
EnumTester.Test();
HotTester.Test();
HotSwap_BaseChange.Test();
HotSwap_Data.Test();
HotSwap_GetUnusued.Test();
HotSwap_Interfaces2.Test();
HotSwap_Reflection.Test();
HotSwap_TLS.Test();
InlineTester.Test();
LambdaTester.Test();
Methods.Test();
Mixins.Test();
Multithread.Test();
Multithread02.Test();
MemoryBreakpointTester.Test();
SplatTester.Test();
Stepping_Scope.Test();
Unions.Test();
Virtuals.Test();
Bug001.Test();
Bug002.Test();
}
}
}

View file

@ -0,0 +1,48 @@
namespace IDETest
{
struct SplatA
{
public int mA;
}
struct SplatB : SplatA
{
public float mB;
}
struct SplatC : SplatB
{
public char8 mC;
public void DoTest()
{
}
public float GetB()
{
return mB;
}
}
class SplatTester
{
public static int GetC(SplatC sc)
{
return sc.mA;
}
public static void Test()
{
SplatC sc = .();
sc.mA = 123;
sc.mB = 1.2f;
sc.mC = 'Z';
//SplatTester_SplatC_Call
sc.DoTest();
sc.GetB();
GetC(sc);
}
}
}

View file

@ -0,0 +1,55 @@
#pragma warning disable 168
namespace IDETest
{
class Stepping_Scope
{
class ClassA
{
public ~this()
{
int b = 99;
}
}
static void Test1(int inVal)
{
int a = 1;
var ca = scope ClassA();
if (inVal == 0)
{
a = 2;
return;
}
a = 3;
//Stepping_Scope_Test1_Leave
}
static void Test2(int inVal)
{
int a = 1;
if (inVal == 0)
{
var ca = scope:: ClassA();
a = 2;
return;
}
a = 3;
//Stepping_Scope_Test1_Leave
}
public static void Test()
{
//Stepping_Scope_Test_Start
Test1(0);
Test1(1);
Test2(0);
Test2(1);
}
}
}

View file

@ -0,0 +1,58 @@
#pragma warning disable 168
using System;
namespace IDETest
{
class Unions
{
struct InnerA
{
public int32 mInt0;
public int32 mInt1;
}
struct InnerB
{
public InnerA mInnerA;
}
[Union]
struct UStruct
{
public InnerB mInnerB;
}
[Union]
struct UStruct2
{
public InnerB mInnerB;
public int64 mFullInt;
}
public static void UseUnion(UStruct us)
{
int a = us.mInnerB.mInnerA.mInt0;
int b = us.mInnerB.mInnerA.mInt1;
}
public static void UseUnion2(UStruct2 us)
{
int a2 = us.mInnerB.mInnerA.mInt0;
int b2 = us.mInnerB.mInnerA.mInt1;
}
public static void Test()
{
//Test_Start
UStruct us;
us.mInnerB.mInnerA.mInt0 = 12;
us.mInnerB.mInnerA.mInt1 = 23;
UseUnion(us);
UStruct2 us2;
us2..mFullInt = 0x11223344'55667788;
UseUnion2(us2);
}
}
}

View file

@ -0,0 +1,99 @@
#pragma warning disable 168
namespace IDETest
{
class Virtuals
{
class ClassA
{
public virtual int GetA(int a)
{
return a + 1000;
}
public virtual int Korf
{
get
{
return 123;
}
}
}
interface IFaceA
{
int GetA()
{
return 11;
}
}
interface IFaceB
{
int GetB()
{
return 22;
}
}
interface IFaceC
{
int GetC()
{
return 33;
}
}
interface IFaceD
{
int GetD()
{
return 44;
}
}
//#define A
class ClassB : ClassA
/*ClassA_IFaces
, IFaceA, IFaceB, IFaceC, IFaceD
*/
{
public override int GetA(int a)
{
PrintF("Skoof GetA\n");
return a + 2000;
}
public override int Korf
{
get
{
PrintF("Skoof Korf\n");
return 234;
}
}
}
public static void Test()
{
ClassB cb = scope .();
ClassA ca = cb;
/*Test_IFaces
IFaceA ia = cb;
ia.GetA();
IFaceB ib = cb;
ib.GetB();
IFaceC ic = cb;
ic.GetC();
IFaceD id = cb;
id.GetD();
*/
//Test_Start
int c = ca.GetA(99);
int d = ca.Korf;
}
}
}

View file

@ -0,0 +1,32 @@
#pragma warning disable 168
using System;
class Bug001
{
class ClassA
{
public String mStrA;
public String mStrB;
public bool mCheck;
public void DoTest()
{
int a = 123;
int b = 234;
if (mCheck)
return;
//Bug001_DoTest
while (mCheck)
{
}
}
}
public static void Test()
{
ClassA ca = scope .();
ca.DoTest();
}
}

View file

@ -0,0 +1,23 @@
#pragma warning disable 168
using System;
class Bug002
{
public static void Parse(String[] strs)
{
for (let val in strs)
{
}
int val2 = 999;
}
public static void Test()
{
var strs = scope String[] {"aaa", "bbb", "ccc"};
//Bug002_DoTest
Parse(strs);
};
}