forked from OSchip/llvm-project
[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:
parent
54c2687292
commit
5d7c1d8f33
|
@ -50,4 +50,4 @@ class RenameThisSampleTestTestCase(TestBase):
|
||||||
""" Same as above but doesn't launch a process."""
|
""" Same as above but doesn't launch a process."""
|
||||||
|
|
||||||
target = self.createTestTarget()
|
target = self.createTestTarget()
|
||||||
self.expect_expr("test_var", result_value="10")
|
self.expect_expr("global_test_var", result_value="10")
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int test_var = 10;
|
int global_test_var = 10;
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
|
int test_var = 10;
|
||||||
printf ("Set a breakpoint here: %d.\n", test_var);
|
printf ("Set a breakpoint here: %d.\n", test_var);
|
||||||
//% test_var = self.frame().FindVariable("test_var")
|
//% test_var = self.frame().FindVariable("test_var")
|
||||||
//% test_value = test_var.GetValueAsUnsigned()
|
//% test_value = test_var.GetValueAsUnsigned()
|
||||||
//% self.assertTrue(test_var.GetError().Success(), "Failed to fetch test_var")
|
//% 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")
|
//% self.assertEqual(test_value, 10, "Failed to get the right value for test_var")
|
||||||
return 0;
|
return global_test_var;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue