Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit c86d19d

Browse files
committed
Address -Wmaybe-uninitialized warnings.
1 parent 12a8872 commit c86d19d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/test-apps/TestWdmUpdateEncoder.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
*
3+
* Copyright (c) 2018 Google LLC.
34
* Copyright (c) 2018 Nest Labs, Inc.
45
* All rights reserved.
56
*
@@ -274,26 +275,26 @@ void WdmUpdateEncoderTest::VerifyDataList(nlTestSuite *inSuite, PacketBuffer *aB
274275
i < firstItemNotEncoded;
275276
i = mPathList.GetNextValidItem(i))
276277
{
278+
DataElement::Parser element;
279+
TraitDataSink * dataSink = NULL;
280+
TraitDataHandle handle;
281+
PropertyPathHandle pathHandle;
282+
SchemaVersionRange versionRange;
283+
nl::Weave::TLV::TLVReader pathReader;
284+
277285
count++;
278286

279287
mPathList.GetItemAt(i, tp);
280288

281289
err = dataListReader.Next();
282290
NL_TEST_ASSERT(inSuite, err == WEAVE_NO_ERROR);
283291

284-
DataElement::Parser element;
285292
err = element.Init(dataListReader);
286293
NL_TEST_ASSERT(inSuite, err == WEAVE_NO_ERROR);
287294

288-
nl::Weave::TLV::TLVReader pathReader;
289-
290295
err = element.GetReaderOnPath(&pathReader);
291296
NL_TEST_ASSERT(inSuite, err == WEAVE_NO_ERROR);
292297

293-
TraitDataSink * dataSink;
294-
TraitDataHandle handle;
295-
PropertyPathHandle pathHandle;
296-
SchemaVersionRange versionRange;
297298

298299
err = mSinkCatalog.AddressToHandle(pathReader, handle, versionRange);
299300
NL_TEST_ASSERT(inSuite, err == WEAVE_NO_ERROR);
@@ -302,6 +303,7 @@ void WdmUpdateEncoderTest::VerifyDataList(nlTestSuite *inSuite, PacketBuffer *aB
302303

303304
err = mSinkCatalog.Locate(handle, &dataSink);
304305
NL_TEST_ASSERT(inSuite, err == WEAVE_NO_ERROR);
306+
NL_TEST_ASSERT(inSuite, dataSink != NULL);
305307

306308
err = dataSink->GetSchemaEngine()->MapPathToHandle(pathReader, pathHandle);
307309
NL_TEST_ASSERT(inSuite, err == WEAVE_NO_ERROR);

0 commit comments

Comments
 (0)