[code-utils] enhance 'VerifyOrExit' to make action optional (#5659)

This commit uses the newly added macros from `arg_macros.hpp` to
enhance `VerifyOfExit()` enabling `aAction` argument to be optional.
This commit is contained in:
Abtin Keshavarzian
2020-10-16 08:07:16 -07:00
committed by Jonathan Hui
parent 8691e90d55
commit c9c0cf404d
112 changed files with 701 additions and 681 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otInstance *instance = nullptr;
uint8_t * buf = nullptr;
VerifyOrExit(size <= 65536, OT_NOOP);
VerifyOrExit(size <= 65536);
FuzzerPlatformInit();
@@ -67,7 +67,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otPlatUartReceived(buf, (uint16_t)size);
VerifyOrExit(!FuzzerPlatformResetWasRequested(), OT_NOOP);
VerifyOrExit(!FuzzerPlatformResetWasRequested());
for (int i = 0; i < MAX_ITERATIONS; i++)
{
+2 -2
View File
@@ -50,7 +50,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otError error = OT_ERROR_NONE;
otMessageSettings settings;
VerifyOrExit(size > 0, OT_NOOP);
VerifyOrExit(size > 0);
FuzzerPlatformInit();
@@ -73,7 +73,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
message = nullptr;
VerifyOrExit(!FuzzerPlatformResetWasRequested(), OT_NOOP);
VerifyOrExit(!FuzzerPlatformResetWasRequested());
for (int i = 0; i < MAX_ITERATIONS; i++)
{
+2 -2
View File
@@ -50,7 +50,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otInstance *instance = nullptr;
uint8_t * buf = nullptr;
VerifyOrExit(size <= 65536, OT_NOOP);
VerifyOrExit(size <= 65536);
FuzzerPlatformInit();
@@ -67,7 +67,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otPlatUartReceived(buf, (uint16_t)size);
VerifyOrExit(!FuzzerPlatformResetWasRequested(), OT_NOOP);
VerifyOrExit(!FuzzerPlatformResetWasRequested());
for (int i = 0; i < MAX_ITERATIONS; i++)
{
+2 -2
View File
@@ -50,7 +50,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otRadioFrame frame;
uint8_t * buf = nullptr;
VerifyOrExit(size <= OT_RADIO_FRAME_MAX_SIZE, OT_NOOP);
VerifyOrExit(size <= OT_RADIO_FRAME_MAX_SIZE);
FuzzerPlatformInit();
@@ -71,7 +71,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
otPlatRadioReceiveDone(instance, &frame, OT_ERROR_NONE);
VerifyOrExit(!FuzzerPlatformResetWasRequested(), OT_NOOP);
VerifyOrExit(!FuzzerPlatformResetWasRequested());
for (int i = 0; i < MAX_ITERATIONS; i++)
{