Skip to content

Commit

Permalink
Set of fixes to unit-tests code (project-chip#23071)
Browse files Browse the repository at this point in the history
* [Fix] Execute TestLogBufferAsHex only if CHIP_PROGRESS_LOGGING

TestLogBufferAsHex test validates the LogBufferAsHex function
which uses ChipLogProgress().
If progress logging is disable this test failed.
Execute it only if CHIP_PROGRESS_LOGGING is defined.

Signed-off-by: ATmobica <artur.tynecki@mobica.com>

* [Fix] Fix PeerAddress string conversion test

Allow uppercase IPV6 string conversion. Check both cases.

Signed-off-by: ATmobica <artur.tynecki@mobica.com>

* [Fix] Fix ArgParser in support library

Fix parse args for embedded non posix long_opt implementation.
Disable a parse args unit test for non posix long_opt.
Fix duplicate id in option sets in ParseArgs unit test.

Signed-off-by: ATmobica <artur.tynecki@mobica.com>

* [Fix] Fix warnings of incorrect types in printf formatting

src/app/util/mock/attribute-storage.cpp
src/controller/tests/data_model/TestRead.cpp
src/lib/support/jsontlv/TlvJson.cpp

Signed-off-by: ATmobica <artur.tynecki@mobica.com>

* [Fix] Add missing assert header include in TestInetCommonPosix

Signed-off-by: ATmobica <artur.tynecki@mobica.com>

* [Fix] Fix TestReadInteraction implementation

Remove leftover debug printf.
Drain and service IO repeatedly until condition met.

Signed-off-by: ATmobica <artur.tynecki@mobica.com>

* [Fix] Fix controller unit tests

Change TestReadChunkingTests to TestEventChunkingTests in
TestEventChunkingTests.cpp

Signed-off-by: ATmobica <artur.tynecki@mobica.com>

Signed-off-by: ATmobica <artur.tynecki@mobica.com>
  • Loading branch information
ATmobica authored and adbridge committed Nov 18, 2022
1 parent af953ea commit c6a8cec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/app/tests/TestReadInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,10 @@ void TestReadInteraction::TestSubscribeWildcard(nlTestSuite * apSuite, void * ap
err = engine->GetReportingEngine().SetDirty(dirtyPath);
NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR);

//
// We need to DrainAndServiceIO() until attribute callback will be called.
// This is not correct behavior and is tracked in Issue #17528.
//
int last;
do
{
Expand Down
6 changes: 4 additions & 2 deletions src/lib/support/tests/TestBytesToHex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,10 @@ const nlTest sTests[] = {
NL_TEST_DEF("TestBytesToHexErrors", TestBytesToHexErrors), //
NL_TEST_DEF("TestBytesToHexUint64", TestBytesToHexUint64), //
NL_TEST_DEF("TestHexToBytesAndUint", TestHexToBytesAndUint), //
NL_TEST_DEF("TestLogBufferAsHex", TestLogBufferAsHex), //
NL_TEST_SENTINEL() //
#ifdef CHIP_PROGRESS_LOGGING
NL_TEST_DEF("TestLogBufferAsHex", TestLogBufferAsHex), //
#endif
NL_TEST_SENTINEL() //
};

} // namespace
Expand Down

0 comments on commit c6a8cec

Please sign in to comment.