mirror of
https://github.com/espressif/openthread.git
synced 2026-08-22 02:19:52 +00:00
[nexus] fix intermittent failure in test 5.6.6 (#12573)
This commit fixes an intermittent failure in Nexus test 5.6.6 by ensuring that the OnMeshPrefixConfig object is properly initialized before use. The OnMeshPrefixConfig object is declared on the stack and, if not explicitly cleared, may contain garbage values in its bit-fields (such as mDhcp or mPreference). This can cause the subsequent call to AddOnMeshPrefix() to fail its IsValid() check, resulting in a kErrorInvalidArgs error and a test failure. Changes: - Call config.Clear() after declaring the OnMeshPrefixConfig object in tests/nexus/test_5_6_6.cpp to ensure all fields are initialized to zero. This aligns the test implementation with other Nexus tests and improves the robustness of the test suite in simulation environments. Verified to pass in the Nexus simulation environment.
This commit is contained in:
@@ -159,6 +159,7 @@ void Test5_6_6(void)
|
||||
{
|
||||
NetworkData::OnMeshPrefixConfig config;
|
||||
|
||||
config.Clear();
|
||||
SuccessOrQuit(config.GetPrefix().FromString(kPrefix1));
|
||||
config.mStable = true;
|
||||
config.mOnMesh = true;
|
||||
|
||||
Reference in New Issue
Block a user