[Lldb-commits] [lldb] r107724 - in /lldb/trunk/test: array_types/TestArrayTypes.py class_types/TestClassTypes.py function_types/TestFunctionTypes.py global_variables/TestGlobalVariables.py

Johnny Chen johnny.chen at apple.com
Tue Jul 6 16:26:16 PDT 2010


Author: johnny
Date: Tue Jul  6 18:26:16 2010
New Revision: 107724

URL: http://llvm.org/viewvc/llvm-project?rev=107724&view=rev
Log:
if -1 => evaluates to True

oops!

Modified:
    lldb/trunk/test/array_types/TestArrayTypes.py
    lldb/trunk/test/class_types/TestClassTypes.py
    lldb/trunk/test/function_types/TestFunctionTypes.py
    lldb/trunk/test/global_variables/TestGlobalVariables.py

Modified: lldb/trunk/test/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/array_types/TestArrayTypes.py?rev=107724&r1=107723&r2=107724&view=diff
==============================================================================
--- lldb/trunk/test/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/array_types/TestArrayTypes.py Tue Jul  6 18:26:16 2010
@@ -30,13 +30,13 @@
         self.ci.HandleCommand("thread list", res)
         print "thread list ->", res.GetOutput()
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find('state is Stopped') and
-                        res.GetOutput().find('stop reason = breakpoint'))
+        self.assertTrue(res.GetOutput().find('state is Stopped') > 0 and
+                        res.GetOutput().find('stop reason = breakpoint') > 0)
 
         # The breakpoint should have a hit count of 1.
         self.ci.HandleCommand("breakpoint list", res)
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find('resolved, hit count = 1'))
+        self.assertTrue(res.GetOutput().find('resolved, hit count = 1') > 0)
 
         # Issue 'variable list' command on several array-type variables.
 
@@ -44,19 +44,19 @@
         self.assertTrue(res.Succeeded())
         output = res.GetOutput()
         self.assertTrue(output.startswith('(char *[4])') and
-                        output.find('(char *) strings[0]') and
-                        output.find('(char *) strings[1]') and
-                        output.find('(char *) strings[2]') and
-                        output.find('(char *) strings[3]') and
-                        output.find('Hello') and
-                        output.find('Hola') and
-                        output.find('Bonjour') and
-                        output.find('Guten Tag'))
+                        output.find('(char *) strings[0]') > 0 and
+                        output.find('(char *) strings[1]') > 0 and
+                        output.find('(char *) strings[2]') > 0 and
+                        output.find('(char *) strings[3]') > 0 and
+                        output.find('Hello') > 0 and
+                        output.find('Hola') > 0 and
+                        output.find('Bonjour') > 0 and
+                        output.find('Guten Tag') > 0)
 
         self.ci.HandleCommand("variable list char_16", res);
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find('(char) char_16[0]') and
-                        res.GetOutput().find('(char) char_16[15]'))
+        self.assertTrue(res.GetOutput().find('(char) char_16[0]') > 0 and
+                        res.GetOutput().find('(char) char_16[15]') > 0)
 
         self.ci.HandleCommand("variable list ushort_matrix", res);
         self.assertTrue(res.Succeeded())

Modified: lldb/trunk/test/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/class_types/TestClassTypes.py?rev=107724&r1=107723&r2=107724&view=diff
==============================================================================
--- lldb/trunk/test/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/class_types/TestClassTypes.py Tue Jul  6 18:26:16 2010
@@ -30,13 +30,13 @@
         self.ci.HandleCommand("thread list", res)
         print "thread list ->", res.GetOutput()
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find('state is Stopped') and
-                        res.GetOutput().find('stop reason = breakpoint'))
+        self.assertTrue(res.GetOutput().find('state is Stopped') > 0 and
+                        res.GetOutput().find('stop reason = breakpoint') > 0)
 
         # The breakpoint should have a hit count of 1.
         self.ci.HandleCommand("breakpoint list", res)
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find(' resolved, hit count = 1'))
+        self.assertTrue(res.GetOutput().find(' resolved, hit count = 1') > 0)
 
         # We should be stopped on the ctor function of class C.
         self.ci.HandleCommand("variable list this", res);

Modified: lldb/trunk/test/function_types/TestFunctionTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/function_types/TestFunctionTypes.py?rev=107724&r1=107723&r2=107724&view=diff
==============================================================================
--- lldb/trunk/test/function_types/TestFunctionTypes.py (original)
+++ lldb/trunk/test/function_types/TestFunctionTypes.py Tue Jul  6 18:26:16 2010
@@ -30,13 +30,13 @@
         self.ci.HandleCommand("thread list", res)
         print "thread list ->", res.GetOutput()
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find('state is Stopped') and
-                        res.GetOutput().find('stop reason = breakpoint'))
+        self.assertTrue(res.GetOutput().find('state is Stopped') > 0 and
+                        res.GetOutput().find('stop reason = breakpoint') > 0)
 
         # The breakpoint should have a hit count of 1.
         self.ci.HandleCommand("breakpoint list", res)
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find(' resolved, hit count = 1'))
+        self.assertTrue(res.GetOutput().find(' resolved, hit count = 1') > 0)
 
         # Check that the 'callback' variable display properly.
         self.ci.HandleCommand("variable list callback", res);
@@ -55,9 +55,9 @@
         self.assertTrue(res.Succeeded())
         output = res.GetOutput()
         #print "process status =", output
-        self.assertTrue(output.find('where = a.out`string_not_empty') and
-                        output.find('main.c:12') and
-                        output.find('stop reason = breakpoint'))
+        self.assertTrue(output.find('where = a.out`string_not_empty') > 0 and
+                        output.find('main.c:12') > 0 and
+                        output.find('stop reason = breakpoint') > 0)
 
         self.ci.HandleCommand("continue", res)
         self.assertTrue(res.Succeeded())

Modified: lldb/trunk/test/global_variables/TestGlobalVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/global_variables/TestGlobalVariables.py?rev=107724&r1=107723&r2=107724&view=diff
==============================================================================
--- lldb/trunk/test/global_variables/TestGlobalVariables.py (original)
+++ lldb/trunk/test/global_variables/TestGlobalVariables.py Tue Jul  6 18:26:16 2010
@@ -30,24 +30,24 @@
         self.ci.HandleCommand("thread list", res)
         print "thread list ->", res.GetOutput()
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find('state is Stopped') and
-                        res.GetOutput().find('stop reason = breakpoint'))
+        self.assertTrue(res.GetOutput().find('state is Stopped') > 0 and
+                        res.GetOutput().find('stop reason = breakpoint') > 0)
 
         # The breakpoint should have a hit count of 1.
         self.ci.HandleCommand("breakpoint list", res)
         self.assertTrue(res.Succeeded())
-        self.assertTrue(res.GetOutput().find(' resolved, hit count = 1'))
+        self.assertTrue(res.GetOutput().find(' resolved, hit count = 1') > 0)
 
         # Check that GLOBAL scopes are indicated for the variables.
         self.ci.HandleCommand("variable list -s -a", res);
         self.assertTrue(res.Succeeded())
         output = res.GetOutput()
-        self.assertTrue(output.find('GLOBAL: g_file_static_cstr') and
-                        output.find('g_file_static_cstr') and
-                        output.find('GLOBAL: g_file_global_int') and
-                        output.find('(int) 42') and
-                        output.find('GLOBAL: g_file_global_cstr') and
-                        output.find('g_file_global_cstr'))
+        self.assertTrue(output.find('GLOBAL: g_file_static_cstr') > 0 and
+                        output.find('g_file_static_cstr') > 0 and
+                        output.find('GLOBAL: g_file_global_int') > 0 and
+                        output.find('(int) 42') > 0 and
+                        output.find('GLOBAL: g_file_global_cstr') > 0 and
+                        output.find('g_file_global_cstr') > 0)
 
         self.ci.HandleCommand("continue", res)
         self.assertTrue(res.Succeeded())





More information about the lldb-commits mailing list