mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[tests] add build test for OT_ASSERT=OFF (#5333)
This commit adds a build test without OT_ASSERT to catch compile issues. - Add cmake option: OT_ASSERT=ON - Add build test with OT_ASSERT=OFF - Fixes 2 compile errors.
This commit is contained in:
@@ -30,6 +30,13 @@ option(OT_APP_CLI "enable CLI app" ON)
|
||||
option(OT_APP_NCP "enable NCP app" ON)
|
||||
option(OT_APP_RCP "enable RCP app" ON)
|
||||
|
||||
option(OT_ASSERT "enable assert function OT_ASSERT()" ON)
|
||||
if(OT_ASSERT)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ASSERT_ENABLE=1")
|
||||
else()
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_ASSERT_ENABLE=0")
|
||||
endif()
|
||||
|
||||
option(OT_BACKBONE_ROUTER "enable backbone router functionality")
|
||||
if(OT_BACKBONE_ROUTER)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1")
|
||||
|
||||
@@ -42,6 +42,8 @@ build_all_features()
|
||||
"$(dirname "$0")"/cmake-build simulation
|
||||
reset_source
|
||||
"$(dirname "$0")"/cmake-build simulation -DOT_OTNS=ON -DOT_SIMULATION_VIRTUAL_TIME=ON
|
||||
reset_source
|
||||
"$(dirname "$0")"/cmake-build simulation -DOT_OTNS=ON -DOT_SIMULATION_VIRTUAL_TIME=ON -DOT_ASSERT=OFF
|
||||
}
|
||||
|
||||
build_toranj()
|
||||
|
||||
@@ -1184,7 +1184,7 @@ otError TxFrame::GenerateEnhAck(const RxFrame &aFrame, bool aIsFramePending, con
|
||||
// Set frame length
|
||||
footerLength = GetFooterLength();
|
||||
OT_ASSERT(footerLength != kInvalidIndex);
|
||||
mLength = SkipSecurityHeaderIndex() + aIeLength + GetFooterLength();
|
||||
mLength = SkipSecurityHeaderIndex() + aIeLength + footerLength;
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
@@ -79,6 +79,7 @@ void Otns::EmitStatus(const char *aFmt, ...)
|
||||
va_start(ap, aFmt);
|
||||
|
||||
n = vsnprintf(statusStr, sizeof(statusStr), aFmt, ap);
|
||||
OT_UNUSED_VARIABLE(n);
|
||||
OT_ASSERT(n >= 0);
|
||||
|
||||
va_end(ap);
|
||||
|
||||
Reference in New Issue
Block a user