From 2d1835b086e69570e4c3e0ad6197da509bd0a957 Mon Sep 17 00:00:00 2001 From: "zhanyong.wan" Date: Mon, 27 Sep 2010 22:09:42 +0000 Subject: Removes uses of deprecated AssertionFailure() API (by Vlad Losev). --- scripts/gen_gtest_pred_impl.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_gtest_pred_impl.py b/scripts/gen_gtest_pred_impl.py index 39bb6cf7..d35b4f00 100755 --- a/scripts/gen_gtest_pred_impl.py +++ b/scripts/gen_gtest_pred_impl.py @@ -238,21 +238,19 @@ AssertionResult AssertPred%(n)sHelper(const char* pred_text""" % DEFS impl += """) { if (pred(%(vs)s)) return AssertionSuccess(); - Message msg; """ % DEFS - impl += ' msg << pred_text << "("' + impl += ' return AssertionFailure() << pred_text << "("' impl += Iter(n, """ - << e%s""", sep=' << ", "') + << e%s""", sep=' << ", "') impl += ' << ") evaluates to false, where"' impl += Iter(n, """ - << "\\n" << e%s << " evaluates to " << v%s""") + << "\\n" << e%s << " evaluates to " << v%s""") impl += """; - return AssertionFailure(msg); } // Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT%(n)s. @@ -478,15 +476,14 @@ testing::AssertionResult PredFormatFunction%(n)s(""" % DEFS if (PredFunction%(n)s(%(vs)s)) return testing::AssertionSuccess(); - testing::Message msg; - msg << """ % DEFS + return testing::AssertionFailure() + << """ % DEFS tests += Iter(n, 'e%s', sep=' << " + " << ') tests += """ << " is expected to be positive, but evaluates to " << %(v_sum)s << "."; - return testing::AssertionFailure(msg); } """ % DEFS -- cgit v1.2.3