MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / FormatCountableNoun

Function FormatCountableNoun

test/common/gtest/gtest.cpp:4249–4254  ·  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

4247// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".
4248// FormatCountableNoun(5, "book", "books") returns "5 books".
4249static std::string FormatCountableNoun(int count,
4250 const char * singular_form,
4251 const char * plural_form) {
4252 return internal::StreamableToString(count) + " " +
4253 (count == 1 ? singular_form : plural_form);
4254}
4255
4256// Formats the count of tests.
4257static std::string FormatTestCount(int test_count) {

Callers 4

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

Calls 1

StreamableToStringFunction · 0.85

Tested by

no test coverage detected