On Wed, Sep 28, 2016 at 9:10 PM Jason Molenda via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

>
> +  EXPECT_TRUE(regloc.GetOffset() == -8);
>
This should be

EXPECT_EQ(-8, regloc.GetOffset());

That way if it fails, you'll get a handy error message that says:

Expected: -8
Actual: -7

If you use EXPECT_TRUE, it's not going to tell you the actual value.  The
same goes for many other places in the file.  Note that you're supposed to
put the expected value *first*.  The test is the same either way obviously,
but it affects the printing of the above message.


> +
> +  // these could be set to IsSame and be valid -- meaning that the
> +  // register value is the same as the caller's -- but I'd rather
> +  // they not be mentioned at all.
> +  EXPECT_TRUE(row_sp->GetRegisterInfo(k_rbp, regloc) == false);
> +  EXPECT_TRUE(row_sp->GetRegisterInfo(k_r15, regloc) == false);
> +  EXPECT_TRUE(row_sp->GetRegisterInfo(k_r14, regloc) == false);
> +  EXPECT_TRUE(row_sp->GetRegisterInfo(k_r13, regloc) == false);
> +  EXPECT_TRUE(row_sp->GetRegisterInfo(k_r12, regloc) == false);
> +  EXPECT_TRUE(row_sp->GetRegisterInfo(k_rbx, regloc) == false);
>
If you're using EXPECT_TRUE and EXPECT_FALSE, I think it's more intuitive
to not use the comparison operator.  The above is just

EXPECT_FALSE(row_sp->GetRegisterInfo(k_rbx, regloc));
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to