@@ -298,7 +298,7 @@ def do_test_scopes_variables_setVariable_evaluate(
298298 # Set a variable value whose name is synthetic, like a variable index
299299 # and verify the value by reading it
300300 variable_value = 100
301- response = self .dap_server . request_setVariable (varRef , "[0]" , variable_value )
301+ response = self .set_variable (varRef , "[0]" , variable_value )
302302 # Verify dap sent the correct response
303303 verify_response = {
304304 "type" : "int" ,
@@ -315,7 +315,7 @@ def do_test_scopes_variables_setVariable_evaluate(
315315 # Set a variable value whose name is a real child value, like "pt.x"
316316 # and verify the value by reading it
317317 varRef = varref_dict ["pt" ]
318- self .dap_server . request_setVariable (varRef , "x" , 111 )
318+ self .set_variable (varRef , "x" , 111 )
319319 response = self .dap_server .request_variables (varRef , start = 0 , count = 1 )
320320 value = response ["body" ]["variables" ][0 ]["value" ]
321321 self .assertEqual (
@@ -341,27 +341,15 @@ def do_test_scopes_variables_setVariable_evaluate(
341341 self .verify_variables (verify_locals , self .dap_server .get_local_variables ())
342342
343343 # Now we verify that we correctly change the name of a variable with and without differentiator suffix
344- self .assertFalse (self .dap_server .request_setVariable (1 , "x2" , 9 )["success" ])
345- self .assertFalse (
346- self .dap_server .request_setVariable (1 , "x @ main.cpp:0" , 9 )["success" ]
347- )
344+ self .assertFalse (self .set_local ("x2" , 9 )["success" ])
345+ self .assertFalse (self .set_local ("x @ main.cpp:0" , 9 )["success" ])
348346
349- self .assertTrue (
350- self .dap_server .request_setVariable (1 , "x @ main.cpp:19" , 19 )["success" ]
351- )
352- self .assertTrue (
353- self .dap_server .request_setVariable (1 , "x @ main.cpp:21" , 21 )["success" ]
354- )
355- self .assertTrue (
356- self .dap_server .request_setVariable (1 , "x @ main.cpp:23" , 23 )["success" ]
357- )
347+ self .assertTrue (self .set_local ("x @ main.cpp:19" , 19 )["success" ])
348+ self .assertTrue (self .set_local ("x @ main.cpp:21" , 21 )["success" ])
349+ self .assertTrue (self .set_local ("x @ main.cpp:23" , 23 )["success" ])
358350
359351 # The following should have no effect
360- self .assertFalse (
361- self .dap_server .request_setVariable (1 , "x @ main.cpp:23" , "invalid" )[
362- "success"
363- ]
364- )
352+ self .assertFalse (self .set_local ("x @ main.cpp:23" , "invalid" )["success" ])
365353
366354 verify_locals ["x @ main.cpp:19" ]["equals" ]["value" ] = "19"
367355 verify_locals ["x @ main.cpp:21" ]["equals" ]["value" ] = "21"
@@ -370,7 +358,7 @@ def do_test_scopes_variables_setVariable_evaluate(
370358 self .verify_variables (verify_locals , self .dap_server .get_local_variables ())
371359
372360 # The plain x variable shold refer to the innermost x
373- self .assertTrue (self .dap_server . request_setVariable ( 1 , "x" , 22 )["success" ])
361+ self .assertTrue (self .set_local ( "x" , 22 )["success" ])
374362 verify_locals ["x @ main.cpp:23" ]["equals" ]["value" ] = "22"
375363
376364 self .verify_variables (verify_locals , self .dap_server .get_local_variables ())
@@ -708,9 +696,7 @@ def test_return_variables(self):
708696 self .verify_variables (verify_locals , local_variables , varref_dict )
709697 break
710698
711- self .assertFalse (
712- self .dap_server .request_setVariable (1 , "(Return Value)" , 20 )["success" ]
713- )
699+ self .assertFalse (self .set_local ("(Return Value)" , 20 )["success" ])
714700
715701 @skipIfWindows
716702 def test_indexedVariables (self ):
0 commit comments