Skip to content

Commit

Permalink
Update coding style with test method annotation (facebookincubator#2194)
Browse files Browse the repository at this point in the history
Summary:
Update coding style with test method annotation, e.g. if we want to add a test method say 'foo' to an object, we will name it with prefix TEST, TEST_foo.

Pull Request resolved: facebookincubator#2194

Reviewed By: pedroerp, mbasmanova

Differential Revision: D38372050

Pulled By: xiaoxmeng

fbshipit-source-id: df05b6c386c9c2217cb565080f93386a5a755f80
  • Loading branch information
xiaoxmeng authored and facebook-github-bot committed Feb 9, 2023
1 parent beccae1 commit 47b8423
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CODING_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ line width, indentation and ordering (for includes, using directives and etc). 
* Use **snake_case** for namespace names and build targets
* Use **UPPER_SNAKE_CASE** for macros.
* Use **kPascalCase** for static constants and enumerators.

* Use **testing** prefix for test only class methods, e.g. obj.testingFoo().
As much as possible, refrain from adding test methods, and test objects using
their public APIs. Only use test methods in rare edge cases where this is not
possible. For example, MemoryAllocator::testingSetFailureInjection() is used
to to inject various memory allocation failures to test error handling paths.

## Comments

Expand Down

0 comments on commit 47b8423

Please sign in to comment.