commit | 3d80922b40675a824153109bd9548fc459af473c | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@google.com> | Mon Aug 02 11:36:00 2021 -0700 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Aug 02 20:45:53 2021 +0000 |
tree | 771797cbab5d42460bc5fb9b536c0ad7cefdc7fa | |
parent | 6c65a17f6971f47dc492aabfc448a499038b17f9 [diff] |
pw_assert: Prevent double evaluation in PW_CHECK_OK - Previously, the PW_CHECK_OK expression was evaluated twice: once in the if statement, and, when the CHECK failed, again in pw_StatusString. Now the status is stored in a variable before it is checked. - Update the multi-evaluation tests to avoid using global state. - Switch from #if PW_ASSERT_ENABLE_DEBUG to a constant to avoid duplication and the risk of code rot. - Add multi-evaluation tests for PW_CHECK_OK and PW_DCHECK_OK. Change-Id: Ic6895eff2daf4a06eda833dba9a0d61a0c2922fa Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55504 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Reviewed-by: Keir Mierle <keir@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
See our website: http://pigweed.dev