Skip to content

Commit

Permalink
Make VerifyOrDo spelling clearer. (#18741)
Browse files Browse the repository at this point in the history
It took me a bit to figure out what the "Ordo" thing being verified was.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jun 29, 2023
1 parent 56a75cb commit 5289763
Show file tree
Hide file tree
Showing 6 changed files with 587 additions and 587 deletions.
2 changes: 1 addition & 1 deletion examples/chip-tool/templates/tests/partials/test_step.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{~#*inline "maybePICS"}}
{{#if PICS}}
VerifyOrdo(!ShouldSkip("{{PICS}}"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
VerifyOrDo(!ShouldSkip("{{PICS}}"), return ContinueOnChipMainThread(CHIP_NO_ERROR));
{{/if}}
{{/inline~}}

Expand Down
6 changes: 3 additions & 3 deletions src/lib/support/CodeUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,20 +593,20 @@ inline void chipDie(void)
} while (false)

/**
* @def VerifyOrdo(expr, ...)
* @def VerifyOrDo(expr, ...)
*
* @brief
* do something if expression evaluates to false
*
* Example usage:
*
* @code
* VerifyOrdo(param != nullptr, LogError("param is nullptr"));
* VerifyOrDo(param != nullptr, LogError("param is nullptr"));
* @endcode
*
* @param[in] expr A Boolean expression to be evaluated.
*/
#define VerifyOrdo(expr, ...) \
#define VerifyOrDo(expr, ...) \
do \
{ \
if (!(expr)) \
Expand Down
6 changes: 3 additions & 3 deletions src/platform/ESP32/KeyValueStoreManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t
ReturnErrorOnFailure(handle.Open(kNamespace, NVS_READONLY));

char keyHash[NVS_KEY_NAME_MAX_SIZE];
VerifyOrdo(HashIfLongKey(key, keyHash) == false, key = keyHash);
VerifyOrDo(HashIfLongKey(key, keyHash) == false, key = keyHash);

ReturnMappedErrorOnFailure(nvs_get_blob(handle, key, value, &value_size));

Expand All @@ -98,7 +98,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value,
ReturnErrorOnFailure(handle.Open(kNamespace, NVS_READWRITE));

char keyHash[NVS_KEY_NAME_MAX_SIZE];
VerifyOrdo(HashIfLongKey(key, keyHash) == false, key = keyHash);
VerifyOrDo(HashIfLongKey(key, keyHash) == false, key = keyHash);

ReturnMappedErrorOnFailure(nvs_set_blob(handle, key, value, value_size));

Expand All @@ -115,7 +115,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key)
ReturnErrorOnFailure(handle.Open(kNamespace, NVS_READWRITE));

char keyHash[NVS_KEY_NAME_MAX_SIZE];
VerifyOrdo(HashIfLongKey(key, keyHash) == false, key = keyHash);
VerifyOrDo(HashIfLongKey(key, keyHash) == false, key = keyHash);

ReturnMappedErrorOnFailure(nvs_erase_key(handle, key));

Expand Down
Loading

0 comments on commit 5289763

Please sign in to comment.