summaryrefslogtreecommitdiffstats
path: root/googletest/test
diff options
context:
space:
mode:
authormisterg <misterg@google.com>2019-01-03 21:32:01 (GMT)
committerGennadiy Civil <misterg@google.com>2019-01-03 21:40:27 (GMT)
commit827515f8a092050901d4eb9fdc1ddbb972f38442 (patch)
tree8654380eab99fc4511cbd6892943dea4ef752f63 /googletest/test
parent3a460a26b7a91abf87af7f31b93d29f930e25c82 (diff)
downloadgoogletest-827515f8a092050901d4eb9fdc1ddbb972f38442.zip
googletest-827515f8a092050901d4eb9fdc1ddbb972f38442.tar.gz
googletest-827515f8a092050901d4eb9fdc1ddbb972f38442.tar.bz2
Googletest export
Fixes #1261 PiperOrigin-RevId: 227740670
Diffstat (limited to 'googletest/test')
-rw-r--r--googletest/test/gtest_pred_impl_unittest.cc2
-rw-r--r--googletest/test/gtest_unittest.cc10
2 files changed, 11 insertions, 1 deletions
diff --git a/googletest/test/gtest_pred_impl_unittest.cc b/googletest/test/gtest_pred_impl_unittest.cc
index 2019a30..049ef98 100644
--- a/googletest/test/gtest_pred_impl_unittest.cc
+++ b/googletest/test/gtest_pred_impl_unittest.cc
@@ -27,7 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// This file is AUTOMATICALLY GENERATED on 01/02/2018 by command
+// This file is AUTOMATICALLY GENERATED on 01/02/2019 by command
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
// Regression test for gtest_pred_impl.h
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 6c7d551..5e0e43a 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -2357,6 +2357,16 @@ TEST(PredTest, SingleEvaluationOnFailure) {
EXPECT_EQ(1, n4) << "Argument 4 is not evaluated exactly once.";
}
+// Test predicate assertions for sets
+TEST(PredTest, ExpectPredEvalFailure) {
+ std::set<int> set_a = {2, 1, 3, 4, 5};
+ std::set<int> set_b = {0, 4, 8};
+ const auto compare_sets = [] (std::set<int>, std::set<int>) { return false; };
+ EXPECT_NONFATAL_FAILURE(
+ EXPECT_PRED2(compare_sets, set_a, set_b),
+ "compare_sets(set_a, set_b) evaluates to false, where\nset_a evaluates "
+ "to { 1, 2, 3, 4, 5 }\nset_b evaluates to { 0, 4, 8 }");
+}
// Some helper functions for testing using overloaded/template
// functions with ASSERT_PREDn and EXPECT_PREDn.