gmock-matchers.cc (googletest-release-1.11.0) | : | gmock-matchers.cc (googletest-release-1.12.0) | ||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
// Google Mock - a framework for writing C++ mock classes. | // Google Mock - a framework for writing C++ mock classes. | |||
// | // | |||
// This file implements Matcher<const string&>, Matcher<string>, and | // This file implements Matcher<const string&>, Matcher<string>, and | |||
// utilities for defining matchers. | // utilities for defining matchers. | |||
#include "gmock/gmock-matchers.h" | #include "gmock/gmock-matchers.h" | |||
#include <string.h> | #include <string.h> | |||
#include <iostream> | #include <iostream> | |||
#include <sstream> | #include <sstream> | |||
#include <string> | #include <string> | |||
#include <vector> | ||||
namespace testing { | namespace testing { | |||
namespace internal { | namespace internal { | |||
// Returns the description for a matcher defined using the MATCHER*() | // Returns the description for a matcher defined using the MATCHER*() | |||
// macro where the user-supplied description string is "", if | // macro where the user-supplied description string is "", if | |||
// 'negation' is false; otherwise returns the description of the | // 'negation' is false; otherwise returns the description of the | |||
// negation of the matcher. 'param_values' contains a list of strings | // negation of the matcher. 'param_values' contains a list of strings | |||
// that are the print-out of the matcher's parameters. | // that are the print-out of the matcher's parameters. | |||
GTEST_API_ std::string FormatMatcherDescription(bool negation, | GTEST_API_ std::string FormatMatcherDescription( | |||
const char* matcher_name, | bool negation, const char* matcher_name, | |||
const Strings& param_values) { | const std::vector<const char*>& param_names, const Strings& param_values) { | |||
std::string result = ConvertIdentifierNameToWords(matcher_name); | std::string result = ConvertIdentifierNameToWords(matcher_name); | |||
if (param_values.size() >= 1) result += " " + JoinAsTuple(param_values); | if (param_values.size() >= 1) { | |||
result += " " + JoinAsKeyValueTuple(param_names, param_values); | ||||
} | ||||
return negation ? "not (" + result + ")" : result; | return negation ? "not (" + result + ")" : result; | |||
} | } | |||
// FindMaxBipartiteMatching and its helper class. | // FindMaxBipartiteMatching and its helper class. | |||
// | // | |||
// Uses the well-known Ford-Fulkerson max flow method to find a maximum | // Uses the well-known Ford-Fulkerson max flow method to find a maximum | |||
// bipartite matching. Flow is considered to be from left to right. | // bipartite matching. Flow is considered to be from left to right. | |||
// There is an implicit source node that is connected to all of the left | // There is an implicit source node that is connected to all of the left | |||
// nodes, and an implicit sink node that is connected to all of the | // nodes, and an implicit sink node that is connected to all of the | |||
// right nodes. All edges have unit capacity. | // right nodes. All edges have unit capacity. | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 8 lines changed or added |