From 1ac383c68de9bf1e5b886eafde532d9fd99468f4 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Tue, 6 Sep 2011 20:32:42 +0000 Subject: [PATCH] Test should print to stdout only if self.TraceOn() is True. llvm-svn: 139174 --- lldb/test/python_api/sbdata/TestSBData.py | 30 +++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lldb/test/python_api/sbdata/TestSBData.py b/lldb/test/python_api/sbdata/TestSBData.py index 29e201df26d3..1dffcc0980e7 100644 --- a/lldb/test/python_api/sbdata/TestSBData.py +++ b/lldb/test/python_api/sbdata/TestSBData.py @@ -56,11 +56,13 @@ class SBDataAPICase(TestBase): foobar = frame.FindVariable('foobar') - print foobar + if self.TraceOn(): + print foobar data = foobar.GetPointeeData(0, 2) - print data + if self.TraceOn(): + print data offset = 0 error = lldb.SBError() @@ -99,7 +101,8 @@ class SBDataAPICase(TestBase): data = star_foobar.GetData() - print data + if self.TraceOn(): + print data offset = 0 self.assertTrue(data.GetUnsignedInt32(error, offset) == 1, 'foo[0].a == 1') @@ -111,11 +114,13 @@ class SBDataAPICase(TestBase): new_foobar = foobar.CreateValueFromAddress("f00", foobar_addr, star_foobar.GetType()) - print new_foobar + if self.TraceOn(): + print new_foobar data = new_foobar.GetData() - print data + if self.TraceOn(): + print data offset = 0 self.assertTrue(data.GetUnsignedInt32(error, offset) == 8, 'then foo[1].a == 8') @@ -135,7 +140,8 @@ class SBDataAPICase(TestBase): data = new_foobar.GetData() - print data + if self.TraceOn(): + print data offset = 0 self.assertTrue(data.GetUnsignedInt32(error, offset) == 8, 'finally foo[1].a == 8') @@ -150,9 +156,11 @@ class SBDataAPICase(TestBase): data = barfoo.GetData() - print barfoo + if self.TraceOn(): + print barfoo - print data + if self.TraceOn(): + print data offset = 0 self.assertTrue(data.GetUnsignedInt32(error, offset) == 1, 'barfoo[0].a = 1') @@ -169,7 +177,8 @@ class SBDataAPICase(TestBase): new_object = barfoo.CreateValueFromData("new_object",data,barfoo.GetType().GetBasicType(lldb.eBasicTypeInt)) - print new_object + if self.TraceOn(): + print new_object self.assertTrue(new_object.GetLoadAddress() == 0xFFFFFFFFFFFFFFFF, 'GetLoadAddress() == invalid') self.assertTrue(new_object.AddressOf().IsValid() == False, 'AddressOf() == invalid') @@ -184,7 +193,8 @@ class SBDataAPICase(TestBase): data.Append(data2) - print data + if self.TraceOn(): + print data # this breaks on EBCDIC offset = 0