jingham added a comment.

The result from EvaluateExpression is pretty much always going to be valid, 
since the result holds the error.  The correct way to do the first check is:

self.assertTrue(eval_result.GetError().Fail(), "Unexpected success...")

though you probably also want to make sure "eval_result.IsValid()" too, just to 
be on the safe side.  It's good to check that first, especially if you are 
going to do a find rather than a strict compare.  I don't think there's any 
guarantee that you have to leave the string in an Error empty if you return 
`False` from SBError().Fail().

I'm on the fence about using a "find" not a strict string compare.  The only 
reason you'd be passing in an error_msg is that you want to test that you got 
the error string you were expecting.  I worry that using substrings will lead 
to weakening this test by having too general a match.  OTOH, it would be super 
annoying to match all of some of the compiler's error messages...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76080/new/

https://reviews.llvm.org/D76080



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to