@@ -298,7 +298,7 @@ def do_test_scopes_variables_setVariable_evaluate(
298
298
# Set a variable value whose name is synthetic, like a variable index
299
299
# and verify the value by reading it
300
300
variable_value = 100
301
- response = self .dap_server . request_setVariable (varRef , "[0]" , variable_value )
301
+ response = self .set_variable (varRef , "[0]" , variable_value )
302
302
# Verify dap sent the correct response
303
303
verify_response = {
304
304
"type" : "int" ,
@@ -315,7 +315,7 @@ def do_test_scopes_variables_setVariable_evaluate(
315
315
# Set a variable value whose name is a real child value, like "pt.x"
316
316
# and verify the value by reading it
317
317
varRef = varref_dict ["pt" ]
318
- self .dap_server . request_setVariable (varRef , "x" , 111 )
318
+ self .set_variable (varRef , "x" , 111 )
319
319
response = self .dap_server .request_variables (varRef , start = 0 , count = 1 )
320
320
value = response ["body" ]["variables" ][0 ]["value" ]
321
321
self .assertEqual (
@@ -341,27 +341,15 @@ def do_test_scopes_variables_setVariable_evaluate(
341
341
self .verify_variables (verify_locals , self .dap_server .get_local_variables ())
342
342
343
343
# 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" ])
348
346
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" ])
358
350
359
351
# 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" ])
365
353
366
354
verify_locals ["x @ main.cpp:19" ]["equals" ]["value" ] = "19"
367
355
verify_locals ["x @ main.cpp:21" ]["equals" ]["value" ] = "21"
@@ -370,7 +358,7 @@ def do_test_scopes_variables_setVariable_evaluate(
370
358
self .verify_variables (verify_locals , self .dap_server .get_local_variables ())
371
359
372
360
# 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" ])
374
362
verify_locals ["x @ main.cpp:23" ]["equals" ]["value" ] = "22"
375
363
376
364
self .verify_variables (verify_locals , self .dap_server .get_local_variables ())
@@ -708,9 +696,7 @@ def test_return_variables(self):
708
696
self .verify_variables (verify_locals , local_variables , varref_dict )
709
697
break
710
698
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" ])
714
700
715
701
@skipIfWindows
716
702
def test_indexedVariables (self ):
0 commit comments