Commit Graph

8 Commits

Author SHA1 Message Date
Caio Oliveira a4eecc543e gtest: Fix output of array ASSERT/EXPECT macros
Fixes: 015383d1d7 ("gtest: Add mesa-gtest-extras.h with array ASSERT/EXPECT macros")
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13748>
2021-11-11 09:53:09 -08:00
Caio Oliveira 015383d1d7 gtest: Add mesa-gtest-extras.h with array ASSERT/EXPECT macros
There are no similar macros in gtest.  They do recommend pulling
another library (gmock) and use that, but having our own let us
control the output more precisely.  Extracted the code from a similar
existing macro in blob_test.cpp, making changes to the output.

A check like

   ASSERT_U8_ARRAY_EQUAL(expected_u8, result_u8, 32);

that fails will output

```
Expected 32 values to be equal but found 1 that differ:

expected_u8 values are:

  [000]  29  44  00  00  44  60  cb  80  93  65  07  c0  08  00  40  29
  [016]  03  81  00  00  5c  a0  21  87 *b0  31  00  00  00  00  00  60

result_u8 values are:

  [000]  29  44  00  00  44  60  cb  80  93  65  07  c0  08  00  40  29
  [016]  03  81  00  00  5c  a0  21  87 *af  31  00  00  00  00  00  60
```

and a check like

   ASSERT_U64_ARRAY_EQUAL(expected_u64, result_u64, 4);

```
Expected 4 values to be equal but found 1 that differ:

expected_u64 values are:

  [000]  80cb604400004429  29400008c0076593
  [002]  8721a05c00008103 *60000000000031b0

result_u64 values are:

  [000]  80cb604400004429  29400008c0076593
  [002]  8721a05c00008103 *60000000000031af
```

Note the asterisk indicating wrong values.

The new header for extra macros is in src/gtest/include/ so it
doesn't get in the way when updating the real gtest headers that are
in src/gtest/include/gtest/.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13672>
2021-11-08 17:42:18 +00:00
Erik Faye-Lund ed29b24e23 gtest: Update to 1.10.0
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4576>
2020-04-20 11:57:11 +00:00
Matt Turner 3eada948a0 gtest: Update to 1.8.0.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2017-01-20 11:40:52 -08:00
Giuseppe Bilotta 60a27ad122 Remove wrongly repeated words in comments
Clean up misrepetitions ('if if', 'the the' etc) found throughout the
comments. This has been done manually, after grepping
case-insensitively for duplicate if, is, the, then, do, for, an,
plus a few other typos corrected in fly-by

v2:
    * proper commit message and non-joke title;
    * replace two 'as is' followed by 'is' to 'as-is'.
v3:
    * 'a integer' => 'an integer' and similar (originally spotted by
      Jason Ekstrand, I fixed a few other similar ones while at it)

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2016-06-23 13:55:03 -07:00
Zoë Blade 05e7f7f438 Fix a few typos
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-04-27 17:28:29 +03:00
Vinson Lee 36fb36aa36 gtest: Update to 1.7.0.
This patch fixes gtest build errors on Mac OS X 10.9.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73106
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-14 00:06:53 -07:00
Ian Romanick 3d000e7dd1 gtest: Fix up import of gtest 1.6.0
The include files were all missing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-04-12 17:17:52 -07:00