aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorvladlosev <vladlosev@8415998a-534a-0410-bf83-d39667b30386>2010-05-13 18:16:03 +0000
committervladlosev <vladlosev@8415998a-534a-0410-bf83-d39667b30386>2010-05-13 18:16:03 +0000
commite2e8ba401d198d1a8304c652e997505609b62696 (patch)
tree9e63b75d2c7ca8d342e9c1dceab84c360eaa5ef2 /include
parent02f7106557fde1f1075dc53d65ef1f7a11851f93 (diff)
downloadgoogletest-e2e8ba401d198d1a8304c652e997505609b62696.tar.gz
googletest-e2e8ba401d198d1a8304c652e997505609b62696.tar.bz2
googletest-e2e8ba401d198d1a8304c652e997505609b62696.zip
Renames test script flags.
Diffstat (limited to 'include')
-rw-r--r--include/gmock/gmock-matchers.h27
-rw-r--r--include/gmock/gmock-more-actions.h10
-rw-r--r--include/gmock/gmock-spec-builders.h5
3 files changed, 26 insertions, 16 deletions
diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h
index fbbf5811..7f84761e 100644
--- a/include/gmock/gmock-matchers.h
+++ b/include/gmock/gmock-matchers.h
@@ -702,11 +702,11 @@ class AnythingMatcher {
} \
virtual void DescribeTo(::std::ostream* os) const { \
*os << relation " "; \
- UniversalPrinter<Rhs>::Print(rhs_, os); \
+ UniversalPrint(rhs_, os); \
} \
virtual void DescribeNegationTo(::std::ostream* os) const { \
*os << negated_relation " "; \
- UniversalPrinter<Rhs>::Print(rhs_, os); \
+ UniversalPrint(rhs_, os); \
} \
private: \
Rhs rhs_; \
@@ -910,7 +910,7 @@ class StrEqualityMatcher {
if (!case_sensitive_) {
*os << "(ignoring case) ";
}
- UniversalPrinter<StringType>::Print(string_, os);
+ UniversalPrint(string_, os);
}
const StringType string_;
@@ -947,12 +947,12 @@ class HasSubstrMatcher {
// Describes what this matcher matches.
void DescribeTo(::std::ostream* os) const {
*os << "has substring ";
- UniversalPrinter<StringType>::Print(substring_, os);
+ UniversalPrint(substring_, os);
}
void DescribeNegationTo(::std::ostream* os) const {
*os << "has no substring ";
- UniversalPrinter<StringType>::Print(substring_, os);
+ UniversalPrint(substring_, os);
}
private:
@@ -988,12 +988,12 @@ class StartsWithMatcher {
void DescribeTo(::std::ostream* os) const {
*os << "starts with ";
- UniversalPrinter<StringType>::Print(prefix_, os);
+ UniversalPrint(prefix_, os);
}
void DescribeNegationTo(::std::ostream* os) const {
*os << "doesn't start with ";
- UniversalPrinter<StringType>::Print(prefix_, os);
+ UniversalPrint(prefix_, os);
}
private:
@@ -1028,12 +1028,12 @@ class EndsWithMatcher {
void DescribeTo(::std::ostream* os) const {
*os << "ends with ";
- UniversalPrinter<StringType>::Print(suffix_, os);
+ UniversalPrint(suffix_, os);
}
void DescribeNegationTo(::std::ostream* os) const {
*os << "doesn't end with ";
- UniversalPrinter<StringType>::Print(suffix_, os);
+ UniversalPrint(suffix_, os);
}
private:
@@ -1879,11 +1879,11 @@ class ContainerEqMatcher {
void DescribeTo(::std::ostream* os) const {
*os << "equals ";
- UniversalPrinter<StlContainer>::Print(rhs_, os);
+ UniversalPrint(rhs_, os);
}
void DescribeNegationTo(::std::ostream* os) const {
*os << "does not equal ";
- UniversalPrinter<StlContainer>::Print(rhs_, os);
+ UniversalPrint(rhs_, os);
}
template <typename LhsContainer>
@@ -1913,8 +1913,7 @@ class ContainerEqMatcher {
*os << "which has these unexpected elements: ";
printed_header = true;
}
- UniversalPrinter<typename LhsStlContainer::value_type>::
- Print(*it, os);
+ UniversalPrint(*it, os);
}
}
@@ -1932,7 +1931,7 @@ class ContainerEqMatcher {
<< " doesn't have these expected elements: ";
printed_header2 = true;
}
- UniversalPrinter<typename StlContainer::value_type>::Print(*it, os);
+ UniversalPrint(*it, os);
}
}
}
diff --git a/include/gmock/gmock-more-actions.h b/include/gmock/gmock-more-actions.h
index 9a6fe969..6d686cd1 100644
--- a/include/gmock/gmock-more-actions.h
+++ b/include/gmock/gmock-more-actions.h
@@ -198,7 +198,17 @@ ACTION_TEMPLATE(DeleteArg,
// Action Throw(exception) can be used in a mock function of any type
// to throw the given exception. Any copyable value can be thrown.
#if GTEST_HAS_EXCEPTIONS
+
+// Suppresses the 'unreachable code' warning that VC generates in opt modes.
+#ifdef _MSC_VER
+#pragma warning(push) // Saves the current warning state.
+#pragma warning(disable:4702) // Temporarily disables warning 4702.
+#endif
ACTION_P(Throw, exception) { throw exception; }
+#ifdef _MSC_VER
+#pragma warning(pop) // Restores the warning state.
+#endif
+
#endif // GTEST_HAS_EXCEPTIONS
#ifdef _MSC_VER
diff --git a/include/gmock/gmock-spec-builders.h b/include/gmock/gmock-spec-builders.h
index 67c7a697..7038c2e4 100644
--- a/include/gmock/gmock-spec-builders.h
+++ b/include/gmock/gmock-spec-builders.h
@@ -1268,6 +1268,7 @@ class ActionResultHolder {
// Prints the held value as an action's result to os.
void PrintAsActionResult(::std::ostream* os) const {
*os << "\n Returns: ";
+ // T may be a reference type, so we don't use UniversalPrint().
UniversalPrinter<T>::Print(value_, os);
}
@@ -1539,7 +1540,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
*os << "Uninteresting mock function call - ";
DescribeDefaultActionTo(args, os);
*os << " Function call: " << Name();
- UniversalPrinter<ArgumentTuple>::Print(args, os);
+ UniversalPrint(args, os);
}
// Critical section: We must find the matching expectation and the
@@ -1775,7 +1776,7 @@ typename Function<F>::Result FunctionMockerBase<F>::InvokeWith(
}
ss << " Function call: " << Name();
- UniversalPrinter<ArgumentTuple>::Print(args, &ss);
+ UniversalPrint(args, &ss);
// In case the action deletes a piece of the expectation, we
// generate the message beforehand.