Skip to content

Commit 4700e91

Browse files
authored
Merge pull request #1874 from thetic/new-clang-warnings
Fix new clang warnings
2 parents 91f527c + 03fb1a1 commit 4700e91

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/CppUTestExt/MockActualCallTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ TEST(MockCheckedActualCall, unExpectedCallWithAnOutputParameter)
8585

8686
TEST(MockCheckedActualCall, unExpectedCallOnObject)
8787
{
88-
int object;
88+
int object = 0;
8989

9090
MockCheckedActualCall actualCall(1, reporter, *emptyList);
9191
actualCall.withName("unexpected").onObject(&object);
@@ -186,7 +186,7 @@ TEST(MockCheckedActualCall, MockIgnoredActualCallWorksAsItShould)
186186

187187
TEST(MockCheckedActualCall, remainderOfMockActualCallTraceWorksAsItShould)
188188
{
189-
int value;
189+
int value = 0;
190190
const int const_value = 1;
191191
const unsigned char mem_buffer[] = { 0xFE, 0x15 };
192192
void (*function_value)() = (void (*)())0xDEAD;

tests/CppUTestExt/MockFailureTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ TEST(MockFailureTest, MockUnexpectedInputParameterFailure)
177177

178178
TEST(MockFailureTest, MockUnexpectedOutputParameterFailure)
179179
{
180-
int out1;
181-
int out2;
180+
int out1 = 0;
181+
int out2 = 0;
182182
call1->withName("foo").withOutputParameterReturning("boo", &out1, sizeof(out1));
183183
call2->withName("foo").withOutputParameterReturning("boo", &out2, sizeof(out2));
184184
call3->withName("unrelated");
@@ -200,7 +200,7 @@ TEST(MockFailureTest, MockUnexpectedOutputParameterFailure)
200200

201201
TEST(MockFailureTest, MockUnexpectedUnmodifiedOutputParameterFailure)
202202
{
203-
int out1;
203+
int out1 = 0;
204204
call1->withName("foo").withOutputParameterReturning("boo", &out1, sizeof(out1));
205205
call2->withName("foo").withUnmodifiedOutputParameter("boo");
206206
call3->withName("unrelated");

tests/CppUTestExt/MockParameterTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ TEST(MockParameterTest, noActualCallForOutputParameter)
650650
{
651651
MockFailureReporterInstaller failureReporterInstaller;
652652

653-
int output;
653+
int output = 0;
654654
MockExpectedCallsListForTest expectations;
655655
mock().expectOneCall("foo").withOutputParameterReturning("output", &output, sizeof(output));
656656

@@ -697,7 +697,7 @@ TEST(MockParameterTest, outputParameterMissing)
697697
{
698698
MockFailureReporterInstaller failureReporterInstaller;
699699

700-
int output;
700+
int output = 0;
701701
MockExpectedCallsListForTest expectations;
702702
mock().expectOneCall("foo").withOutputParameterReturning("output", &output, sizeof(output));
703703
mock().actualCall("foo");

0 commit comments

Comments
 (0)