Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable asan for unit tests when compiling with clang. #11824

Merged
merged 1 commit into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ jobs:
run: |
for BUILD_TYPE in clang python_lib; do
case $BUILD_TYPE in
"clang") GN_ARGS='is_clang=true target_os="all"';;
"clang") GN_ARGS='is_clang=true target_os="all" is_asan=true';;
"python_lib") GN_ARGS='enable_rtti=true enable_pylib=true';;
esac
scripts/build/gn_gen.sh --args="$GN_ARGS"
Expand Down
2 changes: 1 addition & 1 deletion src/access/tests/TestAccessControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ void TestDeleteEntry(nlTestSuite * inSuite, void * inContext)
NL_TEST_ASSERT(inSuite, ClearAccessControl(accessControl) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, LoadAccessControl(accessControl, data, ArraySize(data)) == CHIP_NO_ERROR);

memcpy(&data[pos], &data[pos + count], (ArraySize(data) - count - pos) * sizeof(data[0]));
memmove(&data[pos], &data[pos + count], (ArraySize(data) - count - pos) * sizeof(data[0]));

for (size_t i = 0; i < count; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/bdx/BdxMessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ size_t TransferInit::MessageSize() const
void TransferInit::LogMessage(bdx::MessageType messageType) const
{
char fd[kMaxFileDesignatorLen];
snprintf(fd, sizeof(fd), "%s", FileDesignator);
snprintf(fd, sizeof(fd), "%.*s", static_cast<int>(FileDesLength), FileDesignator);

switch (messageType)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class DLL_EXPORT UserDirectedCommissioningServer : public TransportMgrDelegate
* Get the cache of UDC Clients
*
*/
UDCClients<kMaxUDCClients> GetUDCClients() { return mUdcClients; }
UDCClients<kMaxUDCClients> & GetUDCClients() { return mUdcClients; }

/**
* Print the cache of UDC Clients
Expand Down