MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / FormatCountableNoun

Function FormatCountableNoun

rtpose_wrapper/src/gtest/gtest-all.cpp:3782–3787  ·  view source on GitHub ↗

Formats a countable noun. Depending on its quantity, either the singular form or the plural form is used. e.g. FormatCountableNoun(1, "formula", "formuli") returns "1 formula". FormatCountableNoun(5, "book", "books") returns "5 books".

Source from the content-addressed store, hash-verified

3780// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".
3781// FormatCountableNoun(5, "book", "books") returns "5 books".
3782static internal::String FormatCountableNoun(int count,
3783 const char * singular_form,
3784 const char * plural_form) {
3785 return internal::String::Format("%d %s", count,
3786 count == 1 ? singular_form : plural_form);
3787}
3788
3789// Formats the count of tests.
3790static internal::String FormatTestCount(int test_count) {

Callers 4

FormatTestCountFunction · 0.85
FormatTestCaseCountFunction · 0.85
OnTestCaseStartMethod · 0.85
OnTestCaseEndMethod · 0.85

Calls 1

FormatClass · 0.85

Tested by

no test coverage detected