Help clang static analyzer in security tests

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2020-06-06 19:02:16 +02:00 committed by eboasson
parent 8a748e1868
commit ece3a78211
35 changed files with 443 additions and 31 deletions

View file

@ -74,6 +74,10 @@ static DDS_Security_ValidationResult_t test_validate_local_identity_all_ok(
identity_certificate = participant_qos->property.value._buffer[i].value;
}
assert(identity_certificate != NULL);
assert(identity_ca != NULL);
assert(private_key != NULL);
if (strcmp(identity_certificate, test_identity_certificate))
{
printf("identity received=%s\n", identity_certificate);

View file

@ -284,6 +284,7 @@ static void handle_validate_local_identity (dds_domainid_t domain_id, bool exp_l
break;
}
CU_ASSERT_FATAL (msg != NULL);
assert (msg != NULL);
CU_ASSERT_FATAL ((msg->result == DDS_SECURITY_VALIDATION_OK) != exp_localid_fail);
if (exp_localid_fail && exp_localid_msg)
{