Skip to content

Commit

Permalink
Merge branch 'master' into feature/basic-app-install-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov authored May 14, 2024
2 parents 33b5912 + 878fbb7 commit 5407248
Show file tree
Hide file tree
Showing 45 changed files with 271 additions and 257 deletions.
12 changes: 6 additions & 6 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1232,47 +1232,47 @@ menu "CHIP Device Layer"
menu "Message Reliable Protocol Options"
config MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_THREAD
int "MRP local active retry interval for Thread network in milliseconds"
depends on OPENTHREAD_ENABLED
depends on ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 800
help
Base retry interval of the present Thread node when it is in the active state.

config MRP_LOCAL_ACTIVE_RETRY_INTERVAL_FOR_WIFI_ETHERNET
int "MRP local active retry interval for WIFI or ETHERNET network in milliseconds"
depends on !OPENTHREAD_ENABLED
depends on !ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 300
help
Base retry interval of the present node (WIFI or ETHERNET) when it is in the active state.

config MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_THREAD
int "MRP local idle retry interval for Thread network in milliseconds"
depends on OPENTHREAD_ENABLED
depends on ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 800
help
Base retry interval of the present Thread node when it is in the idle state.

config MRP_LOCAL_IDLE_RETRY_INTERVAL_FOR_WIFI_ETHERNET
int "MRP local idle retry interval for WIFI or ETHERNET network in milliseconds"
depends on !OPENTHREAD_ENABLED
depends on !ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 500
help
Base retry interval of the present node (WIFI or ETHERNET) when it is in the idle state.

config MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_THREAD
int "MRP retransmission delta timeout for Thread network in milliseconds"
depends on OPENTHREAD_ENABLED
depends on ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 500
help
A constant value added to the calculated retransmission timeout.

config MRP_RETRY_INTERVAL_SENDER_BOOST_FOR_WIFI_ETHERNET
int "MRP retransmission delta timeout for WIFI or ETHERNET network in milliseconds"
depends on !OPENTHREAD_ENABLED
depends on !ENABLE_MATTER_OVER_THREAD
range 0 3600000
default 0
help
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 48
#endif // SLI_SI91X_MCU_INTERFACE

#define configENABLE_FPU 0
#define configENABLE_FPU 1
#define configENABLE_MPU 0
/* FreeRTOS Secure Side Only and TrustZone Security Extension */
#define configRUN_FREERTOS_SECURE_ONLY 1
Expand Down
4 changes: 2 additions & 2 deletions src/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ if (chip_build_tests) {
]
}

# Skip on efr32 due to flash and/or ram limitations.
if (chip_device_platform != "efr32") {
tests += [
# TODO(#10447): App test has HF on EFR32.
"${chip_root}/src/app/tests",
"${chip_root}/src/credentials/tests",
"${chip_root}/src/lib/format/tests",
Expand Down Expand Up @@ -128,7 +128,7 @@ if (chip_build_tests) {
# https://github.com/project-chip/connectedhomeip/issues/9630
if (chip_device_platform != "nrfconnect" &&
chip_device_platform != "efr32") {
# TODO(#10447): Controller test has HF on EFR32.
# Doesn't compile on ef32. Multiple definitions issues with attribute storage and overflows flash memory.
tests += [ "${chip_root}/src/controller/tests/data_model" ]

# Skip controller test for Open IoT SDK
Expand Down
7 changes: 6 additions & 1 deletion src/app/icd/server/tests/TestICDManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,10 +1061,15 @@ TEST_F(TestICDManager, TestICDStateObserverOnTransitionToIdleModeEqualActiveMode

// Expire IdleMode timer
AdvanceClockAndRunEventLoop(1_s);
EXPECT_FALSE(mICDStateObserver.mOnTransitionToIdleCalled);
// In this scenario, The ICD state machine kicked a OnTransitionToIdle timer with a duration of 0 seconds.
// The freeRTOS systemlayer timer calls a 0s timer's callback instantly while on posix it take and 1 addition event loop.
// Thefore, the expect result diverges here based on the systemlayer implementation. Skip this check.
// https://github.com/project-chip/connectedhomeip/issues/33441
// EXPECT_FALSE(mICDStateObserver.mOnTransitionToIdleCalled);

// Expire OnTransitionToIdleMode
AdvanceClockAndRunEventLoop(1_ms32);
// All systems should have called the OnTransitionToIdle callback by now.
EXPECT_TRUE(mICDStateObserver.mOnTransitionToIdleCalled);

// Reset Old durations
Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/AppTestContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class AppContext : public LoopbackMessagingContext
{
public:
// Performs shared setup for all tests in the test suite
void SetUpTestSuite() override;
static void SetUpTestSuite();
// Performs shared teardown for all tests in the test suite
void TearDownTestSuite() override;
static void TearDownTestSuite();
// Performs setup for each individual test in the test suite
void SetUp() override;
void SetUp();
// Performs teardown for each individual test in the test suite
void TearDown() override;
void TearDown();
};

} // namespace Test
Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestAclAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ const nlTest sTests[] = {
nlTestSuite sSuite = {
"TestAclAttribute",
&sTests[0],
TestAccessContext::nlTestSetUpTestSuite,
TestAccessContext::nlTestTearDownTestSuite,
TestAccessContext::nlTestSetUp,
TestAccessContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestAccessContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestAccessContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestAccessContext, SetUp),
NL_TEST_WRAP_METHOD(TestAccessContext, TearDown),
};

} // namespace
Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestAclEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ nlTestSuite sSuite =
{
"TestAclEvent",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};
// clang-format on

Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestBufferedReadCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,10 @@ nlTestSuite theSuite =
{
"TestBufferedReadCallback",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};

}
Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestClusterStateCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,10 @@ nlTestSuite theSuite =
{
"TestClusterStateCache",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};

}
Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestCommandInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2120,10 +2120,10 @@ nlTestSuite sSuite =
{
"TestCommandInteraction",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};
// clang-format on

Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestEventLogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ const nlTest sTests[] = {
nlTestSuite sSuite = {
"EventLogging",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};

} // namespace
Expand Down
20 changes: 11 additions & 9 deletions src/app/tests/TestEventLoggingNoUTCTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ class TestContext : public chip::Test::AppContext
{
public:
// Performs shared setup for all tests in the test suite
void SetUpTestSuite() override
static void SetUpTestSuite()
{
chip::Test::AppContext::SetUpTestSuite();
mClock.Emplace(chip::System::SystemClock());
sClock.Emplace(chip::System::SystemClock());
}

// Performs shared teardown for all tests in the test suite
void TearDownTestSuite() override
static void TearDownTestSuite()
{
mClock.ClearValue();
sClock.ClearValue();
chip::Test::AppContext::TearDownTestSuite();
}

Expand Down Expand Up @@ -125,9 +125,11 @@ class TestContext : public chip::Test::AppContext

private:
chip::MonotonicallyIncreasingCounter<chip::EventNumber> mEventCounter;
chip::Optional<MockClock> mClock;
static chip::Optional<MockClock> sClock;
};

chip::Optional<MockClock> TestContext::sClock;

void ENFORCE_FORMAT(1, 2) SimpleDumpWriter(const char * aFormat, ...)
{
va_list args;
Expand Down Expand Up @@ -370,10 +372,10 @@ const nlTest sTests[] = {
nlTestSuite sSuite = {
"EventLogging",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};

} // namespace
Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestEventOverflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ nlTestSuite sSuite =
{
"TestEventOverflow",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};
// clang-format on

Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestFabricScopedEventLogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ nlTestSuite sSuite =
{
"TestFabricScopedEventLogging",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};
// clang-format on

Expand Down
8 changes: 4 additions & 4 deletions src/app/tests/TestInteractionModelEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,10 +773,10 @@ nlTestSuite sSuite =
{
"TestInteractionModelEngine",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};
// clang-format on

Expand Down
44 changes: 25 additions & 19 deletions src/app/tests/TestReadInteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ class TestContext : public chip::Test::AppContext
{
public:
// Performs shared setup for all tests in the test suite
void SetUpTestSuite() override
static void SetUpTestSuite()
{
chip::Test::AppContext::SetUpTestSuite();
gRealClock = &chip::System::SystemClock();
chip::System::Clock::Internal::SetSystemClockForTesting(&gMockClock);

if (mSyncScheduler)
if (sSyncScheduler)
{
gReportScheduler = chip::app::reporting::GetSynchronizedReportScheduler();
sUsingSubSync = true;
Expand All @@ -96,14 +96,8 @@ class TestContext : public chip::Test::AppContext
}
}

static int nlTestSetUpTestSuite_Sync(void * context)
{
static_cast<TestContext *>(context)->mSyncScheduler = true;
return nlTestSetUpTestSuite(context);
}

// Performs shared teardown for all tests in the test suite
void TearDownTestSuite() override
static void TearDownTestSuite()
{
chip::System::Clock::Internal::SetSystemClockForTesting(gRealClock);
chip::Test::AppContext::TearDownTestSuite();
Expand Down Expand Up @@ -133,9 +127,21 @@ class TestContext : public chip::Test::AppContext
chip::Test::AppContext::TearDown();
}

private:
protected:
chip::MonotonicallyIncreasingCounter<chip::EventNumber> mEventCounter;
bool mSyncScheduler = false;
static bool sSyncScheduler;
};

bool TestContext::sSyncScheduler = false;

class TestSyncContext : public TestContext
{
public:
static void SetUpTestSuite()
{
sSyncScheduler = true;
TestContext::SetUpTestSuite();
}
};

class TestEventGenerator : public chip::app::EventLoggingDelegate
Expand Down Expand Up @@ -5146,19 +5152,19 @@ const nlTest sTests[] = {
nlTestSuite sSuite = {
"TestReadInteraction",
&sTests[0],
TestContext::nlTestSetUpTestSuite,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestContext, SetUp),
NL_TEST_WRAP_METHOD(TestContext, TearDown),
};

nlTestSuite sSyncSuite = {
"TestSyncReadInteraction",
&sTests[0],
TestContext::nlTestSetUpTestSuite_Sync,
TestContext::nlTestTearDownTestSuite,
TestContext::nlTestSetUp,
TestContext::nlTestTearDown,
NL_TEST_WRAP_FUNCTION(TestSyncContext::SetUpTestSuite),
NL_TEST_WRAP_FUNCTION(TestSyncContext::TearDownTestSuite),
NL_TEST_WRAP_METHOD(TestSyncContext, SetUp),
NL_TEST_WRAP_METHOD(TestSyncContext, TearDown),
};

} // namespace
Expand Down
Loading

0 comments on commit 5407248

Please sign in to comment.