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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user