[lldb] Readd deleted variable in the sample test

In D102771 wanted to make `test_var` global to demonstrate the a no-launch test,
but the old variable is still needed for another test. This just creates the
global var with a different name to demonstrate the no-launch functionality.
This commit is contained in:
Raphael Isemann 2021-05-24 16:24:45 +02:00
parent 54c2687292
commit 5d7c1d8f33
2 changed files with 4 additions and 3 deletions

View File

@ -50,4 +50,4 @@ class RenameThisSampleTestTestCase(TestBase):
""" Same as above but doesn't launch a process."""
target = self.createTestTarget()
self.expect_expr("test_var", result_value="10")
self.expect_expr("global_test_var", result_value="10")

View File

@ -1,14 +1,15 @@
#include <stdio.h>
int test_var = 10;
int global_test_var = 10;
int
main()
{
int test_var = 10;
printf ("Set a breakpoint here: %d.\n", test_var);
//% test_var = self.frame().FindVariable("test_var")
//% test_value = test_var.GetValueAsUnsigned()
//% self.assertTrue(test_var.GetError().Success(), "Failed to fetch test_var")
//% self.assertEqual(test_value, 10, "Failed to get the right value for test_var")
return 0;
return global_test_var;
}