HotSwap_VirtualRemap.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # This test fails on Win32 currently
  2. if (platform != "Win64") Stop()
  3. # Tests that even when removing an old virtual method, adding a new one, and then
  4. # adding back a method with the same name as the old one, we can call this new
  5. # method using an old virtual call
  6. ShowFile("src/HotSwap.bf")
  7. GotoText("//HotStart_VirtualRemap")
  8. ToggleBreakpoint()
  9. RunWithCompiling()
  10. # Turn off MethodB
  11. ToggleCommentAt("HotA_MethodB")
  12. ToggleCommentAt("HotTester_Test1")
  13. ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall")
  14. ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall_2")
  15. Compile()
  16. # Make sure we can call the old 'MethodB'
  17. StepOver()
  18. StepOver()
  19. AssertEvalEquals("val", "11")
  20. # Turn on MethodC
  21. ShowCurrent()
  22. ToggleCommentAt("HotA_MethodC")
  23. ToggleCommentAt("HotTester_TestVirtualRemap2_MethodCCall")
  24. Compile()
  25. StepInto()
  26. StepOver()
  27. AssertEvalEquals("val", "12")
  28. # Turn on MethodB (version 2)
  29. ToggleCommentAt("HotA_MethodB_2")
  30. ToggleCommentAt("HotTester_TestVirtualRemap_MethodBCall")
  31. Compile()
  32. StepOver()
  33. StepOver()
  34. # We are running an old version of TestVirtualRemap that used the old virtual slot
  35. # number for the MethodB call, but the new MethodB should be mapped to that same
  36. # slot because it mangles the same
  37. AssertEvalEquals("val", "111")