Module: Mesa Branch: main Commit: f100551beeaead307f4bfe6c53727c93f3e1803a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f100551beeaead307f4bfe6c53727c93f3e1803a
Author: Alyssa Rosenzweig <[email protected]> Date: Thu Sep 23 16:53:47 2021 -0400 panfrost: Fix incorrect test condition Oh, the irony. I linked to this file in a software design class as an example of how unit testing works under the hood, since it's not using any particular testing framework. In doing so I realized the test is totally broken. It doesn't matter -- the tests passed before, pass now, and the code being tested is correct. But let's still fix the embarassing logic error for future Panfrost hackers. Fixes: d42e53c77a2 ("panfrost: Unit test clear colour packing") Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13006> --- src/panfrost/lib/tests/test-clear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/lib/tests/test-clear.c b/src/panfrost/lib/tests/test-clear.c index ea0dff245f7..b55a290f406 100644 --- a/src/panfrost/lib/tests/test-clear.c +++ b/src/panfrost/lib/tests/test-clear.c @@ -139,7 +139,7 @@ static const struct test clear_tests[] = { }; #define ASSERT_EQ(x, y) do { \ - if ((x[0] == y[0]) || (x[1] == y[1]) || (x[2] == y[2]) || (x[3] == y[3])) { \ + if ((x[0] == y[0]) && (x[1] == y[1]) && (x[2] == y[2]) && (x[3] == y[3])) { \ nr_pass++; \ } else { \ nr_fail++; \
