Mesa (main): gtest: Fix output of array ASSERT/EXPECT macros

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 11 18:18:32 UTC 2021


Module: Mesa
Branch: main
Commit: a4eecc543e6a441b6583710f0d7a777a9e560e7a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4eecc543e6a441b6583710f0d7a777a9e560e7a

Author: Caio Oliveira <caio.oliveira at intel.com>
Date:   Wed Nov 10 20:31:36 2021 -0800

gtest: Fix output of array ASSERT/EXPECT macros

Fixes: 015383d1d78 ("gtest: Add mesa-gtest-extras.h with array ASSERT/EXPECT macros")
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13748>

---

 src/gtest/include/mesa-gtest-extras.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gtest/include/mesa-gtest-extras.h b/src/gtest/include/mesa-gtest-extras.h
index ca3c5a9654d..71103fde6a7 100644
--- a/src/gtest/include/mesa-gtest-extras.h
+++ b/src/gtest/include/mesa-gtest-extras.h
@@ -57,7 +57,7 @@ array_equal_pred(const char *a_expr,
             result << "\n  [" << std::dec << std::setw(3) << i << "]";
          result << " "
                 << (a[i] == b[i] ? ' ' : '*')
-                << std::hex << std::setw(2) << +a[i];
+                << std::hex << std::setw(sizeof(T) * 2) << +a[i];
       }
       result << "\n\n";
 



More information about the mesa-commit mailing list