commit | 442ef2ee0c4567806108657c65ffb58dfb8dc08d | [log] [tgz] |
---|---|---|
author | Reilly Grant <[email protected]> | Tue Apr 22 23:50:08 2025 |
committer | Chromium LUCI CQ <[email protected]> | Tue Apr 22 23:50:08 2025 |
tree | b9c154847047e41241afb0fd25f63529a795da68 | |
parent | 154ca9d967bacb04a5eb60aab5e51d6934a8d303 [diff] [blame] |
Discourage `CHECK_IS_TEST` in *ForTesting functions. There is already a presubmit test which blocks adding calls to test-only functions to production code paths and adding `CHECK_IS_TEST` can make trivial test-only accessors non-trivial, reducing readability. Change-Id: I0a18f1bdd4da10cd690d043fd96dd69d38c70e9f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6480714 Commit-Queue: Solomon Kinard <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Auto-Submit: Reilly Grant <[email protected]> Commit-Queue: Reilly Grant <[email protected]> Reviewed-by: Solomon Kinard <[email protected]> Cr-Commit-Position: refs/heads/main@{#1450311}
diff --git a/base/check_is_test.h b/base/check_is_test.h index b2c5780a..d4d4de9 100644 --- a/base/check_is_test.h +++ b/base/check_is_test.h
@@ -34,6 +34,10 @@ // return; // } // +// `CHECK_IS_TEST` should not be used within functions named `*ForTesting`, +// `*ForTests`, etc. because there is a presubmit check which warns against +// calling such functions in production code. +// // `CHECK_IS_TEST` is thread safe. // // An optional base::NotFatalUntil argument can be provided to make the