]> git.ipfire.org Git - thirdparty/gcc.git/commit
selftest: remove "Yoda ordering" in assertions
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 1 May 2018 00:02:49 +0000 (00:02 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 1 May 2018 00:02:49 +0000 (00:02 +0000)
commit47ae164c051c575234f4bef916f10346765d9565
tree760ea48318070f852bfd3d074f8b830bba1bb83e
parentfe43c635035edcd29eca0a8e3b08d8bcf14d9ba8
selftest: remove "Yoda ordering" in assertions

gcc/ChangeLog:
* selftest.c (assert_streq): Rename "expected" and "actual" to
"val1" and "val2".  Extend NULL-handling to cover both inputs
symmetrically, while still requiring both to be non-NULL for a pass.
* selftest.h (assert_streq): Rename "expected" and "actual" to
"val1" and "val2".
(ASSERT_EQ): Likewise.
(ASSERT_EQ_AT): Likewise.
(ASSERT_KNOWN_EQ): Likewise.
(ASSERT_KNOWN_EQ_AT): Likewise.
(ASSERT_NE): Likewise.
(ASSERT_MAYBE_NE): Likewise.
(ASSERT_MAYBE_NE_AT): Likewise.
(ASSERT_STREQ): Likewise.  Clarify that both must be non-NULL for
the assertion to pass.
(ASSERT_STREQ_AT): Likewise.

From-SVN: r259782
gcc/ChangeLog
gcc/selftest.c
gcc/selftest.h