diff --git a/unittests/ADT/ImmutableSetTest.cpp b/unittests/ADT/ImmutableSetTest.cpp index febd441db16..a6eb405db72 100644 --- a/unittests/ADT/ImmutableSetTest.cpp +++ b/unittests/ADT/ImmutableSetTest.cpp @@ -181,19 +181,22 @@ TEST_F(ImmutableSetTest, IterLongSetTest) { int i = 0; for (ImmutableSet::iterator I = S.begin(), E = S.end(); I != E; ++I) { - ASSERT_EQ(i++, *I); + ASSERT_EQ(i, *I); + i++; } ASSERT_EQ(0, i); i = 0; for (ImmutableSet::iterator I = S2.begin(), E = S2.end(); I != E; ++I) { - ASSERT_EQ(i++, *I); + ASSERT_EQ(i, *I); + i++; } ASSERT_EQ(3, i); i = 0; for (ImmutableSet::iterator I = S3.begin(), E = S3.end(); I != E; I++) { - ASSERT_EQ(i++, *I); + ASSERT_EQ(i, *I); + i++; } ASSERT_EQ(6, i); } diff --git a/unittests/ADT/SequenceTest.cpp b/unittests/ADT/SequenceTest.cpp index d82c3c2d4ef..cc82f86c30d 100644 --- a/unittests/ADT/SequenceTest.cpp +++ b/unittests/ADT/SequenceTest.cpp @@ -18,8 +18,10 @@ namespace { TEST(SequenceTest, Basic) { int x = 0; - for (int i : seq(0, 10)) - EXPECT_EQ(x++, i); + for (int i : seq(0, 10)) { + EXPECT_EQ(x, i); + x++; + } EXPECT_EQ(10, x); auto my_seq = seq(0, 4);