tests: Fix GCC -W(maybe-)uninitialized warnings

These all look like valid (but harmless) diagnostics to me and are
all simple to fix. Most of them can be fixed by using ASSERT_* variants
of the GTest checkers to ensure that the remainder of the function is
not executed and the uninitialized result isn't touched.

Change-Id: Ib5fe2ac2ec539c880d670ebc3321ce98940c7e38
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68517
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
Alex Richardson
2023-03-02 11:35:46 +00:00
parent b440355cbc
commit 18ba4e1278
2 changed files with 15 additions and 15 deletions

View File

@@ -136,7 +136,7 @@ TEST(CircleBufTest, PointerWrapAround)
TEST(CircleBufTest, ProduceConsumeEmpty)
{
CircleBuf<char> buf(8);
char foo[1];
char foo[1] = {'a'};
// buf is empty to begin with.
EXPECT_TRUE(buf.empty());